1 /* Generated by Cython 0.13 on Tue Jun 7 17:24:36 2011 */
3 #define PY_SSIZE_T_CLEAN
6 #error Python headers needed to compile C extensions, please install development version of Python.
9 #include <stddef.h> /* For offsetof */
11 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
14 #if !defined(WIN32) && !defined(MS_WINDOWS)
27 #define DL_IMPORT(t) t
30 #define DL_EXPORT(t) t
34 #define PY_LONG_LONG LONG_LONG
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)
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)
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)
73 Py_ssize_t *suboffsets;
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)
89 #if PY_MAJOR_VERSION < 3
90 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
92 #define __Pyx_BUILTIN_MODULE_NAME "builtins"
95 #if PY_MAJOR_VERSION >= 3
96 #define Py_TPFLAGS_CHECKTYPES 0
97 #define Py_TPFLAGS_HAVE_INDEX 0
100 #if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3)
101 #define Py_TPFLAGS_HAVE_NEWBUFFER 0
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
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)
133 #ifndef PySet_CheckExact
134 # define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
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
153 #if PY_MAJOR_VERSION >= 3
154 #define PyBoolObject PyLongObject
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)
162 #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
163 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
166 #if PY_MAJOR_VERSION >= 3
167 #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
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)))
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))
180 #if PY_VERSION_HEX < 0x02050000
181 #define __Pyx_NAMESTR(n) ((char *)(n))
182 #define __Pyx_DOCSTR(n) ((char *)(n))
184 #define __Pyx_NAMESTR(n) (n)
185 #define __Pyx_DOCSTR(n) (n)
189 #define __PYX_EXTERN_C extern "C"
191 #define __PYX_EXTERN_C extern
194 #if defined(WIN32) || defined(MS_WINDOWS)
195 #define _USE_MATH_DEFINES
198 #define __PYX_HAVE_API__csamtools
205 #include "fileobject.h"
211 #include "bam_maqcns.h"
213 #include "pysam_util.h"
214 #include "pythread.h"
216 /* inline attribute */
217 #ifndef CYTHON_INLINE
218 #if defined(__GNUC__)
219 #define CYTHON_INLINE __inline__
220 #elif defined(_MSC_VER)
221 #define CYTHON_INLINE __inline
222 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
223 #define CYTHON_INLINE inline
225 #define CYTHON_INLINE
229 /* unused attribute */
230 #ifndef CYTHON_UNUSED
231 # if defined(__GNUC__)
232 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
233 # define CYTHON_UNUSED __attribute__ ((__unused__))
235 # define CYTHON_UNUSED
237 # elif defined(__ICC) || defined(__INTEL_COMPILER)
238 # define CYTHON_UNUSED __attribute__ ((__unused__))
240 # define CYTHON_UNUSED
244 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*/
247 /* Type Conversion Predeclarations */
249 #define __Pyx_PyBytes_FromUString(s) PyBytes_FromString((char*)s)
250 #define __Pyx_PyBytes_AsUString(s) ((unsigned char*) PyBytes_AsString(s))
252 #define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False))
253 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
254 static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x);
256 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
257 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
258 static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*);
260 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
264 /* Test for GCC > 2.95 */
265 #if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))
266 #define likely(x) __builtin_expect(!!(x), 1)
267 #define unlikely(x) __builtin_expect(!!(x), 0)
268 #else /* __GNUC__ > 2 ... */
269 #define likely(x) (x)
270 #define unlikely(x) (x)
271 #endif /* __GNUC__ > 2 ... */
273 #define likely(x) (x)
274 #define unlikely(x) (x)
275 #endif /* __GNUC__ */
277 static PyObject *__pyx_m;
278 static PyObject *__pyx_b;
279 static PyObject *__pyx_empty_tuple;
280 static PyObject *__pyx_empty_bytes;
281 static int __pyx_lineno;
282 static int __pyx_clineno = 0;
283 static const char * __pyx_cfilenm= __FILE__;
284 static const char *__pyx_filename;
287 static const char *__pyx_f[] = {
293 /* Type declarations */
295 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":388
298 * ctypedef struct MateData: # <<<<<<<<<<<<<<
307 } __pyx_t_9csamtools_MateData;
309 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1478
310 * ##-------------------------------------------------------------------
311 * ##-------------------------------------------------------------------
312 * ctypedef struct __iterdata: # <<<<<<<<<<<<<<
313 * samfile_t * samfile
324 } __pyx_t_9csamtools___iterdata;
326 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1655
327 * bam_plp_set_mask( self.pileup_iter, self.mask )
329 * cdef setupIteratorData( self, # <<<<<<<<<<<<<<
334 struct __pyx_opt_args_9csamtools_14IteratorColumn_setupIteratorData {
339 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3192
340 * bam_maqindel_ret_destroy(self._r)
342 * cdef class IndelCallerBase: # <<<<<<<<<<<<<<
343 * '''Base class for SNP callers.
347 struct __pyx_obj_9csamtools_IndelCallerBase {
349 bam_maqindel_opt_t *options;
350 struct __pyx_obj_9csamtools_IteratorColumn *iter;
355 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3330
356 * return self._call()
358 * cdef class IteratorIndelCalls( IndelCallerBase ): # <<<<<<<<<<<<<<
359 * """*(IteratorColumn iterator)*
363 struct __pyx_obj_9csamtools_IteratorIndelCalls {
364 struct __pyx_obj_9csamtools_IndelCallerBase __pyx_base;
367 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":244
369 * ######################################################################
370 * cdef class Fastafile: # <<<<<<<<<<<<<<
375 struct __pyx_obj_9csamtools_Fastafile {
377 struct __pyx_vtabstruct_9csamtools_Fastafile *__pyx_vtab;
382 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3103
385 * cdef class IndelCall: # <<<<<<<<<<<<<<
386 * '''the results of an indel call.'''
390 struct __pyx_obj_9csamtools_IndelCall {
395 int _rms_mapping_quality;
396 bam_maqindel_ret_t *_r;
399 /* "pysam/csamtools.pxd":388
400 * cdef bam1_t * _delegate
402 * cdef class Samfile: # <<<<<<<<<<<<<<
403 * cdef char * _filename
404 * # pointer to samfile
407 struct __pyx_obj_9csamtools_Samfile {
409 struct __pyx_vtabstruct_9csamtools_Samfile *__pyx_vtab;
419 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3287
422 * cdef class IndelCaller( IndelCallerBase ): # <<<<<<<<<<<<<<
423 * '''*(IteratorColumn iterator_column )*
427 struct __pyx_obj_9csamtools_IndelCaller {
428 struct __pyx_obj_9csamtools_IndelCallerBase __pyx_base;
431 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":91
434 * cdef class PileupRead # <<<<<<<<<<<<<<
435 * cdef makePileupRead( bam_pileup1_t * src ):
436 * '''fill a PileupRead object from a bam_pileup1_t * object.'''
439 struct __pyx_obj_9csamtools_PileupRead {
441 struct __pyx_obj_9csamtools_AlignedRead *_alignment;
450 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2816
451 * return retval, out_stderr, out_stdout
453 * cdef class SNPCall: # <<<<<<<<<<<<<<
454 * '''the results of a SNP call.'''
458 struct __pyx_obj_9csamtools_SNPCall {
462 char _reference_base;
464 int _consensus_quality;
466 int _rms_mapping_quality;
470 /* "pysam/csamtools.pxd":383
472 * # need to declare all C fields and methods here
473 * cdef class AlignedRead: # <<<<<<<<<<<<<<
475 * # object that this AlignedRead represents
478 struct __pyx_obj_9csamtools_AlignedRead {
483 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1542
486 * cdef class IteratorColumn: # <<<<<<<<<<<<<<
487 * '''abstract base class for iterators over columns.
491 struct __pyx_obj_9csamtools_IteratorColumn {
493 struct __pyx_vtabstruct_9csamtools_IteratorColumn *__pyx_vtab;
494 struct __pyx_obj_9csamtools_IteratorRowRegion *iter;
499 const bam_pileup1_t * plp;
500 bam_plp_t pileup_iter;
501 __pyx_t_9csamtools___iterdata iterdata;
502 struct __pyx_obj_9csamtools_Samfile *samfile;
503 struct __pyx_obj_9csamtools_Fastafile *fastafile;
507 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1712
508 * self.iterdata.seq = NULL
510 * cdef class IteratorColumnRegion(IteratorColumn): # <<<<<<<<<<<<<<
511 * '''iterates over a region only.
515 struct __pyx_obj_9csamtools_IteratorColumnRegion {
516 struct __pyx_obj_9csamtools_IteratorColumn __pyx_base;
519 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1187
520 * ##-------------------------------------------------------------------
521 * ##-------------------------------------------------------------------
522 * cdef class IteratorRow: # <<<<<<<<<<<<<<
523 * '''abstract base class for iterators over mapped reads.
527 struct __pyx_obj_9csamtools_IteratorRow {
531 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1356
532 * if self.owns_samfile: samclose( self.fp )
534 * cdef class IteratorRowAllRefs(IteratorRow): # <<<<<<<<<<<<<<
535 * """iterates over all mapped reads by chaining iterators over each reference
539 struct __pyx_obj_9csamtools_IteratorRowAllRefs {
540 struct __pyx_obj_9csamtools_IteratorRow __pyx_base;
541 struct __pyx_obj_9csamtools_Samfile *samfile;
543 struct __pyx_obj_9csamtools_IteratorRowRegion *rowiter;
546 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1206
549 * cdef class IteratorRowRegion(IteratorRow): # <<<<<<<<<<<<<<
550 * """*(Samfile samfile, int tid, int beg, int end, int reopen = True )*
554 struct __pyx_obj_9csamtools_IteratorRowRegion {
555 struct __pyx_obj_9csamtools_IteratorRow __pyx_base;
556 struct __pyx_vtabstruct_9csamtools_IteratorRowRegion *__pyx_vtab;
560 struct __pyx_obj_9csamtools_Samfile *samfile;
565 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1741
568 * cdef class IteratorColumnAllRefs(IteratorColumn): # <<<<<<<<<<<<<<
569 * """iterates over all columns by chaining iterators over each reference
573 struct __pyx_obj_9csamtools_IteratorColumnAllRefs {
574 struct __pyx_obj_9csamtools_IteratorColumn __pyx_base;
577 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1402
578 * raise StopIteration
580 * cdef class IteratorRowSelection(IteratorRow): # <<<<<<<<<<<<<<
581 * """*(Samfile samfile)*
585 struct __pyx_obj_9csamtools_IteratorRowSelection {
586 struct __pyx_obj_9csamtools_IteratorRow __pyx_base;
587 struct __pyx_vtabstruct_9csamtools_IteratorRowSelection *__pyx_vtab;
595 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2873
598 * cdef class SNPCallerBase: # <<<<<<<<<<<<<<
599 * '''Base class for SNP callers.
603 struct __pyx_obj_9csamtools_SNPCallerBase {
605 struct __pyx_vtabstruct_9csamtools_SNPCallerBase *__pyx_vtab;
607 struct __pyx_obj_9csamtools_IteratorColumn *iter;
610 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3021
613 * cdef class SNPCaller( SNPCallerBase ): # <<<<<<<<<<<<<<
614 * '''*(IteratorColumn iterator_column )*
618 struct __pyx_obj_9csamtools_SNPCaller {
619 struct __pyx_obj_9csamtools_SNPCallerBase __pyx_base;
622 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2946
625 * cdef class IteratorSNPCalls( SNPCallerBase ): # <<<<<<<<<<<<<<
626 * """*(IteratorColumn iterator)*
630 struct __pyx_obj_9csamtools_IteratorSNPCalls {
631 struct __pyx_obj_9csamtools_SNPCallerBase __pyx_base;
634 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1292
635 * if self.owns_samfile: samclose( self.fp )
637 * cdef class IteratorRowAll(IteratorRow): # <<<<<<<<<<<<<<
638 * """*(Samfile samfile, int reopen = True)*
642 struct __pyx_obj_9csamtools_IteratorRowAll {
643 struct __pyx_obj_9csamtools_IteratorRow __pyx_base;
644 struct __pyx_vtabstruct_9csamtools_IteratorRowAll *__pyx_vtab;
650 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3370
653 * cdef class IndexedReads: # <<<<<<<<<<<<<<
654 * """index a bamfile by read.
658 struct __pyx_obj_9csamtools_IndexedReads {
660 struct __pyx_obj_9csamtools_Samfile *samfile;
666 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":82
669 * cdef class PileupProxy # <<<<<<<<<<<<<<
670 * cdef makePileupProxy( bam_pileup1_t * plp, int tid, int pos, int n ):
671 * cdef PileupProxy dest = PileupProxy.__new__(PileupProxy)
674 struct __pyx_obj_9csamtools_PileupProxy {
683 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1542
686 * cdef class IteratorColumn: # <<<<<<<<<<<<<<
687 * '''abstract base class for iterators over columns.
691 struct __pyx_vtabstruct_9csamtools_IteratorColumn {
692 int (*cnext)(struct __pyx_obj_9csamtools_IteratorColumn *);
693 char *(*getSequence)(struct __pyx_obj_9csamtools_IteratorColumn *);
694 PyObject *(*setMask)(struct __pyx_obj_9csamtools_IteratorColumn *, PyObject *);
695 PyObject *(*setupIteratorData)(struct __pyx_obj_9csamtools_IteratorColumn *, int, int, int, struct __pyx_opt_args_9csamtools_14IteratorColumn_setupIteratorData *__pyx_optional_args);
696 PyObject *(*reset)(struct __pyx_obj_9csamtools_IteratorColumn *, PyObject *, PyObject *, PyObject *);
698 static struct __pyx_vtabstruct_9csamtools_IteratorColumn *__pyx_vtabptr_9csamtools_IteratorColumn;
701 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1712
702 * self.iterdata.seq = NULL
704 * cdef class IteratorColumnRegion(IteratorColumn): # <<<<<<<<<<<<<<
705 * '''iterates over a region only.
709 struct __pyx_vtabstruct_9csamtools_IteratorColumnRegion {
710 struct __pyx_vtabstruct_9csamtools_IteratorColumn __pyx_base;
712 static struct __pyx_vtabstruct_9csamtools_IteratorColumnRegion *__pyx_vtabptr_9csamtools_IteratorColumnRegion;
715 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2873
718 * cdef class SNPCallerBase: # <<<<<<<<<<<<<<
719 * '''Base class for SNP callers.
723 struct __pyx_vtabstruct_9csamtools_SNPCallerBase {
724 PyObject *(*__dump)(struct __pyx_obj_9csamtools_SNPCallerBase *, glf1_t *, uint32_t, int);
726 static struct __pyx_vtabstruct_9csamtools_SNPCallerBase *__pyx_vtabptr_9csamtools_SNPCallerBase;
729 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3021
732 * cdef class SNPCaller( SNPCallerBase ): # <<<<<<<<<<<<<<
733 * '''*(IteratorColumn iterator_column )*
737 struct __pyx_vtabstruct_9csamtools_SNPCaller {
738 struct __pyx_vtabstruct_9csamtools_SNPCallerBase __pyx_base;
740 static struct __pyx_vtabstruct_9csamtools_SNPCaller *__pyx_vtabptr_9csamtools_SNPCaller;
743 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1206
746 * cdef class IteratorRowRegion(IteratorRow): # <<<<<<<<<<<<<<
747 * """*(Samfile samfile, int tid, int beg, int end, int reopen = True )*
751 struct __pyx_vtabstruct_9csamtools_IteratorRowRegion {
752 bam1_t *(*getCurrent)(struct __pyx_obj_9csamtools_IteratorRowRegion *);
753 int (*cnext)(struct __pyx_obj_9csamtools_IteratorRowRegion *);
755 static struct __pyx_vtabstruct_9csamtools_IteratorRowRegion *__pyx_vtabptr_9csamtools_IteratorRowRegion;
758 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1402
759 * raise StopIteration
761 * cdef class IteratorRowSelection(IteratorRow): # <<<<<<<<<<<<<<
762 * """*(Samfile samfile)*
766 struct __pyx_vtabstruct_9csamtools_IteratorRowSelection {
767 bam1_t *(*getCurrent)(struct __pyx_obj_9csamtools_IteratorRowSelection *);
768 int (*cnext)(struct __pyx_obj_9csamtools_IteratorRowSelection *);
770 static struct __pyx_vtabstruct_9csamtools_IteratorRowSelection *__pyx_vtabptr_9csamtools_IteratorRowSelection;
773 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1741
776 * cdef class IteratorColumnAllRefs(IteratorColumn): # <<<<<<<<<<<<<<
777 * """iterates over all columns by chaining iterators over each reference
781 struct __pyx_vtabstruct_9csamtools_IteratorColumnAllRefs {
782 struct __pyx_vtabstruct_9csamtools_IteratorColumn __pyx_base;
784 static struct __pyx_vtabstruct_9csamtools_IteratorColumnAllRefs *__pyx_vtabptr_9csamtools_IteratorColumnAllRefs;
787 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":415
790 * cdef class Samfile: # <<<<<<<<<<<<<<
791 * '''*(filename, mode=None, template = None, referencenames = None, referencelengths = None, text = NULL, header = None)*
795 struct __pyx_vtabstruct_9csamtools_Samfile {
796 bam_header_t *(*_buildHeader)(struct __pyx_obj_9csamtools_Samfile *, PyObject *);
797 bam1_t *(*getCurrent)(struct __pyx_obj_9csamtools_Samfile *);
798 int (*cnext)(struct __pyx_obj_9csamtools_Samfile *);
799 int (*write)(struct __pyx_obj_9csamtools_Samfile *, struct __pyx_obj_9csamtools_AlignedRead *, int __pyx_skip_dispatch);
800 char *(*_getrname)(struct __pyx_obj_9csamtools_Samfile *, int);
802 static struct __pyx_vtabstruct_9csamtools_Samfile *__pyx_vtabptr_9csamtools_Samfile;
805 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":244
807 * ######################################################################
808 * cdef class Fastafile: # <<<<<<<<<<<<<<
813 struct __pyx_vtabstruct_9csamtools_Fastafile {
814 char *(*_fetch)(struct __pyx_obj_9csamtools_Fastafile *, char *, int, int, int *);
816 static struct __pyx_vtabstruct_9csamtools_Fastafile *__pyx_vtabptr_9csamtools_Fastafile;
819 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1292
820 * if self.owns_samfile: samclose( self.fp )
822 * cdef class IteratorRowAll(IteratorRow): # <<<<<<<<<<<<<<
823 * """*(Samfile samfile, int reopen = True)*
827 struct __pyx_vtabstruct_9csamtools_IteratorRowAll {
828 bam1_t *(*getCurrent)(struct __pyx_obj_9csamtools_IteratorRowAll *);
829 int (*cnext)(struct __pyx_obj_9csamtools_IteratorRowAll *);
831 static struct __pyx_vtabstruct_9csamtools_IteratorRowAll *__pyx_vtabptr_9csamtools_IteratorRowAll;
834 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2946
837 * cdef class IteratorSNPCalls( SNPCallerBase ): # <<<<<<<<<<<<<<
838 * """*(IteratorColumn iterator)*
842 struct __pyx_vtabstruct_9csamtools_IteratorSNPCalls {
843 struct __pyx_vtabstruct_9csamtools_SNPCallerBase __pyx_base;
845 static struct __pyx_vtabstruct_9csamtools_IteratorSNPCalls *__pyx_vtabptr_9csamtools_IteratorSNPCalls;
847 #ifndef CYTHON_REFNANNY
848 #define CYTHON_REFNANNY 0
853 void (*INCREF)(void*, PyObject*, int);
854 void (*DECREF)(void*, PyObject*, int);
855 void (*GOTREF)(void*, PyObject*, int);
856 void (*GIVEREF)(void*, PyObject*, int);
857 void* (*SetupContext)(const char*, int, const char*);
858 void (*FinishContext)(void**);
859 } __Pyx_RefNannyAPIStruct;
860 static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
861 static __Pyx_RefNannyAPIStruct * __Pyx_RefNannyImportAPI(const char *modname) {
862 PyObject *m = NULL, *p = NULL;
864 m = PyImport_ImportModule((char *)modname);
866 p = PyObject_GetAttrString(m, (char *)"RefNannyAPI");
868 r = PyLong_AsVoidPtr(p);
872 return (__Pyx_RefNannyAPIStruct *)r;
874 #define __Pyx_RefNannySetupContext(name) void *__pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
875 #define __Pyx_RefNannyFinishContext() __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
876 #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
877 #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
878 #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
879 #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
880 #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r);} } while(0)
882 #define __Pyx_RefNannySetupContext(name)
883 #define __Pyx_RefNannyFinishContext()
884 #define __Pyx_INCREF(r) Py_INCREF(r)
885 #define __Pyx_DECREF(r) Py_DECREF(r)
886 #define __Pyx_GOTREF(r)
887 #define __Pyx_GIVEREF(r)
888 #define __Pyx_XDECREF(r) Py_XDECREF(r)
889 #endif /* CYTHON_REFNANNY */
890 #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);} } while(0)
891 #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r);} } while(0)
893 static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/
895 #ifndef CYTHON_PROFILE
896 #define CYTHON_PROFILE 1
899 #ifndef CYTHON_PROFILE_REUSE_FRAME
900 #define CYTHON_PROFILE_REUSE_FRAME 0
906 #include "frameobject.h"
907 #include "traceback.h"
909 #if CYTHON_PROFILE_REUSE_FRAME
910 #define CYTHON_FRAME_MODIFIER static
911 #define CYTHON_FRAME_DEL
913 #define CYTHON_FRAME_MODIFIER
914 #define CYTHON_FRAME_DEL Py_DECREF(__pyx_frame)
917 #define __Pyx_TraceDeclarations \
918 static PyCodeObject *__pyx_frame_code = NULL; \
919 CYTHON_FRAME_MODIFIER PyFrameObject *__pyx_frame = NULL; \
920 int __Pyx_use_tracing = 0;
922 #define __Pyx_TraceCall(funcname, srcfile, firstlineno) \
923 if (unlikely(PyThreadState_GET()->use_tracing && PyThreadState_GET()->c_profilefunc)) { \
924 __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, funcname, srcfile, firstlineno); \
927 #define __Pyx_TraceException() \
928 if (unlikely(__Pyx_use_tracing( && PyThreadState_GET()->use_tracing && PyThreadState_GET()->c_profilefunc) { \
929 PyObject *exc_info = __Pyx_GetExceptionTuple(); \
931 PyThreadState_GET()->c_profilefunc( \
932 PyThreadState_GET()->c_profileobj, __pyx_frame, PyTrace_EXCEPTION, exc_info); \
933 Py_DECREF(exc_info); \
937 #define __Pyx_TraceReturn(result) \
938 if (unlikely(__Pyx_use_tracing) && PyThreadState_GET()->use_tracing && PyThreadState_GET()->c_profilefunc) { \
939 PyThreadState_GET()->c_profilefunc( \
940 PyThreadState_GET()->c_profileobj, __pyx_frame, PyTrace_RETURN, (PyObject*)result); \
944 static PyCodeObject *__Pyx_createFrameCodeObject(const char *funcname, const char *srcfile, int firstlineno); /*proto*/
945 static int __Pyx_TraceSetupAndCall(PyCodeObject** code, PyFrameObject** frame, const char *funcname, const char *srcfile, int firstlineno); /*proto*/
949 #define __Pyx_TraceDeclarations
950 #define __Pyx_TraceCall(funcname, srcfile, firstlineno)
951 #define __Pyx_TraceException()
952 #define __Pyx_TraceReturn(result)
954 #endif /* CYTHON_PROFILE */
956 static CYTHON_INLINE PyObject* __Pyx_tp_new(PyObject* type_obj) {
957 return (PyObject*) (((PyTypeObject*)(type_obj))->tp_new(
958 (PyTypeObject*)(type_obj), __pyx_empty_tuple, NULL));
961 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/
963 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
965 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
967 static PyObject *__Pyx_UnpackItem(PyObject *, Py_ssize_t index); /*proto*/
968 static int __Pyx_EndUnpack(PyObject *, Py_ssize_t expected); /*proto*/
970 static CYTHON_INLINE int __Pyx_CheckKeywordStrings(PyObject *kwdict,
971 const char* function_name, int kw_allowed); /*proto*/
973 static void __Pyx_RaiseDoubleKeywordsError(
974 const char* func_name, PyObject* kw_name); /*proto*/
976 static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
977 Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /*proto*/
979 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name); /*proto*/
981 static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
982 static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
984 static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
985 const char *name, int exact); /*proto*/
987 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
990 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
993 r = PyObject_GetItem(o, j);
999 #define __Pyx_GetItemInt_List(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \
1000 __Pyx_GetItemInt_List_Fast(o, i) : \
1001 __Pyx_GetItemInt_Generic(o, to_py_func(i)))
1003 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i) {
1004 if (likely(o != Py_None)) {
1005 if (likely((0 <= i) & (i < PyList_GET_SIZE(o)))) {
1006 PyObject *r = PyList_GET_ITEM(o, i);
1010 else if ((-PyList_GET_SIZE(o) <= i) & (i < 0)) {
1011 PyObject *r = PyList_GET_ITEM(o, PyList_GET_SIZE(o) + i);
1016 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
1019 #define __Pyx_GetItemInt_Tuple(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \
1020 __Pyx_GetItemInt_Tuple_Fast(o, i) : \
1021 __Pyx_GetItemInt_Generic(o, to_py_func(i)))
1023 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i) {
1024 if (likely(o != Py_None)) {
1025 if (likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
1026 PyObject *r = PyTuple_GET_ITEM(o, i);
1030 else if ((-PyTuple_GET_SIZE(o) <= i) & (i < 0)) {
1031 PyObject *r = PyTuple_GET_ITEM(o, PyTuple_GET_SIZE(o) + i);
1036 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
1040 #define __Pyx_GetItemInt(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \
1041 __Pyx_GetItemInt_Fast(o, i) : \
1042 __Pyx_GetItemInt_Generic(o, to_py_func(i)))
1044 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i) {
1046 if (PyList_CheckExact(o) && ((0 <= i) & (i < PyList_GET_SIZE(o)))) {
1047 r = PyList_GET_ITEM(o, i);
1050 else if (PyTuple_CheckExact(o) && ((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
1051 r = PyTuple_GET_ITEM(o, i);
1054 else if (Py_TYPE(o)->tp_as_sequence && Py_TYPE(o)->tp_as_sequence->sq_item && (likely(i >= 0))) {
1055 r = PySequence_GetItem(o, i);
1058 r = __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
1063 static CYTHON_INLINE long __Pyx_NegateNonNeg(long b) { return unlikely(b < 0) ? b : !b; }
1064 static CYTHON_INLINE PyObject* __Pyx_PyBoolOrNull_FromLong(long b) {
1065 return unlikely(b < 0) ? NULL : __Pyx_PyBool_FromLong(b);
1068 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);
1070 static CYTHON_INLINE PyObject* __Pyx_PyObject_Append(PyObject* L, PyObject* x) {
1071 if (likely(PyList_CheckExact(L))) {
1072 if (PyList_Append(L, x) < 0) return NULL;
1074 return Py_None; /* this is just to have an accurate signature */
1078 m = __Pyx_GetAttrString(L, "append");
1079 if (!m) return NULL;
1080 r = PyObject_CallFunctionObjArgs(m, x, NULL);
1086 static CYTHON_INLINE void __Pyx_RaiseNoneIndexingError(void);
1089 #if PY_MAJOR_VERSION >= 3
1090 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
1092 if (unlikely(d == Py_None)) {
1093 __Pyx_RaiseNoneIndexingError();
1096 value = PyDict_GetItemWithError(d, key);
1097 if (unlikely(!value)) {
1098 if (!PyErr_Occurred())
1099 PyErr_SetObject(PyExc_KeyError, key);
1106 #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
1109 static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value) {
1111 #if PY_MAJOR_VERSION >= 3
1112 value = PyDict_GetItemWithError(d, key);
1113 if (unlikely(!value)) {
1114 if (unlikely(PyErr_Occurred()))
1116 value = default_value;
1120 if (PyString_CheckExact(key) || PyUnicode_CheckExact(key) || PyInt_CheckExact(key)) {
1121 /* these presumably have safe hash functions */
1122 value = PyDict_GetItem(d, key);
1123 if (unlikely(!value)) {
1124 value = default_value;
1129 m = __Pyx_GetAttrString(d, "get");
1130 if (!m) return NULL;
1131 value = PyObject_CallFunctionObjArgs(m, key,
1132 (default_value == Py_None) ? NULL : default_value, NULL);
1139 static CYTHON_INLINE long __Pyx_div_long(long, long); /* proto */
1141 static CYTHON_INLINE long __Pyx_mod_long(long, long); /* proto */
1143 #define __Pyx_DelItemInt(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \
1144 __Pyx_DelItemInt_Fast(o, i) : \
1145 __Pyx_DelItem_Generic(o, to_py_func(i)))
1147 static CYTHON_INLINE int __Pyx_DelItem_Generic(PyObject *o, PyObject *j) {
1150 r = PyObject_DelItem(o, j);
1155 static CYTHON_INLINE int __Pyx_DelItemInt_Fast(PyObject *o, Py_ssize_t i) {
1156 if (Py_TYPE(o)->tp_as_sequence && Py_TYPE(o)->tp_as_sequence->sq_ass_item && likely(i >= 0))
1157 return PySequence_DelItem(o, i);
1159 PyObject *j = PyInt_FromSsize_t(i);
1160 return __Pyx_DelItem_Generic(o, j);
1164 static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
1165 static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
1167 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/
1169 static PyObject *__Pyx_CreateClass(PyObject *bases, PyObject *dict, PyObject *name, const char *modname); /*proto*/
1171 static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_uint32_t(uint32_t);
1173 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
1175 static CYTHON_INLINE uint32_t __Pyx_PyInt_from_py_uint32_t(PyObject *);
1177 static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_int32_t(int32_t);
1179 static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_int64_t(int64_t);
1181 static CYTHON_INLINE uint64_t __Pyx_PyInt_from_py_uint64_t(PyObject *);
1183 static CYTHON_INLINE int32_t __Pyx_PyInt_from_py_int32_t(PyObject *);
1185 static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_uint8_t(uint8_t);
1187 static int __Pyx_Print(PyObject*, PyObject *, int); /*proto*/
1188 #if PY_MAJOR_VERSION >= 3
1189 static PyObject* __pyx_print = 0;
1190 static PyObject* __pyx_print_kwargs = 0;
1193 static int __Pyx_PrintOne(PyObject* stream, PyObject *o); /*proto*/
1195 static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_uint64_t(uint64_t);
1197 static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *);
1199 static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject *);
1201 static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject *);
1203 static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject *);
1205 static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject *);
1207 static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject *);
1209 static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject *);
1211 static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject *);
1213 static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject *);
1215 static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject *);
1217 static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject *);
1219 static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject *);
1221 static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject *);
1223 static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject *);
1225 static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject *);
1227 static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject *);
1229 static void __Pyx_WriteUnraisable(const char *name); /*proto*/
1231 static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, long size, int strict); /*proto*/
1233 static PyObject *__Pyx_ImportModule(const char *name); /*proto*/
1235 static int __Pyx_SetVtable(PyObject *dict, void *vtable); /*proto*/
1237 static void __Pyx_AddTraceback(const char *funcname); /*proto*/
1239 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/
1240 /* Module declarations from __builtin__ */
1242 /* Module declarations from cpython.version */
1244 /* Module declarations from cpython.ref */
1246 /* Module declarations from cpython.exc */
1248 /* Module declarations from cpython.module */
1250 /* Module declarations from cpython.mem */
1252 /* Module declarations from cpython.tuple */
1254 /* Module declarations from cpython.list */
1256 /* Module declarations from libc.stdio */
1258 /* Module declarations from cpython.object */
1260 /* Module declarations from cpython.sequence */
1262 /* Module declarations from cpython.mapping */
1264 /* Module declarations from cpython.iterator */
1266 /* Module declarations from cpython.type */
1268 /* Module declarations from cpython.number */
1270 /* Module declarations from cpython.int */
1272 /* Module declarations from __builtin__ */
1274 /* Module declarations from cpython.bool */
1276 static PyTypeObject *__pyx_ptype_7cpython_4bool_bool = 0;
1277 /* Module declarations from cpython.long */
1279 /* Module declarations from cpython.float */
1281 /* Module declarations from cpython.complex */
1283 /* Module declarations from cpython.string */
1285 /* Module declarations from cpython.unicode */
1287 /* Module declarations from cpython.dict */
1289 /* Module declarations from cpython.instance */
1291 /* Module declarations from cpython.function */
1293 /* Module declarations from cpython.method */
1295 /* Module declarations from cpython.weakref */
1297 /* Module declarations from cpython.getargs */
1299 /* Module declarations from cpython.pythread */
1301 /* Module declarations from cpython.cobject */
1303 /* Module declarations from cpython.oldbuffer */
1305 /* Module declarations from cpython.set */
1307 /* Module declarations from cpython.buffer */
1309 /* Module declarations from cpython.bytes */
1311 /* Module declarations from cpython.pycapsule */
1313 /* Module declarations from cpython */
1315 /* Module declarations from csamtools */
1317 static PyTypeObject *__pyx_ptype_9csamtools_file = 0;
1318 static PyTypeObject *__pyx_ptype_9csamtools_AlignedRead = 0;
1319 static PyTypeObject *__pyx_ptype_9csamtools_Samfile = 0;
1320 static PyTypeObject *__pyx_ptype_9csamtools_PileupProxy = 0;
1321 static PyTypeObject *__pyx_ptype_9csamtools_PileupRead = 0;
1322 static PyTypeObject *__pyx_ptype_9csamtools_Fastafile = 0;
1323 static PyTypeObject *__pyx_ptype_9csamtools_IteratorRow = 0;
1324 static PyTypeObject *__pyx_ptype_9csamtools_IteratorRowRegion = 0;
1325 static PyTypeObject *__pyx_ptype_9csamtools_IteratorRowAll = 0;
1326 static PyTypeObject *__pyx_ptype_9csamtools_IteratorRowAllRefs = 0;
1327 static PyTypeObject *__pyx_ptype_9csamtools_IteratorRowSelection = 0;
1328 static PyTypeObject *__pyx_ptype_9csamtools_IteratorColumn = 0;
1329 static PyTypeObject *__pyx_ptype_9csamtools_IteratorColumnRegion = 0;
1330 static PyTypeObject *__pyx_ptype_9csamtools_IteratorColumnAllRefs = 0;
1331 static PyTypeObject *__pyx_ptype_9csamtools_SNPCall = 0;
1332 static PyTypeObject *__pyx_ptype_9csamtools_SNPCallerBase = 0;
1333 static PyTypeObject *__pyx_ptype_9csamtools_IteratorSNPCalls = 0;
1334 static PyTypeObject *__pyx_ptype_9csamtools_SNPCaller = 0;
1335 static PyTypeObject *__pyx_ptype_9csamtools_IndelCall = 0;
1336 static PyTypeObject *__pyx_ptype_9csamtools_IndelCallerBase = 0;
1337 static PyTypeObject *__pyx_ptype_9csamtools_IndelCaller = 0;
1338 static PyTypeObject *__pyx_ptype_9csamtools_IteratorIndelCalls = 0;
1339 static PyTypeObject *__pyx_ptype_9csamtools_IndexedReads = 0;
1340 static char *__pyx_v_9csamtools_bam_nt16_rev_table;
1341 static int __pyx_v_9csamtools_max_pos;
1342 static PyObject *__pyx_f_9csamtools_makeAlignedRead(bam1_t *); /*proto*/
1343 static PyObject *__pyx_f_9csamtools_makePileupProxy(bam_pileup1_t *, int, int, int); /*proto*/
1344 static PyObject *__pyx_f_9csamtools_makePileupRead(bam_pileup1_t *); /*proto*/
1345 static int __pyx_f_9csamtools_fetch_callback(bam1_t *, void *); /*proto*/
1346 static int __pyx_f_9csamtools_pileup_callback(uint32_t, uint32_t, int, bam_pileup1_t *, void *); /*proto*/
1347 static int __pyx_f_9csamtools_pileup_fetch_callback(bam1_t *, void *); /*proto*/
1348 static int __pyx_f_9csamtools_count_callback(bam1_t *, void *); /*proto*/
1349 static int __pyx_f_9csamtools_mate_callback(bam1_t *, void *); /*proto*/
1350 static int __pyx_f_9csamtools___advance_all(void *, bam1_t *); /*proto*/
1351 static int __pyx_f_9csamtools___advance_snpcalls(void *, bam1_t *); /*proto*/
1352 static CYTHON_INLINE int32_t __pyx_f_9csamtools_query_start(bam1_t *); /*proto*/
1353 static CYTHON_INLINE int32_t __pyx_f_9csamtools_query_end(bam1_t *); /*proto*/
1354 static CYTHON_INLINE PyObject *__pyx_f_9csamtools_get_seq_range(bam1_t *, uint32_t, uint32_t); /*proto*/
1355 static CYTHON_INLINE PyObject *__pyx_f_9csamtools_get_qual_range(bam1_t *, uint32_t, uint32_t); /*proto*/
1356 #define __Pyx_MODULE_NAME "csamtools"
1357 int __pyx_module_is_main_csamtools = 0;
1359 /* Implementation of csamtools */
1360 static PyObject *__pyx_builtin_open;
1361 static PyObject *__pyx_builtin_object;
1362 static PyObject *__pyx_builtin_map;
1363 static PyObject *__pyx_builtin_ValueError;
1364 static PyObject *__pyx_builtin_IOError;
1365 static PyObject *__pyx_builtin_OverflowError;
1366 static PyObject *__pyx_builtin_NotImplementedError;
1367 static PyObject *__pyx_builtin_KeyError;
1368 static PyObject *__pyx_builtin_StopIteration;
1369 static PyObject *__pyx_builtin_cmp;
1370 static PyObject *__pyx_builtin_chr;
1371 static PyObject *__pyx_builtin_TypeError;
1372 static PyObject *__pyx_builtin_range;
1373 static char __pyx_k_1[] = "\t";
1374 static char __pyx_k_2[] = "\n";
1375 static char __pyx_k_3[] = "calling len() on closed file";
1376 static char __pyx_k_4[] = "could not open file `%s`";
1377 static char __pyx_k_5[] = "I/O operation on closed file";
1378 static char __pyx_k_6[] = "no sequence/region supplied.";
1379 static char __pyx_k_7[] = "invalid region: start (%i) > end (%i)";
1380 static char __pyx_k_8[] = "";
1381 static char __pyx_k_9[] = "start out of range (%i)";
1382 static char __pyx_k_10[] = "end out of range (%i)";
1383 static char __pyx_k_11[] = "%s:%i-%i";
1384 static char __pyx_k_12[] = "invalid file opening mode `%s`";
1385 static char __pyx_k_13[] = "http:";
1386 static char __pyx_k_14[] = "ftp:";
1387 static char __pyx_k_15[] = "either supply options `template`, `header` or both `referencenames` and `referencelengths` for writing";
1388 static char __pyx_k_16[] = "unequal names and lengths of reference sequences";
1389 static char __pyx_k_17[] = "-";
1390 static char __pyx_k_18[] = "file `%s` not found";
1391 static char __pyx_k_19[] = "could not open file (mode='%s') - is it SAM/BAM format?";
1392 static char __pyx_k_20[] = "file does not have valid header (mode='%s') - is it SAM/BAM format?";
1393 static char __pyx_k_21[] = "file header is empty (mode='%s') - is it SAM/BAM format?";
1394 static char __pyx_k_22[] = ".bai";
1395 static char __pyx_k_23[] = "error while opening index `%s` ";
1396 static char __pyx_k_24[] = "tid %i out of range 0<=tid<%i";
1397 static char __pyx_k_25[] = "[:-]";
1398 static char __pyx_k_26[] = "invalid reference `%s`";
1399 static char __pyx_k_27[] = "invalid coordinates: start (%i) > end (%i)";
1400 static char __pyx_k_28[] = "seek only available in bam files";
1401 static char __pyx_k_30[] = "fetch called on bamfile without index";
1402 static char __pyx_k_31[] = "callback functionality requires a region/reference";
1403 static char __pyx_k_32[] = "no index available for fetch";
1404 static char __pyx_k_33[] = "fetch called for samfile without header";
1405 static char __pyx_k_34[] = "fetch for a region is not available for sam files";
1406 static char __pyx_k_35[] = "callback not implemented yet";
1407 static char __pyx_k_36[] = "read %s: is unpaired";
1408 static char __pyx_k_37[] = "mate %s: is unmapped";
1409 static char __pyx_k_38[] = "mate not found";
1410 static char __pyx_k_40[] = "counting functionality requires a region/reference";
1411 static char __pyx_k_41[] = "count for a region is not available for sam files";
1412 static char __pyx_k_42[] = "no index available for pileup";
1413 static char __pyx_k_43[] = "pileup of samfiles not implemented yet";
1414 static char __pyx_k_44[] = "@";
1415 static char __pyx_k_45[] = "header line without '@': '%s'";
1416 static char __pyx_k_46[] = "header line with invalid type '%s': '%s'";
1417 static char __pyx_k_47[] = ":";
1418 static char __pyx_k_48[] = "unknown field code '%s' in record '%s'";
1419 static char __pyx_k_49[] = "multiple '%s' lines are not permitted";
1420 static char __pyx_k_50[] = "@%s";
1421 static char __pyx_k_51[] = "%s:%s";
1422 static char __pyx_k_52[] = "invalid type for record %s: %s, expected %s";
1423 static char __pyx_k_53[] = "incomplete sequence information in '%s'";
1424 static char __pyx_k_54[] = "no index available for iteration";
1425 static char __pyx_k_55[] = "can only use this iterator on bam files";
1426 static char __pyx_k_56[] = "reference sequence for '%s' (tid=%i) not found";
1427 static char __pyx_k_57[] = "unknown stepper option `%s` in IteratorColumn";
1428 static char __pyx_k_59[] = "error during iteration";
1429 static char __pyx_k_60[] = "Invalid clipping in CIGAR string";
1430 static char __pyx_k_61[] = "quality and sequence mismatch: %i != %i";
1431 static char __pyx_k_62[] = "%c";
1432 static char __pyx_k_63[] = "create_string_buffer";
1433 static char __pyx_k_64[] = "<cccf";
1434 static char __pyx_k_65[] = "<cccb";
1435 static char __pyx_k_66[] = "<ccch";
1436 static char __pyx_k_67[] = "integer %i out of range of BAM/SAM specification";
1437 static char __pyx_k_68[] = "<ccci";
1438 static char __pyx_k_69[] = "<cccB";
1439 static char __pyx_k_70[] = "<cccH";
1440 static char __pyx_k_71[] = "<cccI";
1441 static char __pyx_k_72[] = "<cccc";
1442 static char __pyx_k_73[] = "<ccc%is";
1443 static char __pyx_k_74[] = "tags field too large";
1444 static char __pyx_k_75[] = "tag '%s' not present";
1445 static char __pyx_k_76[] = "Contig index";
1446 static char __pyx_k_77[] = "Mapped position on contig";
1447 static char __pyx_k_78[] = "Contig index for mate pair";
1448 static char __pyx_k_79[] = "Position of mate pair";
1449 static char __pyx_k_80[] = "Insert size";
1450 static char __pyx_k_81[] = "Binary flag";
1451 static char __pyx_k_82[] = "Count of cigar entries";
1452 static char __pyx_k_83[] = "Cigar entries";
1453 static char __pyx_k_84[] = "Mapping quality";
1454 static char __pyx_k_85[] = "Bam index bin number";
1455 static char __pyx_k_86[] = "Length of query name";
1456 static char __pyx_k_87[] = "Query name";
1457 static char __pyx_k_88[] = "Length of query sequence";
1458 static char __pyx_k_89[] = "Query sequence";
1459 static char __pyx_k_90[] = "Quality scores";
1460 static char __pyx_k_91[] = "Length of auxilary data";
1461 static char __pyx_k_92[] = "Maximum data length";
1462 static char __pyx_k_93[] = "Current data length";
1463 static char __pyx_k_94[] = "%-30s %-10s= %s";
1464 static char __pyx_k_95[] = "(";
1465 static char __pyx_k_96[] = ")";
1466 static char __pyx_k_97[] = "This class cannot be instantiated from Python";
1467 static char __pyx_k__A[] = "A";
1468 static char __pyx_k__C[] = "C";
1469 static char __pyx_k__D[] = "D";
1470 static char __pyx_k__F[] = "F";
1471 static char __pyx_k__I[] = "I";
1472 static char __pyx_k__S[] = "S";
1473 static char __pyx_k__Z[] = "Z";
1474 static char __pyx_k__b[] = "b";
1475 static char __pyx_k__c[] = "c";
1476 static char __pyx_k__d[] = "d";
1477 static char __pyx_k__f[] = "f";
1478 static char __pyx_k__i[] = "i";
1479 static char __pyx_k__n[] = "n";
1480 static char __pyx_k__r[] = "r";
1481 static char __pyx_k__s[] = "s";
1482 static char __pyx_k__w[] = "w";
1483 static char __pyx_k__x[] = "x";
1484 static char __pyx_k_100[] = "No such file or directory: '%s'";
1485 static char __pyx_k_101[] = "-o";
1486 static char __pyx_k_102[] = "option -o is forbidden in samtools view";
1487 static char __pyx_k_103[] = "_rms_mapping_quality";
1488 static char __pyx_k_104[] = "--> read %i %s %i";
1489 static char __pyx_k_105[] = "pos=%i, cns=%i, q_r = %f, depth=%i, n=%i, rb=%i, cns-cq=%i %i %i %i";
1490 static char __pyx_k_106[] = "-------------------------------------\n";
1491 static char __pyx_k_107[] = "IteratorSNPCalls requires an pileup iterator with reference sequence";
1492 static char __pyx_k_108[] = "position %i out of bounds on reference sequence (len=%i)";
1493 static char __pyx_k_109[] = "no reads in region - no call";
1494 static char __pyx_k_110[] = "%s/%s";
1495 static char __pyx_k_111[] = "IndelCallerBase requires an pileup iterator with reference sequence";
1496 static char __pyx_k_112[] = "can only IndexReads on bam files";
1497 static char __pyx_k_113[] = "read %s not found";
1498 static char __pyx_k_114[] = "the query name (None if not present)";
1499 static char __pyx_k_115[] = "the :term:`cigar` alignment (None if not present).\n ";
1500 static char __pyx_k_116[] = "read sequence bases, including :term:`soft clipped` bases (None if not present)";
1501 static char __pyx_k_117[] = "read sequence base qualities, including :term:`soft clipped` bases (None if not present)";
1502 static char __pyx_k_118[] = "aligned portion of the read and excludes any flanking bases that were :term:`soft clipped` (None if not present)\n\n SAM/BAM files may included extra flanking bases sequences that were\n not part of the alignment. These bases may be the result of the\n Smith-Waterman or other algorithms, which may not require alignments\n that begin at the first residue or end at the last. In addition,\n extra sequencing adapters, multiplex identifiers, and low-quality bases that\n were not considered for alignment may have been retained.";
1503 static char __pyx_k_119[] = "aligned query sequence quality values (None if not present)";
1504 static char __pyx_k_120[] = "start index of the aligned query portion of the sequence (0-based, inclusive)";
1505 static char __pyx_k_121[] = "end index of the aligned query portion of the sequence (0-based, exclusive)";
1506 static char __pyx_k_122[] = "Length of the aligned query sequence";
1507 static char __pyx_k_123[] = "the tags in the AUX field.\n\n This property permits convenience access to \n the tags. Changes it the returned list will\n not update the tags automatically. Instead,\n the following is required for adding a \n new tag::\n\n read.tags = read.tags + [(\"RG\",0)]\n\n ";
1508 static char __pyx_k_124[] = "properties flag";
1509 static char __pyx_k_125[] = "\n :term:`target` ID\n\n DEPRECATED from pysam-0.4 - use tid in the future.\n The rname field caused a lot of confusion as it returns\n the :term:`target` ID instead of the reference sequence\n name.\n\n .. note::\n\n This field contains the index of the reference sequence \n in the sequence dictionary. To obtain the name\n of the reference sequence, use :meth:`pysam.Samfile.getrname()`\n \n ";
1510 static char __pyx_k_126[] = "\n :term:`target` ID\n\n .. note::\n\n This field contains the index of the reference sequence \n in the sequence dictionary. To obtain the name\n of the reference sequence, use :meth:`pysam.Samfile.getrname()`\n \n ";
1511 static char __pyx_k_127[] = "0-based leftmost coordinate";
1512 static char __pyx_k_128[] = "properties bin";
1513 static char __pyx_k_129[] = "length of the read (read only). Returns 0 if not given.";
1514 static char __pyx_k_130[] = "aligned end position of the read (read only). Returns\n None if not available.";
1515 static char __pyx_k_131[] = "aligned length of the read (read only). Returns None if\n not available.";
1516 static char __pyx_k_132[] = "mapping quality";
1517 static char __pyx_k_133[] = "the :term:`reference` id of the mate ";
1518 static char __pyx_k_134[] = "the position of the mate";
1519 static char __pyx_k_135[] = "the insert size";
1520 static char __pyx_k_136[] = "true if read is paired in sequencing";
1521 static char __pyx_k_137[] = "true if read is mapped in a proper pair";
1522 static char __pyx_k_138[] = "true if read itself is unmapped";
1523 static char __pyx_k_139[] = "true if the mate is unmapped";
1524 static char __pyx_k_140[] = "true if read is mapped to reverse strand";
1525 static char __pyx_k_141[] = "true is read is mapped to reverse strand";
1526 static char __pyx_k_142[] = "true if this is read1";
1527 static char __pyx_k_143[] = "true if this is read2";
1528 static char __pyx_k_144[] = "true if not primary alignment";
1529 static char __pyx_k_145[] = "true if QC failure";
1530 static char __pyx_k_146[] = "true if optical or PCR duplicate";
1531 static char __pyx_k_147[] = "a list of reference positions that this read aligns to.";
1532 static char __pyx_k_148[] = "number of :term:`filename` associated with this object.";
1533 static char __pyx_k_149[] = "number of :term:`reference` sequences in the file.";
1534 static char __pyx_k_150[] = "tuple with the names of :term:`reference` sequences.";
1535 static char __pyx_k_151[] = "tuple of the lengths of the :term:`reference` sequences. The lengths are in the same order as \n :attr:`pysam.Samfile.references`\n ";
1536 static char __pyx_k_152[] = "full contents of the :term:`sam file` header as a string.";
1537 static char __pyx_k_153[] = "header information within the :term:`sam file`. The records and fields are returned as \n a two-level dictionary.\n ";
1538 static char __pyx_k_154[] = "the chromosome ID as is defined in the header";
1539 static char __pyx_k_155[] = "number of reads mapping to this column.";
1540 static char __pyx_k_156[] = "list of reads (:class:`pysam.PileupRead`) aligned to this column";
1541 static char __pyx_k_157[] = "a :class:`pysam.AlignedRead` object of the aligned read";
1542 static char __pyx_k_158[] = "position of the read base at the pileup site, 0-based";
1543 static char __pyx_k_159[] = "indel length; 0 for no indel, positive for ins and negative for del";
1544 static char __pyx_k_160[] = "1 iff the base on the padded read is a deletion";
1545 static char __pyx_k_161[] = "current sequence length.";
1546 static char __pyx_k_162[] = "nucleotide position of SNP.";
1547 static char __pyx_k_163[] = "reference base at pos. ``N`` if no reference sequence supplied.";
1548 static char __pyx_k_164[] = "the genotype called.";
1549 static char __pyx_k_165[] = "the genotype quality (Phred-scaled).";
1550 static char __pyx_k_166[] = "the snp quality (Phred scaled) - probability of consensus being identical to reference sequence.";
1551 static char __pyx_k_167[] = "the root mean square (rms) of the mapping quality of all reads involved in the call.";
1552 static char __pyx_k_168[] = "coverage or read depth - the number of reads involved in the call.";
1553 static char __pyx_k_169[] = "sequence of first allele.";
1554 static char __pyx_k_170[] = "sequence of second allele.";
1555 static char __pyx_k_171[] = "reads supporting first allele.";
1556 static char __pyx_k_172[] = "=ACMGRSVTWYHKDBN";
1557 static char __pyx_k_173[] = "A pileup column. A pileup column contains \n all the reads that map to a certain target base.\n\n tid \n chromosome ID as is defined in the header \n pos \n the target base coordinate (0-based) \n n \n number of reads mapping to this column \n pileups \n list of reads (:class:`pysam.PileupRead`) aligned to this column \n ";
1558 static char __pyx_k_174[] = "\n stderr is captured. \n ";
1559 static char __pyx_k_175[] = "does nothing. stderr can't be redirected on windows";
1560 static char __pyx_k_176[] = "http://mail.python.org/pipermail/python-list/2000-June/038406.html";
1561 static char __pyx_k_177[] = "Fastafile._isOpen (line 265)";
1562 static char __pyx_k_178[] = "Fastafile._open (line 275)";
1563 static char __pyx_k_179[] = "Fastafile.fetch (line 306)";
1564 static char __pyx_k_180[] = "Samfile._isOpen (line 464)";
1565 static char __pyx_k_181[] = "Samfile._hasIndex (line 468)";
1566 static char __pyx_k_182[] = "Samfile._open (line 472)";
1567 static char __pyx_k_183[] = "Samfile.gettid (line 612)";
1568 static char __pyx_k_184[] = "Samfile.getrname (line 621)";
1569 static char __pyx_k_185[] = "Samfile._parseRegion (line 637)";
1570 static char __pyx_k_186[] = "Samfile.seek (line 691)";
1571 static char __pyx_k_187[] = "Samfile.tell (line 702)";
1572 static char __pyx_k_188[] = "Samfile.fetch (line 713)";
1573 static char __pyx_k_189[] = "Samfile.mate (line 782)";
1574 static char __pyx_k_190[] = "Samfile.count (line 825)";
1575 static char __pyx_k_191[] = "Samfile.pileup (line 869)";
1576 static char __pyx_k_192[] = "Samfile.close (line 953)";
1577 static char __pyx_k_193[] = "Samfile.write (line 969)";
1578 static char __pyx_k_194[] = "Samfile._buildLine (line 1078)";
1579 static char __pyx_k_195[] = "Samfile.__next__ (line 1173)";
1580 static char __pyx_k_196[] = "IteratorRowRegion.__next__ (line 1281)";
1581 static char __pyx_k_197[] = "IteratorRowAll.__next__ (line 1340)";
1582 static char __pyx_k_198[] = "IteratorRowAllRefs.__next__ (line 1375)";
1583 static char __pyx_k_199[] = "IteratorRowSelection.__next__ (line 1459)";
1584 static char __pyx_k_200[] = "IteratorRowSelection";
1585 static char __pyx_k_201[] = "IteratorColumn.addReference (line 1634)";
1586 static char __pyx_k_202[] = "IteratorColumn.hasReference (line 1642)";
1587 static char __pyx_k_203[] = "IteratorColumnRegion.__next__ (line 1724)";
1588 static char __pyx_k_204[] = "IteratorColumnRegion";
1589 static char __pyx_k_205[] = "IteratorColumnAllRefs.__next__ (line 1755)";
1590 static char __pyx_k_206[] = "IteratorColumnAllRefs";
1591 static char __pyx_k_207[] = "AlignedRead.__str__ (line 1903)";
1592 static char __pyx_k_208[] = "AlignedRead.compare (line 1928)";
1593 static char __pyx_k_209[] = "AlignedRead.overlap (line 2512)";
1594 static char __pyx_k_210[] = "AlignedRead.opt (line 2541)";
1595 static char __pyx_k_211[] = "AlignedRead.fancy_str (line 2563)";
1596 static char __pyx_k_212[] = "Outs.setdevice (line 2705)";
1597 static char __pyx_k_213[] = "Outs.setfile (line 2710)";
1598 static char __pyx_k_214[] = "Outs.restore (line 2723)";
1599 static char __pyx_k_215[] = "_samtools_dispatch (line 2734)";
1600 static char __pyx_k_216[] = "IteratorSNPCalls.__next__ (line 2969)";
1601 static char __pyx_k_217[] = "SNPCaller.call (line 3041)";
1602 static char __pyx_k_218[] = "IndelCaller.call (line 3306)";
1603 static char __pyx_k_219[] = "IteratorIndelCalls.__next__ (line 3353)";
1604 static char __pyx_k_220[] = "IndexedReads.build (line 3406)";
1605 static char __pyx_k__AS[] = "AS";
1606 static char __pyx_k__CL[] = "CL";
1607 static char __pyx_k__CN[] = "CN";
1608 static char __pyx_k__CO[] = "CO";
1609 static char __pyx_k__DS[] = "DS";
1610 static char __pyx_k__DT[] = "DT";
1611 static char __pyx_k__GO[] = "GO";
1612 static char __pyx_k__HD[] = "HD";
1613 static char __pyx_k__ID[] = "ID";
1614 static char __pyx_k__LB[] = "LB";
1615 static char __pyx_k__LN[] = "LN";
1616 static char __pyx_k__M5[] = "M5";
1617 static char __pyx_k__PG[] = "PG";
1618 static char __pyx_k__PI[] = "PI";
1619 static char __pyx_k__PL[] = "PL";
1620 static char __pyx_k__PN[] = "PN";
1621 static char __pyx_k__PU[] = "PU";
1622 static char __pyx_k__RG[] = "RG";
1623 static char __pyx_k__SM[] = "SM";
1624 static char __pyx_k__SN[] = "SN";
1625 static char __pyx_k__SO[] = "SO";
1626 static char __pyx_k__SP[] = "SP";
1627 static char __pyx_k__SQ[] = "SQ";
1628 static char __pyx_k__UR[] = "UR";
1629 static char __pyx_k__VN[] = "VN";
1630 static char __pyx_k___r[] = "_r";
1631 static char __pyx_k__fd[] = "fd";
1632 static char __pyx_k__fp[] = "fp";
1633 static char __pyx_k__id[] = "id";
1634 static char __pyx_k__os[] = "os";
1635 static char __pyx_k__rb[] = "rb";
1636 static char __pyx_k__re[] = "re";
1637 static char __pyx_k__wb[] = "wb";
1638 static char __pyx_k__wh[] = "wh";
1639 static char __pyx_k__all[] = "all";
1640 static char __pyx_k__bam[] = "bam";
1641 static char __pyx_k__beg[] = "beg";
1642 static char __pyx_k__bin[] = "bin";
1643 static char __pyx_k__chr[] = "chr";
1644 static char __pyx_k__cmp[] = "cmp";
1645 static char __pyx_k__dup[] = "dup";
1646 static char __pyx_k__end[] = "end";
1647 static char __pyx_k__map[] = "map";
1648 static char __pyx_k__opt[] = "opt";
1649 static char __pyx_k__plp[] = "plp";
1650 static char __pyx_k__pos[] = "pos";
1651 static char __pyx_k__q_r[] = "q_r";
1652 static char __pyx_k__raw[] = "raw";
1653 static char __pyx_k__seq[] = "seq";
1654 static char __pyx_k__sys[] = "sys";
1655 static char __pyx_k__tid[] = "tid";
1656 static char __pyx_k__wbu[] = "wbu";
1657 static char __pyx_k__Outs[] = "Outs";
1658 static char __pyx_k___pos[] = "_pos";
1659 static char __pyx_k___tid[] = "_tid";
1660 static char __pyx_k__args[] = "args";
1661 static char __pyx_k__call[] = "call";
1662 static char __pyx_k__cnt1[] = "cnt1";
1663 static char __pyx_k__cnt2[] = "cnt2";
1664 static char __pyx_k__core[] = "core";
1665 static char __pyx_k__data[] = "data";
1666 static char __pyx_k__dup2[] = "dup2";
1667 static char __pyx_k__flag[] = "flag";
1668 static char __pyx_k__hash[] = "hash";
1669 static char __pyx_k__iter[] = "iter";
1670 static char __pyx_k__join[] = "join";
1671 static char __pyx_k__mapq[] = "mapq";
1672 static char __pyx_k__mask[] = "mask";
1673 static char __pyx_k__mate[] = "mate";
1674 static char __pyx_k__mode[] = "mode";
1675 static char __pyx_k__mpos[] = "mpos";
1676 static char __pyx_k__mrnm[] = "mrnm";
1677 static char __pyx_k__mtid[] = "mtid";
1678 static char __pyx_k__n_pu[] = "n_pu";
1679 static char __pyx_k__name[] = "name";
1680 static char __pyx_k__open[] = "open";
1681 static char __pyx_k__path[] = "path";
1682 static char __pyx_k__port[] = "port";
1683 static char __pyx_k__qpos[] = "qpos";
1684 static char __pyx_k__qseq[] = "qseq";
1685 static char __pyx_k__qual[] = "qual";
1686 static char __pyx_k__rlen[] = "rlen";
1687 static char __pyx_k__seek[] = "seek";
1688 static char __pyx_k__self[] = "self";
1689 static char __pyx_k__tags[] = "tags";
1690 static char __pyx_k__tell[] = "tell";
1691 static char __pyx_k__text[] = "text";
1692 static char __pyx_k__view[] = "view";
1693 static char __pyx_k___call[] = "_call";
1694 static char __pyx_k___open[] = "_open";
1695 static char __pyx_k___qpos[] = "_qpos";
1696 static char __pyx_k__bqual[] = "bqual";
1697 static char __pyx_k__build[] = "build";
1698 static char __pyx_k__cigar[] = "cigar";
1699 static char __pyx_k__close[] = "close";
1700 static char __pyx_k__cnext[] = "cnext";
1701 static char __pyx_k__count[] = "count";
1702 static char __pyx_k__fetch[] = "fetch";
1703 static char __pyx_k__flush[] = "flush";
1704 static char __pyx_k__indel[] = "indel";
1705 static char __pyx_k__index[] = "index";
1706 static char __pyx_k__isbam[] = "isbam";
1707 static char __pyx_k__isize[] = "isize";
1708 static char __pyx_k__l_aux[] = "l_aux";
1709 static char __pyx_k__level[] = "level";
1710 static char __pyx_k__n_hap[] = "n_hap";
1711 static char __pyx_k__n_plp[] = "n_plp";
1712 static char __pyx_k__q_cns[] = "q_cns";
1713 static char __pyx_k__q_ref[] = "q_ref";
1714 static char __pyx_k__qname[] = "qname";
1715 static char __pyx_k__range[] = "range";
1716 static char __pyx_k__reset[] = "reset";
1717 static char __pyx_k__rname[] = "rname";
1718 static char __pyx_k__setfd[] = "setfd";
1719 static char __pyx_k__split[] = "split";
1720 static char __pyx_k__start[] = "start";
1721 static char __pyx_k__strip[] = "strip";
1722 static char __pyx_k__theta[] = "theta";
1723 static char __pyx_k__types[] = "types";
1724 static char __pyx_k__where[] = "where";
1725 static char __pyx_k__write[] = "write";
1726 static char __pyx_k___indel[] = "_indel";
1727 static char __pyx_k___level[] = "_level";
1728 static char __pyx_k__ctypes[] = "ctypes";
1729 static char __pyx_k__errmod[] = "errmod";
1730 static char __pyx_k__exists[] = "exists";
1731 static char __pyx_k__fields[] = "fields";
1732 static char __pyx_k__fileno[] = "fileno";
1733 static char __pyx_k__gettid[] = "gettid";
1734 static char __pyx_k__header[] = "header";
1735 static char __pyx_k__indel1[] = "indel1";
1736 static char __pyx_k__indel2[] = "indel2";
1737 static char __pyx_k__is_del[] = "is_del";
1738 static char __pyx_k__l_qseq[] = "l_qseq";
1739 static char __pyx_k__l_text[] = "l_text";
1740 static char __pyx_k__m_data[] = "m_data";
1741 static char __pyx_k__method[] = "method";
1742 static char __pyx_k__object[] = "object";
1743 static char __pyx_k__offset[] = "offset";
1744 static char __pyx_k__pileup[] = "pileup";
1745 static char __pyx_k__record[] = "record";
1746 static char __pyx_k__region[] = "region";
1747 static char __pyx_k__remove[] = "remove";
1748 static char __pyx_k__reopen[] = "reopen";
1749 static char __pyx_k__retval[] = "retval";
1750 static char __pyx_k__rg2lib[] = "rg2lib";
1751 static char __pyx_k__stderr[] = "stderr";
1752 static char __pyx_k__stdout[] = "stdout";
1753 static char __pyx_k__struct[] = "struct";
1754 static char __pyx_k__system[] = "system";
1755 static char __pyx_k__IOError[] = "IOError";
1756 static char __pyx_k__IntType[] = "IntType";
1757 static char __pyx_k__O_CREAT[] = "O_CREAT";
1758 static char __pyx_k__Samfile[] = "Samfile";
1759 static char __pyx_k__Windows[] = "Windows";
1760 static char __pyx_k____all__[] = "__all__";
1761 static char __pyx_k____del__[] = "__del__";
1762 static char __pyx_k____str__[] = "__str__";
1763 static char __pyx_k___isOpen[] = "_isOpen";
1764 static char __pyx_k___is_del[] = "_is_del";
1765 static char __pyx_k__compare[] = "compare";
1766 static char __pyx_k__devnull[] = "devnull";
1767 static char __pyx_k__is_head[] = "is_head";
1768 static char __pyx_k__is_tail[] = "is_tail";
1769 static char __pyx_k__isupper[] = "isupper";
1770 static char __pyx_k__l_qname[] = "l_qname";
1771 static char __pyx_k__mkstemp[] = "mkstemp";
1772 static char __pyx_k__n_cigar[] = "n_cigar";
1773 static char __pyx_k__options[] = "options";
1774 static char __pyx_k__overlap[] = "overlap";
1775 static char __pyx_k__pileups[] = "pileups";
1776 static char __pyx_k__q_indel[] = "q_indel";
1777 static char __pyx_k__r_indel[] = "r_indel";
1778 static char __pyx_k__release[] = "release";
1779 static char __pyx_k__restore[] = "restore";
1780 static char __pyx_k__rowiter[] = "rowiter";
1781 static char __pyx_k__samfile[] = "samfile";
1782 static char __pyx_k__seq_len[] = "seq_len";
1783 static char __pyx_k__setfile[] = "setfile";
1784 static char __pyx_k__stepper[] = "stepper";
1785 static char __pyx_k__streams[] = "streams";
1786 static char __pyx_k__DictType[] = "DictType";
1787 static char __pyx_k__KeyError[] = "KeyError";
1788 static char __pyx_k__O_WRONLY[] = "O_WRONLY";
1789 static char __pyx_k____dict__[] = "__dict__";
1790 static char __pyx_k____init__[] = "__init__";
1791 static char __pyx_k____main__[] = "__main__";
1792 static char __pyx_k____next__[] = "__next__";
1793 static char __pyx_k____test__[] = "__test__";
1794 static char __pyx_k___is_head[] = "_is_head";
1795 static char __pyx_k___is_tail[] = "_is_tail";
1796 static char __pyx_k___logfile[] = "_logfile";
1797 static char __pyx_k__calcsize[] = "calcsize";
1798 static char __pyx_k__callback[] = "callback";
1799 static char __pyx_k__cap_mapQ[] = "cap_mapQ";
1800 static char __pyx_k__cnt_anti[] = "cnt_anti";
1801 static char __pyx_k__coverage[] = "coverage";
1802 static char __pyx_k__data_len[] = "data_len";
1803 static char __pyx_k__exc_type[] = "exc_type";
1804 static char __pyx_k__filename[] = "filename";
1805 static char __pyx_k__genotype[] = "genotype";
1806 static char __pyx_k__getrname[] = "getrname";
1807 static char __pyx_k__het_rate[] = "het_rate";
1808 static char __pyx_k__isremote[] = "isremote";
1809 static char __pyx_k__iterdata[] = "iterdata";
1810 static char __pyx_k__nextiter[] = "nextiter";
1811 static char __pyx_k__platform[] = "platform";
1812 static char __pyx_k__samtools[] = "samtools";
1813 static char __pyx_k__stderr_f[] = "stderr_f";
1814 static char __pyx_k__stderr_h[] = "stderr_h";
1815 static char __pyx_k__tempfile[] = "tempfile";
1816 static char __pyx_k__template[] = "template";
1817 static char __pyx_k__Fastafile[] = "Fastafile";
1818 static char __pyx_k__FloatType[] = "FloatType";
1819 static char __pyx_k__SNPCaller[] = "SNPCaller";
1820 static char __pyx_k__TypeError[] = "TypeError";
1821 static char __pyx_k___coverage[] = "_coverage";
1822 static char __pyx_k___delegate[] = "_delegate";
1823 static char __pyx_k___filename[] = "_filename";
1824 static char __pyx_k___genotype[] = "_genotype";
1825 static char __pyx_k___hasIndex[] = "_hasIndex";
1826 static char __pyx_k__alignment[] = "alignment";
1827 static char __pyx_k__exc_value[] = "exc_value";
1828 static char __pyx_k__fancy_str[] = "fancy_str";
1829 static char __pyx_k__fastafile[] = "fastafile";
1830 static char __pyx_k__itertools[] = "itertools";
1831 static char __pyx_k__max_depth[] = "max_depth";
1832 static char __pyx_k__min_baseQ[] = "min_baseQ";
1833 static char __pyx_k__n_targets[] = "n_targets";
1834 static char __pyx_k__pack_into[] = "pack_into";
1835 static char __pyx_k__positions[] = "positions";
1836 static char __pyx_k__readlines[] = "readlines";
1837 static char __pyx_k__reference[] = "reference";
1838 static char __pyx_k__setdevice[] = "setdevice";
1839 static char __pyx_k__traceback[] = "traceback";
1840 static char __pyx_k__until_eof[] = "until_eof";
1841 static char __pyx_k__PileupRead[] = "PileupRead";
1842 static char __pyx_k__ValueError[] = "ValueError";
1843 static char __pyx_k___alignment[] = "_alignment";
1844 static char __pyx_k___buildLine[] = "_buildLine";
1845 static char __pyx_k__reads_diff[] = "reads_diff";
1846 static char __pyx_k__startswith[] = "startswith";
1847 static char __pyx_k__target_len[] = "target_len";
1848 static char __pyx_k__AlignedRead[] = "AlignedRead";
1849 static char __pyx_k__IndelCaller[] = "IndelCaller";
1850 static char __pyx_k__IteratorRow[] = "IteratorRow";
1851 static char __pyx_k__PileupProxy[] = "PileupProxy";
1852 static char __pyx_k__StderrStore[] = "StderrStore";
1853 static char __pyx_k__collections[] = "collections";
1854 static char __pyx_k__current_pos[] = "current_pos";
1855 static char __pyx_k__defaultdict[] = "defaultdict";
1856 static char __pyx_k__getSequence[] = "getSequence";
1857 static char __pyx_k__nreferences[] = "nreferences";
1858 static char __pyx_k__pileup_iter[] = "pileup_iter";
1859 static char __pyx_k__reads_first[] = "reads_first";
1860 static char __pyx_k__snp_quality[] = "snp_quality";
1861 static char __pyx_k__stderr_save[] = "stderr_save";
1862 static char __pyx_k__target_name[] = "target_name";
1863 static char __pyx_k__IndexedReads[] = "IndexedReads";
1864 static char __pyx_k__PileupColumn[] = "PileupColumn";
1865 static char __pyx_k___buildHeader[] = "_buildHeader";
1866 static char __pyx_k___parseRegion[] = "_parseRegion";
1867 static char __pyx_k___snp_quality[] = "_snp_quality";
1868 static char __pyx_k__addReference[] = "addReference";
1869 static char __pyx_k__catch_stderr[] = "catch_stderr";
1870 static char __pyx_k__catch_stdout[] = "catch_stdout";
1871 static char __pyx_k__first_allele[] = "first_allele";
1872 static char __pyx_k__hasReference[] = "hasReference";
1873 static char __pyx_k__n_haplotypes[] = "n_haplotypes";
1874 static char __pyx_k__owns_samfile[] = "owns_samfile";
1875 static char __pyx_k__reads_second[] = "reads_second";
1876 static char __pyx_k__OverflowError[] = "OverflowError";
1877 static char __pyx_k__StopIteration[] = "StopIteration";
1878 static char __pyx_k__VALID_HEADERS[] = "VALID_HEADERS";
1879 static char __pyx_k__second_allele[] = "second_allele";
1880 static char __pyx_k__IteratorColumn[] = "IteratorColumn";
1881 static char __pyx_k__IteratorRowAll[] = "IteratorRowAll";
1882 static char __pyx_k__readAndRelease[] = "readAndRelease";
1883 static char __pyx_k__reference_base[] = "reference_base";
1884 static char __pyx_k__referencenames[] = "referencenames";
1885 static char __pyx_k___reference_base[] = "_reference_base";
1886 static char __pyx_k__iterator_column[] = "iterator_column";
1887 static char __pyx_k__mapping_quality[] = "mapping_quality";
1888 static char __pyx_k__IteratorSNPCalls[] = "IteratorSNPCalls";
1889 static char __pyx_k____getattribute__[] = "__getattribute__";
1890 static char __pyx_k__referencelengths[] = "referencelengths";
1891 static char __pyx_k__IteratorRowRegion[] = "IteratorRowRegion";
1892 static char __pyx_k__consensus_quality[] = "consensus_quality";
1893 static char __pyx_k__setupIteratorData[] = "setupIteratorData";
1894 static char __pyx_k__IteratorIndelCalls[] = "IteratorIndelCalls";
1895 static char __pyx_k__IteratorRowAllRefs[] = "IteratorRowAllRefs";
1896 static char __pyx_k__StderrStoreWindows[] = "StderrStoreWindows";
1897 static char __pyx_k__VALID_HEADER_ORDER[] = "VALID_HEADER_ORDER";
1898 static char __pyx_k__VALID_HEADER_TYPES[] = "VALID_HEADER_TYPES";
1899 static char __pyx_k___consensus_quality[] = "_consensus_quality";
1900 static char __pyx_k___samtools_dispatch[] = "_samtools_dispatch";
1901 static char __pyx_k__NotImplementedError[] = "NotImplementedError";
1902 static char __pyx_k__VALID_HEADER_FIELDS[] = "VALID_HEADER_FIELDS";
1903 static PyObject *__pyx_kp_s_1;
1904 static PyObject *__pyx_kp_s_10;
1905 static PyObject *__pyx_kp_s_100;
1906 static PyObject *__pyx_kp_s_101;
1907 static PyObject *__pyx_kp_s_102;
1908 static PyObject *__pyx_n_s_103;
1909 static PyObject *__pyx_kp_s_104;
1910 static PyObject *__pyx_kp_s_105;
1911 static PyObject *__pyx_kp_s_107;
1912 static PyObject *__pyx_kp_s_108;
1913 static PyObject *__pyx_kp_s_109;
1914 static PyObject *__pyx_kp_s_11;
1915 static PyObject *__pyx_kp_s_110;
1916 static PyObject *__pyx_kp_s_111;
1917 static PyObject *__pyx_kp_s_112;
1918 static PyObject *__pyx_kp_s_113;
1919 static PyObject *__pyx_kp_s_12;
1920 static PyObject *__pyx_kp_s_15;
1921 static PyObject *__pyx_kp_s_16;
1922 static PyObject *__pyx_kp_s_173;
1923 static PyObject *__pyx_kp_s_174;
1924 static PyObject *__pyx_kp_s_175;
1925 static PyObject *__pyx_kp_s_176;
1926 static PyObject *__pyx_kp_u_177;
1927 static PyObject *__pyx_kp_u_178;
1928 static PyObject *__pyx_kp_u_179;
1929 static PyObject *__pyx_kp_s_18;
1930 static PyObject *__pyx_kp_u_180;
1931 static PyObject *__pyx_kp_u_181;
1932 static PyObject *__pyx_kp_u_182;
1933 static PyObject *__pyx_kp_u_183;
1934 static PyObject *__pyx_kp_u_184;
1935 static PyObject *__pyx_kp_u_185;
1936 static PyObject *__pyx_kp_u_186;
1937 static PyObject *__pyx_kp_u_187;
1938 static PyObject *__pyx_kp_u_188;
1939 static PyObject *__pyx_kp_u_189;
1940 static PyObject *__pyx_kp_s_19;
1941 static PyObject *__pyx_kp_u_190;
1942 static PyObject *__pyx_kp_u_191;
1943 static PyObject *__pyx_kp_u_192;
1944 static PyObject *__pyx_kp_u_193;
1945 static PyObject *__pyx_kp_u_194;
1946 static PyObject *__pyx_kp_u_195;
1947 static PyObject *__pyx_kp_u_196;
1948 static PyObject *__pyx_kp_u_197;
1949 static PyObject *__pyx_kp_u_198;
1950 static PyObject *__pyx_kp_u_199;
1951 static PyObject *__pyx_kp_s_2;
1952 static PyObject *__pyx_kp_s_20;
1953 static PyObject *__pyx_n_s_200;
1954 static PyObject *__pyx_kp_u_201;
1955 static PyObject *__pyx_kp_u_202;
1956 static PyObject *__pyx_kp_u_203;
1957 static PyObject *__pyx_n_s_204;
1958 static PyObject *__pyx_kp_u_205;
1959 static PyObject *__pyx_n_s_206;
1960 static PyObject *__pyx_kp_u_207;
1961 static PyObject *__pyx_kp_u_208;
1962 static PyObject *__pyx_kp_u_209;
1963 static PyObject *__pyx_kp_s_21;
1964 static PyObject *__pyx_kp_u_210;
1965 static PyObject *__pyx_kp_u_211;
1966 static PyObject *__pyx_kp_u_212;
1967 static PyObject *__pyx_kp_u_213;
1968 static PyObject *__pyx_kp_u_214;
1969 static PyObject *__pyx_kp_u_215;
1970 static PyObject *__pyx_kp_u_216;
1971 static PyObject *__pyx_kp_u_217;
1972 static PyObject *__pyx_kp_u_218;
1973 static PyObject *__pyx_kp_u_219;
1974 static PyObject *__pyx_kp_s_22;
1975 static PyObject *__pyx_kp_u_220;
1976 static PyObject *__pyx_kp_s_23;
1977 static PyObject *__pyx_kp_s_24;
1978 static PyObject *__pyx_kp_s_25;
1979 static PyObject *__pyx_kp_s_26;
1980 static PyObject *__pyx_kp_s_27;
1981 static PyObject *__pyx_kp_s_28;
1982 static PyObject *__pyx_kp_s_3;
1983 static PyObject *__pyx_kp_s_30;
1984 static PyObject *__pyx_kp_s_31;
1985 static PyObject *__pyx_kp_s_32;
1986 static PyObject *__pyx_kp_s_33;
1987 static PyObject *__pyx_kp_s_34;
1988 static PyObject *__pyx_kp_s_35;
1989 static PyObject *__pyx_kp_s_36;
1990 static PyObject *__pyx_kp_s_37;
1991 static PyObject *__pyx_kp_s_38;
1992 static PyObject *__pyx_kp_s_4;
1993 static PyObject *__pyx_kp_s_40;
1994 static PyObject *__pyx_kp_s_41;
1995 static PyObject *__pyx_kp_s_42;
1996 static PyObject *__pyx_kp_s_43;
1997 static PyObject *__pyx_kp_s_44;
1998 static PyObject *__pyx_kp_s_45;
1999 static PyObject *__pyx_kp_s_46;
2000 static PyObject *__pyx_kp_s_47;
2001 static PyObject *__pyx_kp_s_48;
2002 static PyObject *__pyx_kp_s_49;
2003 static PyObject *__pyx_kp_s_5;
2004 static PyObject *__pyx_kp_s_50;
2005 static PyObject *__pyx_kp_s_51;
2006 static PyObject *__pyx_kp_s_52;
2007 static PyObject *__pyx_kp_s_53;
2008 static PyObject *__pyx_kp_s_54;
2009 static PyObject *__pyx_kp_s_55;
2010 static PyObject *__pyx_kp_s_56;
2011 static PyObject *__pyx_kp_s_57;
2012 static PyObject *__pyx_kp_s_59;
2013 static PyObject *__pyx_kp_s_6;
2014 static PyObject *__pyx_kp_s_61;
2015 static PyObject *__pyx_kp_s_62;
2016 static PyObject *__pyx_n_s_63;
2017 static PyObject *__pyx_kp_s_64;
2018 static PyObject *__pyx_kp_s_65;
2019 static PyObject *__pyx_kp_s_66;
2020 static PyObject *__pyx_kp_s_67;
2021 static PyObject *__pyx_kp_s_68;
2022 static PyObject *__pyx_kp_s_69;
2023 static PyObject *__pyx_kp_s_7;
2024 static PyObject *__pyx_kp_s_70;
2025 static PyObject *__pyx_kp_s_71;
2026 static PyObject *__pyx_kp_s_72;
2027 static PyObject *__pyx_kp_s_73;
2028 static PyObject *__pyx_kp_s_74;
2029 static PyObject *__pyx_kp_s_75;
2030 static PyObject *__pyx_kp_s_76;
2031 static PyObject *__pyx_kp_s_77;
2032 static PyObject *__pyx_kp_s_78;
2033 static PyObject *__pyx_kp_s_79;
2034 static PyObject *__pyx_kp_s_8;
2035 static PyObject *__pyx_kp_s_80;
2036 static PyObject *__pyx_kp_s_81;
2037 static PyObject *__pyx_kp_s_82;
2038 static PyObject *__pyx_kp_s_83;
2039 static PyObject *__pyx_kp_s_84;
2040 static PyObject *__pyx_kp_s_85;
2041 static PyObject *__pyx_kp_s_86;
2042 static PyObject *__pyx_kp_s_87;
2043 static PyObject *__pyx_kp_s_88;
2044 static PyObject *__pyx_kp_s_89;
2045 static PyObject *__pyx_kp_s_9;
2046 static PyObject *__pyx_kp_s_90;
2047 static PyObject *__pyx_kp_s_91;
2048 static PyObject *__pyx_kp_s_92;
2049 static PyObject *__pyx_kp_s_93;
2050 static PyObject *__pyx_kp_s_94;
2051 static PyObject *__pyx_kp_s_95;
2052 static PyObject *__pyx_kp_s_96;
2053 static PyObject *__pyx_kp_s_97;
2054 static PyObject *__pyx_n_s__A;
2055 static PyObject *__pyx_n_s__AS;
2056 static PyObject *__pyx_n_s__AlignedRead;
2057 static PyObject *__pyx_n_s__C;
2058 static PyObject *__pyx_n_s__CL;
2059 static PyObject *__pyx_n_s__CN;
2060 static PyObject *__pyx_n_s__CO;
2061 static PyObject *__pyx_n_s__D;
2062 static PyObject *__pyx_n_s__DS;
2063 static PyObject *__pyx_n_s__DT;
2064 static PyObject *__pyx_n_s__DictType;
2065 static PyObject *__pyx_n_s__F;
2066 static PyObject *__pyx_n_s__Fastafile;
2067 static PyObject *__pyx_n_s__FloatType;
2068 static PyObject *__pyx_n_s__GO;
2069 static PyObject *__pyx_n_s__HD;
2070 static PyObject *__pyx_n_s__I;
2071 static PyObject *__pyx_n_s__ID;
2072 static PyObject *__pyx_n_s__IOError;
2073 static PyObject *__pyx_n_s__IndelCaller;
2074 static PyObject *__pyx_n_s__IndexedReads;
2075 static PyObject *__pyx_n_s__IntType;
2076 static PyObject *__pyx_n_s__IteratorColumn;
2077 static PyObject *__pyx_n_s__IteratorIndelCalls;
2078 static PyObject *__pyx_n_s__IteratorRow;
2079 static PyObject *__pyx_n_s__IteratorRowAll;
2080 static PyObject *__pyx_n_s__IteratorRowAllRefs;
2081 static PyObject *__pyx_n_s__IteratorRowRegion;
2082 static PyObject *__pyx_n_s__IteratorSNPCalls;
2083 static PyObject *__pyx_n_s__KeyError;
2084 static PyObject *__pyx_n_s__LB;
2085 static PyObject *__pyx_n_s__LN;
2086 static PyObject *__pyx_n_s__M5;
2087 static PyObject *__pyx_n_s__NotImplementedError;
2088 static PyObject *__pyx_n_s__O_CREAT;
2089 static PyObject *__pyx_n_s__O_WRONLY;
2090 static PyObject *__pyx_n_s__Outs;
2091 static PyObject *__pyx_n_s__OverflowError;
2092 static PyObject *__pyx_n_s__PG;
2093 static PyObject *__pyx_n_s__PI;
2094 static PyObject *__pyx_n_s__PL;
2095 static PyObject *__pyx_n_s__PN;
2096 static PyObject *__pyx_n_s__PU;
2097 static PyObject *__pyx_n_s__PileupColumn;
2098 static PyObject *__pyx_n_s__PileupProxy;
2099 static PyObject *__pyx_n_s__PileupRead;
2100 static PyObject *__pyx_n_s__RG;
2101 static PyObject *__pyx_n_s__S;
2102 static PyObject *__pyx_n_s__SM;
2103 static PyObject *__pyx_n_s__SN;
2104 static PyObject *__pyx_n_s__SNPCaller;
2105 static PyObject *__pyx_n_s__SO;
2106 static PyObject *__pyx_n_s__SP;
2107 static PyObject *__pyx_n_s__SQ;
2108 static PyObject *__pyx_n_s__Samfile;
2109 static PyObject *__pyx_n_s__StderrStore;
2110 static PyObject *__pyx_n_s__StderrStoreWindows;
2111 static PyObject *__pyx_n_s__StopIteration;
2112 static PyObject *__pyx_n_s__TypeError;
2113 static PyObject *__pyx_n_s__UR;
2114 static PyObject *__pyx_n_s__VALID_HEADERS;
2115 static PyObject *__pyx_n_s__VALID_HEADER_FIELDS;
2116 static PyObject *__pyx_n_s__VALID_HEADER_ORDER;
2117 static PyObject *__pyx_n_s__VALID_HEADER_TYPES;
2118 static PyObject *__pyx_n_s__VN;
2119 static PyObject *__pyx_n_s__ValueError;
2120 static PyObject *__pyx_n_s__Windows;
2121 static PyObject *__pyx_n_s__Z;
2122 static PyObject *__pyx_n_s____all__;
2123 static PyObject *__pyx_n_s____del__;
2124 static PyObject *__pyx_n_s____dict__;
2125 static PyObject *__pyx_n_s____getattribute__;
2126 static PyObject *__pyx_n_s____init__;
2127 static PyObject *__pyx_n_s____main__;
2128 static PyObject *__pyx_n_s____next__;
2129 static PyObject *__pyx_n_s____str__;
2130 static PyObject *__pyx_n_s____test__;
2131 static PyObject *__pyx_n_s___alignment;
2132 static PyObject *__pyx_n_s___buildHeader;
2133 static PyObject *__pyx_n_s___buildLine;
2134 static PyObject *__pyx_n_s___call;
2135 static PyObject *__pyx_n_s___consensus_quality;
2136 static PyObject *__pyx_n_s___coverage;
2137 static PyObject *__pyx_n_s___delegate;
2138 static PyObject *__pyx_n_s___filename;
2139 static PyObject *__pyx_n_s___genotype;
2140 static PyObject *__pyx_n_s___hasIndex;
2141 static PyObject *__pyx_n_s___indel;
2142 static PyObject *__pyx_n_s___isOpen;
2143 static PyObject *__pyx_n_s___is_del;
2144 static PyObject *__pyx_n_s___is_head;
2145 static PyObject *__pyx_n_s___is_tail;
2146 static PyObject *__pyx_n_s___level;
2147 static PyObject *__pyx_n_s___logfile;
2148 static PyObject *__pyx_n_s___open;
2149 static PyObject *__pyx_n_s___parseRegion;
2150 static PyObject *__pyx_n_s___pos;
2151 static PyObject *__pyx_n_s___qpos;
2152 static PyObject *__pyx_n_s___r;
2153 static PyObject *__pyx_n_s___reference_base;
2154 static PyObject *__pyx_n_s___samtools_dispatch;
2155 static PyObject *__pyx_n_s___snp_quality;
2156 static PyObject *__pyx_n_s___tid;
2157 static PyObject *__pyx_n_s__addReference;
2158 static PyObject *__pyx_n_s__alignment;
2159 static PyObject *__pyx_n_s__all;
2160 static PyObject *__pyx_n_s__args;
2161 static PyObject *__pyx_n_s__b;
2162 static PyObject *__pyx_n_s__bam;
2163 static PyObject *__pyx_n_s__beg;
2164 static PyObject *__pyx_n_s__bin;
2165 static PyObject *__pyx_n_s__bqual;
2166 static PyObject *__pyx_n_s__build;
2167 static PyObject *__pyx_n_s__c;
2168 static PyObject *__pyx_n_s__calcsize;
2169 static PyObject *__pyx_n_s__call;
2170 static PyObject *__pyx_n_s__callback;
2171 static PyObject *__pyx_n_s__cap_mapQ;
2172 static PyObject *__pyx_n_s__catch_stderr;
2173 static PyObject *__pyx_n_s__catch_stdout;
2174 static PyObject *__pyx_n_s__chr;
2175 static PyObject *__pyx_n_s__cigar;
2176 static PyObject *__pyx_n_s__close;
2177 static PyObject *__pyx_n_s__cmp;
2178 static PyObject *__pyx_n_s__cnext;
2179 static PyObject *__pyx_n_s__cnt1;
2180 static PyObject *__pyx_n_s__cnt2;
2181 static PyObject *__pyx_n_s__cnt_anti;
2182 static PyObject *__pyx_n_s__collections;
2183 static PyObject *__pyx_n_s__compare;
2184 static PyObject *__pyx_n_s__consensus_quality;
2185 static PyObject *__pyx_n_s__core;
2186 static PyObject *__pyx_n_s__count;
2187 static PyObject *__pyx_n_s__coverage;
2188 static PyObject *__pyx_n_s__ctypes;
2189 static PyObject *__pyx_n_s__current_pos;
2190 static PyObject *__pyx_n_s__d;
2191 static PyObject *__pyx_n_s__data;
2192 static PyObject *__pyx_n_s__data_len;
2193 static PyObject *__pyx_n_s__defaultdict;
2194 static PyObject *__pyx_n_s__devnull;
2195 static PyObject *__pyx_n_s__dup;
2196 static PyObject *__pyx_n_s__dup2;
2197 static PyObject *__pyx_n_s__end;
2198 static PyObject *__pyx_n_s__errmod;
2199 static PyObject *__pyx_n_s__exc_type;
2200 static PyObject *__pyx_n_s__exc_value;
2201 static PyObject *__pyx_n_s__exists;
2202 static PyObject *__pyx_n_s__f;
2203 static PyObject *__pyx_n_s__fancy_str;
2204 static PyObject *__pyx_n_s__fastafile;
2205 static PyObject *__pyx_n_s__fd;
2206 static PyObject *__pyx_n_s__fetch;
2207 static PyObject *__pyx_n_s__fields;
2208 static PyObject *__pyx_n_s__filename;
2209 static PyObject *__pyx_n_s__fileno;
2210 static PyObject *__pyx_n_s__first_allele;
2211 static PyObject *__pyx_n_s__flag;
2212 static PyObject *__pyx_n_s__flush;
2213 static PyObject *__pyx_n_s__fp;
2214 static PyObject *__pyx_n_s__genotype;
2215 static PyObject *__pyx_n_s__getSequence;
2216 static PyObject *__pyx_n_s__getrname;
2217 static PyObject *__pyx_n_s__gettid;
2218 static PyObject *__pyx_n_s__hasReference;
2219 static PyObject *__pyx_n_s__hash;
2220 static PyObject *__pyx_n_s__header;
2221 static PyObject *__pyx_n_s__het_rate;
2222 static PyObject *__pyx_n_s__i;
2223 static PyObject *__pyx_n_s__id;
2224 static PyObject *__pyx_n_s__indel;
2225 static PyObject *__pyx_n_s__indel1;
2226 static PyObject *__pyx_n_s__indel2;
2227 static PyObject *__pyx_n_s__index;
2228 static PyObject *__pyx_n_s__is_del;
2229 static PyObject *__pyx_n_s__is_head;
2230 static PyObject *__pyx_n_s__is_tail;
2231 static PyObject *__pyx_n_s__isbam;
2232 static PyObject *__pyx_n_s__isize;
2233 static PyObject *__pyx_n_s__isremote;
2234 static PyObject *__pyx_n_s__isupper;
2235 static PyObject *__pyx_n_s__iter;
2236 static PyObject *__pyx_n_s__iterator_column;
2237 static PyObject *__pyx_n_s__iterdata;
2238 static PyObject *__pyx_n_s__itertools;
2239 static PyObject *__pyx_n_s__join;
2240 static PyObject *__pyx_n_s__l_aux;
2241 static PyObject *__pyx_n_s__l_qname;
2242 static PyObject *__pyx_n_s__l_qseq;
2243 static PyObject *__pyx_n_s__l_text;
2244 static PyObject *__pyx_n_s__level;
2245 static PyObject *__pyx_n_s__m_data;
2246 static PyObject *__pyx_n_s__map;
2247 static PyObject *__pyx_n_s__mapping_quality;
2248 static PyObject *__pyx_n_s__mapq;
2249 static PyObject *__pyx_n_s__mask;
2250 static PyObject *__pyx_n_s__mate;
2251 static PyObject *__pyx_n_s__max_depth;
2252 static PyObject *__pyx_n_s__method;
2253 static PyObject *__pyx_n_s__min_baseQ;
2254 static PyObject *__pyx_n_s__mkstemp;
2255 static PyObject *__pyx_n_s__mode;
2256 static PyObject *__pyx_n_s__mpos;
2257 static PyObject *__pyx_n_s__mrnm;
2258 static PyObject *__pyx_n_s__mtid;
2259 static PyObject *__pyx_n_s__n;
2260 static PyObject *__pyx_n_s__n_cigar;
2261 static PyObject *__pyx_n_s__n_hap;
2262 static PyObject *__pyx_n_s__n_haplotypes;
2263 static PyObject *__pyx_n_s__n_plp;
2264 static PyObject *__pyx_n_s__n_pu;
2265 static PyObject *__pyx_n_s__n_targets;
2266 static PyObject *__pyx_n_s__name;
2267 static PyObject *__pyx_n_s__nextiter;
2268 static PyObject *__pyx_n_s__nreferences;
2269 static PyObject *__pyx_n_s__object;
2270 static PyObject *__pyx_n_s__offset;
2271 static PyObject *__pyx_n_s__open;
2272 static PyObject *__pyx_n_s__opt;
2273 static PyObject *__pyx_n_s__options;
2274 static PyObject *__pyx_n_s__os;
2275 static PyObject *__pyx_n_s__overlap;
2276 static PyObject *__pyx_n_s__owns_samfile;
2277 static PyObject *__pyx_n_s__pack_into;
2278 static PyObject *__pyx_n_s__path;
2279 static PyObject *__pyx_n_s__pileup;
2280 static PyObject *__pyx_n_s__pileup_iter;
2281 static PyObject *__pyx_n_s__pileups;
2282 static PyObject *__pyx_n_s__platform;
2283 static PyObject *__pyx_n_s__plp;
2284 static PyObject *__pyx_n_s__port;
2285 static PyObject *__pyx_n_s__pos;
2286 static PyObject *__pyx_n_s__positions;
2287 static PyObject *__pyx_n_s__q_cns;
2288 static PyObject *__pyx_n_s__q_indel;
2289 static PyObject *__pyx_n_s__q_r;
2290 static PyObject *__pyx_n_s__q_ref;
2291 static PyObject *__pyx_n_s__qname;
2292 static PyObject *__pyx_n_s__qpos;
2293 static PyObject *__pyx_n_s__qseq;
2294 static PyObject *__pyx_n_s__qual;
2295 static PyObject *__pyx_n_s__r;
2296 static PyObject *__pyx_n_s__r_indel;
2297 static PyObject *__pyx_n_s__range;
2298 static PyObject *__pyx_n_s__raw;
2299 static PyObject *__pyx_n_s__rb;
2300 static PyObject *__pyx_n_s__re;
2301 static PyObject *__pyx_n_s__readAndRelease;
2302 static PyObject *__pyx_n_s__readlines;
2303 static PyObject *__pyx_n_s__reads_diff;
2304 static PyObject *__pyx_n_s__reads_first;
2305 static PyObject *__pyx_n_s__reads_second;
2306 static PyObject *__pyx_n_s__record;
2307 static PyObject *__pyx_n_s__reference;
2308 static PyObject *__pyx_n_s__reference_base;
2309 static PyObject *__pyx_n_s__referencelengths;
2310 static PyObject *__pyx_n_s__referencenames;
2311 static PyObject *__pyx_n_s__region;
2312 static PyObject *__pyx_n_s__release;
2313 static PyObject *__pyx_n_s__remove;
2314 static PyObject *__pyx_n_s__reopen;
2315 static PyObject *__pyx_n_s__reset;
2316 static PyObject *__pyx_n_s__restore;
2317 static PyObject *__pyx_n_s__retval;
2318 static PyObject *__pyx_n_s__rg2lib;
2319 static PyObject *__pyx_n_s__rlen;
2320 static PyObject *__pyx_n_s__rname;
2321 static PyObject *__pyx_n_s__rowiter;
2322 static PyObject *__pyx_n_s__s;
2323 static PyObject *__pyx_n_s__samfile;
2324 static PyObject *__pyx_n_s__samtools;
2325 static PyObject *__pyx_n_s__second_allele;
2326 static PyObject *__pyx_n_s__seek;
2327 static PyObject *__pyx_n_s__self;
2328 static PyObject *__pyx_n_s__seq;
2329 static PyObject *__pyx_n_s__seq_len;
2330 static PyObject *__pyx_n_s__setdevice;
2331 static PyObject *__pyx_n_s__setfd;
2332 static PyObject *__pyx_n_s__setfile;
2333 static PyObject *__pyx_n_s__setupIteratorData;
2334 static PyObject *__pyx_n_s__snp_quality;
2335 static PyObject *__pyx_n_s__split;
2336 static PyObject *__pyx_n_s__start;
2337 static PyObject *__pyx_n_s__startswith;
2338 static PyObject *__pyx_n_s__stderr;
2339 static PyObject *__pyx_n_s__stderr_f;
2340 static PyObject *__pyx_n_s__stderr_h;
2341 static PyObject *__pyx_n_s__stderr_save;
2342 static PyObject *__pyx_n_s__stdout;
2343 static PyObject *__pyx_n_s__stepper;
2344 static PyObject *__pyx_n_s__streams;
2345 static PyObject *__pyx_n_s__strip;
2346 static PyObject *__pyx_n_s__struct;
2347 static PyObject *__pyx_n_s__sys;
2348 static PyObject *__pyx_n_s__system;
2349 static PyObject *__pyx_n_s__tags;
2350 static PyObject *__pyx_n_s__target_len;
2351 static PyObject *__pyx_n_s__target_name;
2352 static PyObject *__pyx_n_s__tell;
2353 static PyObject *__pyx_n_s__tempfile;
2354 static PyObject *__pyx_n_s__template;
2355 static PyObject *__pyx_n_s__text;
2356 static PyObject *__pyx_n_s__theta;
2357 static PyObject *__pyx_n_s__tid;
2358 static PyObject *__pyx_n_s__traceback;
2359 static PyObject *__pyx_n_s__types;
2360 static PyObject *__pyx_n_s__until_eof;
2361 static PyObject *__pyx_n_s__view;
2362 static PyObject *__pyx_n_s__w;
2363 static PyObject *__pyx_n_s__wb;
2364 static PyObject *__pyx_n_s__wbu;
2365 static PyObject *__pyx_n_s__wh;
2366 static PyObject *__pyx_n_s__where;
2367 static PyObject *__pyx_n_s__write;
2368 static PyObject *__pyx_n_s__x;
2369 static PyObject *__pyx_int_0;
2370 static PyObject *__pyx_int_1;
2371 static PyObject *__pyx_int_2;
2372 static PyObject *__pyx_int_4;
2373 static PyObject *__pyx_int_8;
2374 static PyObject *__pyx_int_13;
2375 static PyObject *__pyx_int_16;
2376 static PyObject *__pyx_int_32;
2377 static PyObject *__pyx_int_40;
2378 static PyObject *__pyx_int_60;
2379 static PyObject *__pyx_int_64;
2380 static PyObject *__pyx_int_128;
2381 static PyObject *__pyx_int_255;
2382 static PyObject *__pyx_int_256;
2383 static PyObject *__pyx_int_512;
2384 static PyObject *__pyx_int_neg_127;
2385 static PyObject *__pyx_int_0660;
2386 static PyObject *__pyx_int_1024;
2387 static PyObject *__pyx_int_65535;
2388 static PyObject *__pyx_int_neg_32767;
2389 static PyObject *__pyx_int_536870912;
2390 static PyObject *__pyx_int_4294967295;
2391 static PyObject *__pyx_int_neg_2147483648;
2392 static PyObject *__pyx_k_29;
2393 static PyObject *__pyx_k_39;
2394 static int __pyx_k_58;
2395 static PyObject *__pyx_k_98;
2396 static PyObject *__pyx_k_99;
2398 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":76
2399 * #####################################################################
2400 * cdef class AlignedRead
2401 * cdef makeAlignedRead(bam1_t * src): # <<<<<<<<<<<<<<
2402 * '''enter src into AlignedRead.'''
2403 * cdef AlignedRead dest = AlignedRead.__new__(AlignedRead)
2406 static PyObject *__pyx_f_9csamtools_makeAlignedRead(bam1_t *__pyx_v_src) {
2407 struct __pyx_obj_9csamtools_AlignedRead *__pyx_v_dest = 0;
2408 PyObject *__pyx_r = NULL;
2409 PyObject *__pyx_t_1 = NULL;
2410 __Pyx_TraceDeclarations
2411 __Pyx_RefNannySetupContext("makeAlignedRead");
2412 __Pyx_TraceCall("makeAlignedRead", __pyx_f[0], 76);
2414 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":78
2415 * cdef makeAlignedRead(bam1_t * src):
2416 * '''enter src into AlignedRead.'''
2417 * cdef AlignedRead dest = AlignedRead.__new__(AlignedRead) # <<<<<<<<<<<<<<
2418 * dest._delegate = bam_dup1(src)
2421 __pyx_t_1 = __Pyx_tp_new(((PyObject*)__pyx_ptype_9csamtools_AlignedRead)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2422 __Pyx_GOTREF(__pyx_t_1);
2423 if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_9csamtools_AlignedRead)))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2424 __pyx_v_dest = ((struct __pyx_obj_9csamtools_AlignedRead *)__pyx_t_1);
2427 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":79
2428 * '''enter src into AlignedRead.'''
2429 * cdef AlignedRead dest = AlignedRead.__new__(AlignedRead)
2430 * dest._delegate = bam_dup1(src) # <<<<<<<<<<<<<<
2434 __pyx_v_dest->_delegate = bam_dup1(__pyx_v_src);
2436 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":80
2437 * cdef AlignedRead dest = AlignedRead.__new__(AlignedRead)
2438 * dest._delegate = bam_dup1(src)
2439 * return dest # <<<<<<<<<<<<<<
2441 * cdef class PileupProxy
2443 __Pyx_XDECREF(__pyx_r);
2444 __Pyx_INCREF(((PyObject *)__pyx_v_dest));
2445 __pyx_r = ((PyObject *)__pyx_v_dest);
2448 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
2451 __Pyx_XDECREF(__pyx_t_1);
2452 __Pyx_AddTraceback("csamtools.makeAlignedRead");
2455 __Pyx_XDECREF((PyObject *)__pyx_v_dest);
2456 __Pyx_XGIVEREF(__pyx_r);
2457 __Pyx_TraceReturn(__pyx_r);
2458 __Pyx_RefNannyFinishContext();
2462 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":83
2464 * cdef class PileupProxy
2465 * cdef makePileupProxy( bam_pileup1_t * plp, int tid, int pos, int n ): # <<<<<<<<<<<<<<
2466 * cdef PileupProxy dest = PileupProxy.__new__(PileupProxy)
2470 static PyObject *__pyx_f_9csamtools_makePileupProxy(bam_pileup1_t *__pyx_v_plp, int __pyx_v_tid, int __pyx_v_pos, int __pyx_v_n) {
2471 struct __pyx_obj_9csamtools_PileupProxy *__pyx_v_dest = 0;
2472 PyObject *__pyx_r = NULL;
2473 PyObject *__pyx_t_1 = NULL;
2474 __Pyx_TraceDeclarations
2475 __Pyx_RefNannySetupContext("makePileupProxy");
2476 __Pyx_TraceCall("makePileupProxy", __pyx_f[0], 83);
2478 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":84
2479 * cdef class PileupProxy
2480 * cdef makePileupProxy( bam_pileup1_t * plp, int tid, int pos, int n ):
2481 * cdef PileupProxy dest = PileupProxy.__new__(PileupProxy) # <<<<<<<<<<<<<<
2485 __pyx_t_1 = __Pyx_tp_new(((PyObject*)__pyx_ptype_9csamtools_PileupProxy)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2486 __Pyx_GOTREF(__pyx_t_1);
2487 if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_9csamtools_PileupProxy)))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2488 __pyx_v_dest = ((struct __pyx_obj_9csamtools_PileupProxy *)__pyx_t_1);
2491 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":85
2492 * cdef makePileupProxy( bam_pileup1_t * plp, int tid, int pos, int n ):
2493 * cdef PileupProxy dest = PileupProxy.__new__(PileupProxy)
2494 * dest.plp = plp # <<<<<<<<<<<<<<
2498 __pyx_v_dest->plp = __pyx_v_plp;
2500 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":86
2501 * cdef PileupProxy dest = PileupProxy.__new__(PileupProxy)
2503 * dest.tid = tid # <<<<<<<<<<<<<<
2507 __pyx_v_dest->tid = __pyx_v_tid;
2509 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":87
2512 * dest.pos = pos # <<<<<<<<<<<<<<
2516 __pyx_v_dest->pos = __pyx_v_pos;
2518 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":88
2521 * dest.n = n # <<<<<<<<<<<<<<
2525 __pyx_t_1 = PyInt_FromLong(__pyx_v_n); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2526 __Pyx_GOTREF(__pyx_t_1);
2527 if (PyObject_SetAttr(((PyObject *)__pyx_v_dest), __pyx_n_s__n, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2528 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2530 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":89
2533 * return dest # <<<<<<<<<<<<<<
2535 * cdef class PileupRead
2537 __Pyx_XDECREF(__pyx_r);
2538 __Pyx_INCREF(((PyObject *)__pyx_v_dest));
2539 __pyx_r = ((PyObject *)__pyx_v_dest);
2542 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
2545 __Pyx_XDECREF(__pyx_t_1);
2546 __Pyx_AddTraceback("csamtools.makePileupProxy");
2549 __Pyx_XDECREF((PyObject *)__pyx_v_dest);
2550 __Pyx_XGIVEREF(__pyx_r);
2551 __Pyx_TraceReturn(__pyx_r);
2552 __Pyx_RefNannyFinishContext();
2556 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":92
2558 * cdef class PileupRead
2559 * cdef makePileupRead( bam_pileup1_t * src ): # <<<<<<<<<<<<<<
2560 * '''fill a PileupRead object from a bam_pileup1_t * object.'''
2561 * cdef PileupRead dest = PileupRead.__new__(PileupRead)
2564 static PyObject *__pyx_f_9csamtools_makePileupRead(bam_pileup1_t *__pyx_v_src) {
2565 struct __pyx_obj_9csamtools_PileupRead *__pyx_v_dest = 0;
2566 PyObject *__pyx_r = NULL;
2567 PyObject *__pyx_t_1 = NULL;
2568 __Pyx_TraceDeclarations
2569 __Pyx_RefNannySetupContext("makePileupRead");
2570 __Pyx_TraceCall("makePileupRead", __pyx_f[0], 92);
2572 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":94
2573 * cdef makePileupRead( bam_pileup1_t * src ):
2574 * '''fill a PileupRead object from a bam_pileup1_t * object.'''
2575 * cdef PileupRead dest = PileupRead.__new__(PileupRead) # <<<<<<<<<<<<<<
2576 * dest._alignment = makeAlignedRead( src.b )
2577 * dest._qpos = src.qpos
2579 __pyx_t_1 = __Pyx_tp_new(((PyObject*)__pyx_ptype_9csamtools_PileupRead)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2580 __Pyx_GOTREF(__pyx_t_1);
2581 if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_9csamtools_PileupRead)))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2582 __pyx_v_dest = ((struct __pyx_obj_9csamtools_PileupRead *)__pyx_t_1);
2585 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":95
2586 * '''fill a PileupRead object from a bam_pileup1_t * object.'''
2587 * cdef PileupRead dest = PileupRead.__new__(PileupRead)
2588 * dest._alignment = makeAlignedRead( src.b ) # <<<<<<<<<<<<<<
2589 * dest._qpos = src.qpos
2590 * dest._indel = src.indel
2592 __pyx_t_1 = __pyx_f_9csamtools_makeAlignedRead(__pyx_v_src->b); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2593 __Pyx_GOTREF(__pyx_t_1);
2594 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_9csamtools_AlignedRead))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2595 __Pyx_GIVEREF(__pyx_t_1);
2596 __Pyx_GOTREF(__pyx_v_dest->_alignment);
2597 __Pyx_DECREF(((PyObject *)__pyx_v_dest->_alignment));
2598 __pyx_v_dest->_alignment = ((struct __pyx_obj_9csamtools_AlignedRead *)__pyx_t_1);
2601 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":96
2602 * cdef PileupRead dest = PileupRead.__new__(PileupRead)
2603 * dest._alignment = makeAlignedRead( src.b )
2604 * dest._qpos = src.qpos # <<<<<<<<<<<<<<
2605 * dest._indel = src.indel
2606 * dest._level = src.level
2608 __pyx_v_dest->_qpos = __pyx_v_src->qpos;
2610 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":97
2611 * dest._alignment = makeAlignedRead( src.b )
2612 * dest._qpos = src.qpos
2613 * dest._indel = src.indel # <<<<<<<<<<<<<<
2614 * dest._level = src.level
2615 * dest._is_del = src.is_del
2617 __pyx_v_dest->_indel = __pyx_v_src->indel;
2619 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":98
2620 * dest._qpos = src.qpos
2621 * dest._indel = src.indel
2622 * dest._level = src.level # <<<<<<<<<<<<<<
2623 * dest._is_del = src.is_del
2624 * dest._is_head = src.is_head
2626 __pyx_v_dest->_level = __pyx_v_src->level;
2628 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":99
2629 * dest._indel = src.indel
2630 * dest._level = src.level
2631 * dest._is_del = src.is_del # <<<<<<<<<<<<<<
2632 * dest._is_head = src.is_head
2633 * dest._is_tail = src.is_tail
2635 __pyx_v_dest->_is_del = __pyx_v_src->is_del;
2637 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":100
2638 * dest._level = src.level
2639 * dest._is_del = src.is_del
2640 * dest._is_head = src.is_head # <<<<<<<<<<<<<<
2641 * dest._is_tail = src.is_tail
2644 __pyx_v_dest->_is_head = __pyx_v_src->is_head;
2646 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":101
2647 * dest._is_del = src.is_del
2648 * dest._is_head = src.is_head
2649 * dest._is_tail = src.is_tail # <<<<<<<<<<<<<<
2653 __pyx_v_dest->_is_tail = __pyx_v_src->is_tail;
2655 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":102
2656 * dest._is_head = src.is_head
2657 * dest._is_tail = src.is_tail
2658 * return dest # <<<<<<<<<<<<<<
2660 * #####################################################################
2662 __Pyx_XDECREF(__pyx_r);
2663 __Pyx_INCREF(((PyObject *)__pyx_v_dest));
2664 __pyx_r = ((PyObject *)__pyx_v_dest);
2667 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
2670 __Pyx_XDECREF(__pyx_t_1);
2671 __Pyx_AddTraceback("csamtools.makePileupRead");
2674 __Pyx_XDECREF((PyObject *)__pyx_v_dest);
2675 __Pyx_XGIVEREF(__pyx_r);
2676 __Pyx_TraceReturn(__pyx_r);
2677 __Pyx_RefNannyFinishContext();
2681 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":109
2682 * ## Generic callbacks for inserting python callbacks.
2683 * #####################################################################
2684 * cdef int fetch_callback( bam1_t *alignment, void *f): # <<<<<<<<<<<<<<
2685 * '''callback for bam_fetch.
2689 static int __pyx_f_9csamtools_fetch_callback(bam1_t *__pyx_v_alignment, void *__pyx_v_f) {
2690 PyObject *__pyx_v_a;
2692 PyObject *__pyx_t_1 = NULL;
2693 PyObject *__pyx_t_2 = NULL;
2694 __Pyx_TraceDeclarations
2695 __Pyx_RefNannySetupContext("fetch_callback");
2696 __Pyx_TraceCall("fetch_callback", __pyx_f[0], 109);
2697 __pyx_v_a = Py_None; __Pyx_INCREF(Py_None);
2699 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":114
2700 * calls function in *f* with a new :class:`AlignedRead` object as parameter.
2702 * a = makeAlignedRead( alignment ) # <<<<<<<<<<<<<<
2706 __pyx_t_1 = __pyx_f_9csamtools_makeAlignedRead(__pyx_v_alignment); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2707 __Pyx_GOTREF(__pyx_t_1);
2708 __Pyx_DECREF(__pyx_v_a);
2709 __pyx_v_a = __pyx_t_1;
2712 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":115
2714 * a = makeAlignedRead( alignment )
2715 * (<object>f)(a) # <<<<<<<<<<<<<<
2717 * class PileupColumn(object):
2719 __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2720 __Pyx_GOTREF(__pyx_t_1);
2721 __Pyx_INCREF(__pyx_v_a);
2722 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_a);
2723 __Pyx_GIVEREF(__pyx_v_a);
2724 __pyx_t_2 = PyObject_Call(((PyObject *)__pyx_v_f), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2725 __Pyx_GOTREF(__pyx_t_2);
2726 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2727 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2732 __Pyx_XDECREF(__pyx_t_1);
2733 __Pyx_XDECREF(__pyx_t_2);
2734 __Pyx_WriteUnraisable("csamtools.fetch_callback");
2737 __Pyx_DECREF(__pyx_v_a);
2738 __Pyx_TraceReturn(Py_None);
2739 __Pyx_RefNannyFinishContext();
2743 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":130
2744 * list of reads (:class:`pysam.PileupRead`) aligned to this column
2746 * def __str__(self): # <<<<<<<<<<<<<<
2747 * return "\t".join( map(str, (self.tid, self.pos, self.n))) +\
2748 * "\n" + "\n".join( map(str, self.pileups) )
2751 static PyObject *__pyx_pf_9csamtools_12PileupColumn___str__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
2752 static char __pyx_doc_9csamtools_12PileupColumn___str__[] = "PileupColumn.__str__(self)";
2753 static PyMethodDef __pyx_mdef_9csamtools_12PileupColumn___str__ = {__Pyx_NAMESTR("__str__"), (PyCFunction)__pyx_pf_9csamtools_12PileupColumn___str__, METH_O, __Pyx_DOCSTR(__pyx_doc_9csamtools_12PileupColumn___str__)};
2754 static PyObject *__pyx_pf_9csamtools_12PileupColumn___str__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
2755 PyObject *__pyx_r = NULL;
2756 PyObject *__pyx_t_1 = NULL;
2757 PyObject *__pyx_t_2 = NULL;
2758 PyObject *__pyx_t_3 = NULL;
2759 PyObject *__pyx_t_4 = NULL;
2760 PyObject *__pyx_t_5 = NULL;
2761 __Pyx_TraceDeclarations
2762 __Pyx_RefNannySetupContext("__str__");
2763 __Pyx_TraceCall("__str__", __pyx_f[0], 130);
2764 __pyx_self = __pyx_self;
2766 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":131
2768 * def __str__(self):
2769 * return "\t".join( map(str, (self.tid, self.pos, self.n))) +\ # <<<<<<<<<<<<<<
2770 * "\n" + "\n".join( map(str, self.pileups) )
2773 __Pyx_XDECREF(__pyx_r);
2775 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":132
2776 * def __str__(self):
2777 * return "\t".join( map(str, (self.tid, self.pos, self.n))) +\
2778 * "\n" + "\n".join( map(str, self.pileups) ) # <<<<<<<<<<<<<<
2780 * cdef int pileup_callback( uint32_t tid, uint32_t pos, int n, bam_pileup1_t *pl, void *f):
2782 __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 = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2783 __Pyx_GOTREF(__pyx_t_1);
2785 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":131
2787 * def __str__(self):
2788 * return "\t".join( map(str, (self.tid, self.pos, self.n))) +\ # <<<<<<<<<<<<<<
2789 * "\n" + "\n".join( map(str, self.pileups) )
2792 __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__tid); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2793 __Pyx_GOTREF(__pyx_t_2);
2794 __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__pos); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2795 __Pyx_GOTREF(__pyx_t_3);
2796 __pyx_t_4 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__n); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2797 __Pyx_GOTREF(__pyx_t_4);
2798 __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2799 __Pyx_GOTREF(__pyx_t_5);
2800 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
2801 __Pyx_GIVEREF(__pyx_t_2);
2802 PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3);
2803 __Pyx_GIVEREF(__pyx_t_3);
2804 PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_4);
2805 __Pyx_GIVEREF(__pyx_t_4);
2809 __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2810 __Pyx_GOTREF(__pyx_t_4);
2811 __Pyx_INCREF(((PyObject *)((PyObject*)&PyString_Type)));
2812 PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)((PyObject*)&PyString_Type)));
2813 __Pyx_GIVEREF(((PyObject *)((PyObject*)&PyString_Type)));
2814 PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_5);
2815 __Pyx_GIVEREF(__pyx_t_5);
2817 __pyx_t_5 = PyObject_Call(__pyx_builtin_map, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2818 __Pyx_GOTREF(__pyx_t_5);
2819 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2820 __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2821 __Pyx_GOTREF(__pyx_t_4);
2822 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
2823 __Pyx_GIVEREF(__pyx_t_5);
2825 __pyx_t_5 = PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2826 __Pyx_GOTREF(__pyx_t_5);
2827 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2828 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2829 __pyx_t_4 = PyNumber_Add(__pyx_t_5, ((PyObject *)__pyx_kp_s_2)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2830 __Pyx_GOTREF(__pyx_t_4);
2831 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2833 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":132
2834 * def __str__(self):
2835 * return "\t".join( map(str, (self.tid, self.pos, self.n))) +\
2836 * "\n" + "\n".join( map(str, self.pileups) ) # <<<<<<<<<<<<<<
2838 * cdef int pileup_callback( uint32_t tid, uint32_t pos, int n, bam_pileup1_t *pl, void *f):
2840 __pyx_t_5 = PyObject_GetAttr(((PyObject *)__pyx_kp_s_2), __pyx_n_s__join); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2841 __Pyx_GOTREF(__pyx_t_5);
2842 __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__pileups); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2843 __Pyx_GOTREF(__pyx_t_1);
2844 __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2845 __Pyx_GOTREF(__pyx_t_3);
2846 __Pyx_INCREF(((PyObject *)((PyObject*)&PyString_Type)));
2847 PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)((PyObject*)&PyString_Type)));
2848 __Pyx_GIVEREF(((PyObject *)((PyObject*)&PyString_Type)));
2849 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
2850 __Pyx_GIVEREF(__pyx_t_1);
2852 __pyx_t_1 = PyObject_Call(__pyx_builtin_map, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2853 __Pyx_GOTREF(__pyx_t_1);
2854 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2855 __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2856 __Pyx_GOTREF(__pyx_t_3);
2857 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
2858 __Pyx_GIVEREF(__pyx_t_1);
2860 __pyx_t_1 = PyObject_Call(__pyx_t_5, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2861 __Pyx_GOTREF(__pyx_t_1);
2862 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2863 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2864 __pyx_t_3 = PyNumber_Add(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2865 __Pyx_GOTREF(__pyx_t_3);
2866 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2867 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2868 __pyx_r = __pyx_t_3;
2872 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
2875 __Pyx_XDECREF(__pyx_t_1);
2876 __Pyx_XDECREF(__pyx_t_2);
2877 __Pyx_XDECREF(__pyx_t_3);
2878 __Pyx_XDECREF(__pyx_t_4);
2879 __Pyx_XDECREF(__pyx_t_5);
2880 __Pyx_AddTraceback("csamtools.PileupColumn.__str__");
2883 __Pyx_XGIVEREF(__pyx_r);
2884 __Pyx_TraceReturn(__pyx_r);
2885 __Pyx_RefNannyFinishContext();
2889 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":134
2890 * "\n" + "\n".join( map(str, self.pileups) )
2892 * cdef int pileup_callback( uint32_t tid, uint32_t pos, int n, bam_pileup1_t *pl, void *f): # <<<<<<<<<<<<<<
2893 * '''callback for pileup.
2897 static int __pyx_f_9csamtools_pileup_callback(uint32_t __pyx_v_tid, uint32_t __pyx_v_pos, int __pyx_v_n, bam_pileup1_t *__pyx_v_pl, void *__pyx_v_f) {
2898 PyObject *__pyx_v_p;
2899 PyObject *__pyx_v_pileups;
2902 PyObject *__pyx_t_1 = NULL;
2903 PyObject *__pyx_t_2 = NULL;
2906 __Pyx_TraceDeclarations
2907 __Pyx_RefNannySetupContext("pileup_callback");
2908 __Pyx_TraceCall("pileup_callback", __pyx_f[0], 134);
2909 __pyx_v_p = Py_None; __Pyx_INCREF(Py_None);
2910 __pyx_v_pileups = ((PyObject *)Py_None); __Pyx_INCREF(Py_None);
2912 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":151
2915 * p = PileupColumn() # <<<<<<<<<<<<<<
2919 __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__PileupColumn); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2920 __Pyx_GOTREF(__pyx_t_1);
2921 __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 = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2922 __Pyx_GOTREF(__pyx_t_2);
2923 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2924 __Pyx_DECREF(__pyx_v_p);
2925 __pyx_v_p = __pyx_t_2;
2928 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":152
2930 * p = PileupColumn()
2931 * p.tid = tid # <<<<<<<<<<<<<<
2935 __pyx_t_2 = __Pyx_PyInt_to_py_uint32_t(__pyx_v_tid); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2936 __Pyx_GOTREF(__pyx_t_2);
2937 if (PyObject_SetAttr(__pyx_v_p, __pyx_n_s__tid, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2938 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2940 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":153
2941 * p = PileupColumn()
2943 * p.pos = pos # <<<<<<<<<<<<<<
2947 __pyx_t_2 = __Pyx_PyInt_to_py_uint32_t(__pyx_v_pos); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2948 __Pyx_GOTREF(__pyx_t_2);
2949 if (PyObject_SetAttr(__pyx_v_p, __pyx_n_s__pos, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2950 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2952 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":154
2955 * p.n = n # <<<<<<<<<<<<<<
2959 __pyx_t_2 = PyInt_FromLong(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2960 __Pyx_GOTREF(__pyx_t_2);
2961 if (PyObject_SetAttr(__pyx_v_p, __pyx_n_s__n, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2962 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2964 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":155
2967 * pileups = [] # <<<<<<<<<<<<<<
2971 __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2972 __Pyx_GOTREF(((PyObject *)__pyx_t_2));
2973 __Pyx_DECREF(((PyObject *)__pyx_v_pileups));
2974 __pyx_v_pileups = __pyx_t_2;
2977 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":158
2980 * for x from 0 <= x < n: # <<<<<<<<<<<<<<
2981 * pileups.append( makePileupRead( &(pl[x]) ) )
2982 * p.pileups = pileups
2984 __pyx_t_3 = __pyx_v_n;
2985 for (__pyx_v_x = 0; __pyx_v_x < __pyx_t_3; __pyx_v_x++) {
2987 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":159
2989 * for x from 0 <= x < n:
2990 * pileups.append( makePileupRead( &(pl[x]) ) ) # <<<<<<<<<<<<<<
2991 * p.pileups = pileups
2994 if (unlikely(__pyx_v_pileups == Py_None)) {
2995 PyErr_SetString(PyExc_AttributeError, "'NoneType' object has no attribute 'append'"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2997 __pyx_t_2 = __pyx_f_9csamtools_makePileupRead((&(__pyx_v_pl[__pyx_v_x]))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2998 __Pyx_GOTREF(__pyx_t_2);
2999 __pyx_t_4 = PyList_Append(((PyObject *)__pyx_v_pileups), __pyx_t_2); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3000 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3003 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":160
3004 * for x from 0 <= x < n:
3005 * pileups.append( makePileupRead( &(pl[x]) ) )
3006 * p.pileups = pileups # <<<<<<<<<<<<<<
3010 if (PyObject_SetAttr(__pyx_v_p, __pyx_n_s__pileups, ((PyObject *)__pyx_v_pileups)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3012 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":162
3013 * p.pileups = pileups
3015 * (<object>f)(p) # <<<<<<<<<<<<<<
3017 * cdef int pileup_fetch_callback( bam1_t *b, void *data):
3019 __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3020 __Pyx_GOTREF(__pyx_t_2);
3021 __Pyx_INCREF(__pyx_v_p);
3022 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_p);
3023 __Pyx_GIVEREF(__pyx_v_p);
3024 __pyx_t_1 = PyObject_Call(((PyObject *)__pyx_v_f), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3025 __Pyx_GOTREF(__pyx_t_1);
3026 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3027 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3032 __Pyx_XDECREF(__pyx_t_1);
3033 __Pyx_XDECREF(__pyx_t_2);
3034 __Pyx_WriteUnraisable("csamtools.pileup_callback");
3037 __Pyx_DECREF(__pyx_v_p);
3038 __Pyx_DECREF(__pyx_v_pileups);
3039 __Pyx_TraceReturn(Py_None);
3040 __Pyx_RefNannyFinishContext();
3044 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":164
3047 * cdef int pileup_fetch_callback( bam1_t *b, void *data): # <<<<<<<<<<<<<<
3048 * '''callback for bam_fetch.
3052 static int __pyx_f_9csamtools_pileup_fetch_callback(bam1_t *__pyx_v_b, void *__pyx_v_data) {
3053 bam_plbuf_t *__pyx_v_buf;
3055 __Pyx_TraceDeclarations
3056 __Pyx_RefNannySetupContext("pileup_fetch_callback");
3057 __Pyx_TraceCall("pileup_fetch_callback", __pyx_f[0], 164);
3059 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":170
3061 * cdef bam_plbuf_t * buf
3062 * buf = <bam_plbuf_t*>data # <<<<<<<<<<<<<<
3063 * bam_plbuf_push(b, buf)
3066 __pyx_v_buf = ((bam_plbuf_t *)__pyx_v_data);
3068 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":171
3069 * cdef bam_plbuf_t * buf
3070 * buf = <bam_plbuf_t*>data
3071 * bam_plbuf_push(b, buf) # <<<<<<<<<<<<<<
3075 bam_plbuf_push(__pyx_v_b, __pyx_v_buf);
3077 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":172
3078 * buf = <bam_plbuf_t*>data
3079 * bam_plbuf_push(b, buf)
3080 * return 0 # <<<<<<<<<<<<<<
3082 * class StderrStore():
3089 __Pyx_TraceReturn(Py_None);
3090 __Pyx_RefNannyFinishContext();
3094 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":178
3095 * stderr is captured.
3097 * def __init__(self): # <<<<<<<<<<<<<<
3099 * self.stderr_h, self.stderr_f = tempfile.mkstemp()
3102 static PyObject *__pyx_pf_9csamtools_11StderrStore___init__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
3103 static char __pyx_doc_9csamtools_11StderrStore___init__[] = "StderrStore.__init__(self)";
3104 static PyMethodDef __pyx_mdef_9csamtools_11StderrStore___init__ = {__Pyx_NAMESTR("__init__"), (PyCFunction)__pyx_pf_9csamtools_11StderrStore___init__, METH_O, __Pyx_DOCSTR(__pyx_doc_9csamtools_11StderrStore___init__)};
3105 static PyObject *__pyx_pf_9csamtools_11StderrStore___init__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
3106 PyObject *__pyx_r = NULL;
3107 PyObject *__pyx_t_1 = NULL;
3108 PyObject *__pyx_t_2 = NULL;
3109 PyObject *__pyx_t_3 = NULL;
3110 PyObject *__pyx_t_4 = NULL;
3111 __Pyx_TraceDeclarations
3112 __Pyx_RefNannySetupContext("__init__");
3113 __Pyx_TraceCall("__init__", __pyx_f[0], 178);
3114 __pyx_self = __pyx_self;
3116 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":179
3118 * def __init__(self):
3119 * return # <<<<<<<<<<<<<<
3120 * self.stderr_h, self.stderr_f = tempfile.mkstemp()
3121 * self.stderr_save = Outs( sys.stderr.fileno() )
3123 __Pyx_XDECREF(__pyx_r);
3124 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3127 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":180
3128 * def __init__(self):
3130 * self.stderr_h, self.stderr_f = tempfile.mkstemp() # <<<<<<<<<<<<<<
3131 * self.stderr_save = Outs( sys.stderr.fileno() )
3132 * self.stderr_save.setfd( self.stderr_h )
3134 __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__tempfile); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3135 __Pyx_GOTREF(__pyx_t_1);
3136 __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__mkstemp); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3137 __Pyx_GOTREF(__pyx_t_2);
3138 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3139 __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 = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3140 __Pyx_GOTREF(__pyx_t_1);
3141 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3142 if (PyTuple_CheckExact(__pyx_t_1) && likely(PyTuple_GET_SIZE(__pyx_t_1) == 2)) {
3143 PyObject* tuple = __pyx_t_1;
3144 __pyx_t_2 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_2);
3145 __pyx_t_3 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_3);
3146 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3147 if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__stderr_h, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3148 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3149 if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__stderr_f, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3150 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3152 __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3153 __Pyx_GOTREF(__pyx_t_4);
3154 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3155 __pyx_t_2 = __Pyx_UnpackItem(__pyx_t_4, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3156 __Pyx_GOTREF(__pyx_t_2);
3157 __pyx_t_3 = __Pyx_UnpackItem(__pyx_t_4, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3158 __Pyx_GOTREF(__pyx_t_3);
3159 if (__Pyx_EndUnpack(__pyx_t_4, 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3160 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3161 if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__stderr_h, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3162 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3163 if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__stderr_f, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3164 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3167 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":181
3169 * self.stderr_h, self.stderr_f = tempfile.mkstemp()
3170 * self.stderr_save = Outs( sys.stderr.fileno() ) # <<<<<<<<<<<<<<
3171 * self.stderr_save.setfd( self.stderr_h )
3174 __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__Outs); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3175 __Pyx_GOTREF(__pyx_t_1);
3176 __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__sys); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3177 __Pyx_GOTREF(__pyx_t_3);
3178 __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__stderr); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3179 __Pyx_GOTREF(__pyx_t_2);
3180 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3181 __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__fileno); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3182 __Pyx_GOTREF(__pyx_t_3);
3183 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3184 __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 = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3185 __Pyx_GOTREF(__pyx_t_2);
3186 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3187 __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3188 __Pyx_GOTREF(__pyx_t_3);
3189 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
3190 __Pyx_GIVEREF(__pyx_t_2);
3192 __pyx_t_2 = PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3193 __Pyx_GOTREF(__pyx_t_2);
3194 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3195 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3196 if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__stderr_save, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3197 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3199 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":182
3200 * self.stderr_h, self.stderr_f = tempfile.mkstemp()
3201 * self.stderr_save = Outs( sys.stderr.fileno() )
3202 * self.stderr_save.setfd( self.stderr_h ) # <<<<<<<<<<<<<<
3204 * def readAndRelease( self ):
3206 __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__stderr_save); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3207 __Pyx_GOTREF(__pyx_t_2);
3208 __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__setfd); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3209 __Pyx_GOTREF(__pyx_t_3);
3210 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3211 __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__stderr_h); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3212 __Pyx_GOTREF(__pyx_t_2);
3213 __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3214 __Pyx_GOTREF(__pyx_t_1);
3215 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
3216 __Pyx_GIVEREF(__pyx_t_2);
3218 __pyx_t_2 = PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3219 __Pyx_GOTREF(__pyx_t_2);
3220 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3221 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3222 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3224 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3227 __Pyx_XDECREF(__pyx_t_1);
3228 __Pyx_XDECREF(__pyx_t_2);
3229 __Pyx_XDECREF(__pyx_t_3);
3230 __Pyx_XDECREF(__pyx_t_4);
3231 __Pyx_AddTraceback("csamtools.StderrStore.__init__");
3234 __Pyx_XGIVEREF(__pyx_r);
3235 __Pyx_TraceReturn(__pyx_r);
3236 __Pyx_RefNannyFinishContext();
3240 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":184
3241 * self.stderr_save.setfd( self.stderr_h )
3243 * def readAndRelease( self ): # <<<<<<<<<<<<<<
3245 * self.stderr_save.restore()
3248 static PyObject *__pyx_pf_9csamtools_11StderrStore_readAndRelease(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
3249 static char __pyx_doc_9csamtools_11StderrStore_readAndRelease[] = "StderrStore.readAndRelease(self)";
3250 static PyMethodDef __pyx_mdef_9csamtools_11StderrStore_readAndRelease = {__Pyx_NAMESTR("readAndRelease"), (PyCFunction)__pyx_pf_9csamtools_11StderrStore_readAndRelease, METH_O, __Pyx_DOCSTR(__pyx_doc_9csamtools_11StderrStore_readAndRelease)};
3251 static PyObject *__pyx_pf_9csamtools_11StderrStore_readAndRelease(PyObject *__pyx_self, PyObject *__pyx_v_self) {
3252 PyObject *__pyx_v_lines;
3253 PyObject *__pyx_r = NULL;
3254 PyObject *__pyx_t_1 = NULL;
3255 PyObject *__pyx_t_2 = NULL;
3256 PyObject *__pyx_t_3 = NULL;
3258 __Pyx_TraceDeclarations
3259 __Pyx_RefNannySetupContext("readAndRelease");
3260 __Pyx_TraceCall("readAndRelease", __pyx_f[0], 184);
3261 __pyx_self = __pyx_self;
3262 __pyx_v_lines = Py_None; __Pyx_INCREF(Py_None);
3264 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":185
3266 * def readAndRelease( self ):
3267 * return [] # <<<<<<<<<<<<<<
3268 * self.stderr_save.restore()
3271 __Pyx_XDECREF(__pyx_r);
3272 __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3273 __Pyx_GOTREF(((PyObject *)__pyx_t_1));
3274 __pyx_r = ((PyObject *)__pyx_t_1);
3278 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":186
3279 * def readAndRelease( self ):
3281 * self.stderr_save.restore() # <<<<<<<<<<<<<<
3283 * if os.path.exists(self.stderr_f):
3285 __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__stderr_save); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3286 __Pyx_GOTREF(__pyx_t_1);
3287 __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__restore); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3288 __Pyx_GOTREF(__pyx_t_2);
3289 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3290 __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 = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3291 __Pyx_GOTREF(__pyx_t_1);
3292 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3293 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3295 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":187
3297 * self.stderr_save.restore()
3298 * lines = [] # <<<<<<<<<<<<<<
3299 * if os.path.exists(self.stderr_f):
3300 * lines = open( self.stderr_f, "r" ).readlines()
3302 __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3303 __Pyx_GOTREF(((PyObject *)__pyx_t_1));
3304 __Pyx_DECREF(__pyx_v_lines);
3305 __pyx_v_lines = ((PyObject *)__pyx_t_1);
3308 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":188
3309 * self.stderr_save.restore()
3311 * if os.path.exists(self.stderr_f): # <<<<<<<<<<<<<<
3312 * lines = open( self.stderr_f, "r" ).readlines()
3313 * os.remove( self.stderr_f )
3315 __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__os); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3316 __Pyx_GOTREF(__pyx_t_1);
3317 __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__path); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3318 __Pyx_GOTREF(__pyx_t_2);
3319 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3320 __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__exists); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3321 __Pyx_GOTREF(__pyx_t_1);
3322 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3323 __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__stderr_f); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3324 __Pyx_GOTREF(__pyx_t_2);
3325 __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3326 __Pyx_GOTREF(__pyx_t_3);
3327 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
3328 __Pyx_GIVEREF(__pyx_t_2);
3330 __pyx_t_2 = PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3331 __Pyx_GOTREF(__pyx_t_2);
3332 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3333 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3334 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3335 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3338 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":189
3340 * if os.path.exists(self.stderr_f):
3341 * lines = open( self.stderr_f, "r" ).readlines() # <<<<<<<<<<<<<<
3342 * os.remove( self.stderr_f )
3345 __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__stderr_f); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3346 __Pyx_GOTREF(__pyx_t_2);
3347 __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3348 __Pyx_GOTREF(__pyx_t_3);
3349 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
3350 __Pyx_GIVEREF(__pyx_t_2);
3351 __Pyx_INCREF(((PyObject *)__pyx_n_s__r));
3352 PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_n_s__r));
3353 __Pyx_GIVEREF(((PyObject *)__pyx_n_s__r));
3355 __pyx_t_2 = PyObject_Call(__pyx_builtin_open, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3356 __Pyx_GOTREF(__pyx_t_2);
3357 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3358 __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__readlines); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3359 __Pyx_GOTREF(__pyx_t_3);
3360 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3361 __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 = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3362 __Pyx_GOTREF(__pyx_t_2);
3363 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3364 __Pyx_DECREF(__pyx_v_lines);
3365 __pyx_v_lines = __pyx_t_2;
3368 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":190
3369 * if os.path.exists(self.stderr_f):
3370 * lines = open( self.stderr_f, "r" ).readlines()
3371 * os.remove( self.stderr_f ) # <<<<<<<<<<<<<<
3375 __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__os); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3376 __Pyx_GOTREF(__pyx_t_2);
3377 __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__remove); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3378 __Pyx_GOTREF(__pyx_t_3);
3379 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3380 __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__stderr_f); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3381 __Pyx_GOTREF(__pyx_t_2);
3382 __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3383 __Pyx_GOTREF(__pyx_t_1);
3384 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
3385 __Pyx_GIVEREF(__pyx_t_2);
3387 __pyx_t_2 = PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3388 __Pyx_GOTREF(__pyx_t_2);
3389 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3390 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3391 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3396 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":191
3397 * lines = open( self.stderr_f, "r" ).readlines()
3398 * os.remove( self.stderr_f )
3399 * return lines # <<<<<<<<<<<<<<
3401 * def release(self):
3403 __Pyx_XDECREF(__pyx_r);
3404 __Pyx_INCREF(__pyx_v_lines);
3405 __pyx_r = __pyx_v_lines;
3408 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3411 __Pyx_XDECREF(__pyx_t_1);
3412 __Pyx_XDECREF(__pyx_t_2);
3413 __Pyx_XDECREF(__pyx_t_3);
3414 __Pyx_AddTraceback("csamtools.StderrStore.readAndRelease");
3417 __Pyx_DECREF(__pyx_v_lines);
3418 __Pyx_XGIVEREF(__pyx_r);
3419 __Pyx_TraceReturn(__pyx_r);
3420 __Pyx_RefNannyFinishContext();
3424 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":193
3427 * def release(self): # <<<<<<<<<<<<<<
3429 * self.stderr_save.restore()
3432 static PyObject *__pyx_pf_9csamtools_11StderrStore_release(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
3433 static char __pyx_doc_9csamtools_11StderrStore_release[] = "StderrStore.release(self)";
3434 static PyMethodDef __pyx_mdef_9csamtools_11StderrStore_release = {__Pyx_NAMESTR("release"), (PyCFunction)__pyx_pf_9csamtools_11StderrStore_release, METH_O, __Pyx_DOCSTR(__pyx_doc_9csamtools_11StderrStore_release)};
3435 static PyObject *__pyx_pf_9csamtools_11StderrStore_release(PyObject *__pyx_self, PyObject *__pyx_v_self) {
3436 PyObject *__pyx_r = NULL;
3437 PyObject *__pyx_t_1 = NULL;
3438 PyObject *__pyx_t_2 = NULL;
3439 PyObject *__pyx_t_3 = NULL;
3441 __Pyx_TraceDeclarations
3442 __Pyx_RefNannySetupContext("release");
3443 __Pyx_TraceCall("release", __pyx_f[0], 193);
3444 __pyx_self = __pyx_self;
3446 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":194
3448 * def release(self):
3449 * return # <<<<<<<<<<<<<<
3450 * self.stderr_save.restore()
3451 * if os.path.exists(self.stderr_f):
3453 __Pyx_XDECREF(__pyx_r);
3454 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3457 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":195
3458 * def release(self):
3460 * self.stderr_save.restore() # <<<<<<<<<<<<<<
3461 * if os.path.exists(self.stderr_f):
3462 * os.remove( self.stderr_f )
3464 __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__stderr_save); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3465 __Pyx_GOTREF(__pyx_t_1);
3466 __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__restore); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3467 __Pyx_GOTREF(__pyx_t_2);
3468 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3469 __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 = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3470 __Pyx_GOTREF(__pyx_t_1);
3471 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3472 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3474 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":196
3476 * self.stderr_save.restore()
3477 * if os.path.exists(self.stderr_f): # <<<<<<<<<<<<<<
3478 * os.remove( self.stderr_f )
3481 __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__os); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3482 __Pyx_GOTREF(__pyx_t_1);
3483 __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__path); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3484 __Pyx_GOTREF(__pyx_t_2);
3485 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3486 __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__exists); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3487 __Pyx_GOTREF(__pyx_t_1);
3488 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3489 __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__stderr_f); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3490 __Pyx_GOTREF(__pyx_t_2);
3491 __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3492 __Pyx_GOTREF(__pyx_t_3);
3493 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
3494 __Pyx_GIVEREF(__pyx_t_2);
3496 __pyx_t_2 = PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3497 __Pyx_GOTREF(__pyx_t_2);
3498 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3499 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3500 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3501 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3504 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":197
3505 * self.stderr_save.restore()
3506 * if os.path.exists(self.stderr_f):
3507 * os.remove( self.stderr_f ) # <<<<<<<<<<<<<<
3509 * def __del__(self):
3511 __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__os); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3512 __Pyx_GOTREF(__pyx_t_2);
3513 __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__remove); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3514 __Pyx_GOTREF(__pyx_t_3);
3515 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3516 __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__stderr_f); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3517 __Pyx_GOTREF(__pyx_t_2);
3518 __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3519 __Pyx_GOTREF(__pyx_t_1);
3520 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
3521 __Pyx_GIVEREF(__pyx_t_2);
3523 __pyx_t_2 = PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3524 __Pyx_GOTREF(__pyx_t_2);
3525 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3526 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3527 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3532 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3535 __Pyx_XDECREF(__pyx_t_1);
3536 __Pyx_XDECREF(__pyx_t_2);
3537 __Pyx_XDECREF(__pyx_t_3);
3538 __Pyx_AddTraceback("csamtools.StderrStore.release");
3541 __Pyx_XGIVEREF(__pyx_r);
3542 __Pyx_TraceReturn(__pyx_r);
3543 __Pyx_RefNannyFinishContext();
3547 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":199
3548 * os.remove( self.stderr_f )
3550 * def __del__(self): # <<<<<<<<<<<<<<
3555 static PyObject *__pyx_pf_9csamtools_11StderrStore___del__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
3556 static char __pyx_doc_9csamtools_11StderrStore___del__[] = "StderrStore.__del__(self)";
3557 static PyMethodDef __pyx_mdef_9csamtools_11StderrStore___del__ = {__Pyx_NAMESTR("__del__"), (PyCFunction)__pyx_pf_9csamtools_11StderrStore___del__, METH_O, __Pyx_DOCSTR(__pyx_doc_9csamtools_11StderrStore___del__)};
3558 static PyObject *__pyx_pf_9csamtools_11StderrStore___del__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
3559 PyObject *__pyx_r = NULL;
3560 PyObject *__pyx_t_1 = NULL;
3561 PyObject *__pyx_t_2 = NULL;
3562 __Pyx_TraceDeclarations
3563 __Pyx_RefNannySetupContext("__del__");
3564 __Pyx_TraceCall("__del__", __pyx_f[0], 199);
3565 __pyx_self = __pyx_self;
3567 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":200
3569 * def __del__(self):
3570 * self.release() # <<<<<<<<<<<<<<
3572 * class StderrStoreWindows():
3574 __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__release); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3575 __Pyx_GOTREF(__pyx_t_1);
3576 __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 = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3577 __Pyx_GOTREF(__pyx_t_2);
3578 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3579 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3581 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3584 __Pyx_XDECREF(__pyx_t_1);
3585 __Pyx_XDECREF(__pyx_t_2);
3586 __Pyx_AddTraceback("csamtools.StderrStore.__del__");
3589 __Pyx_XGIVEREF(__pyx_r);
3590 __Pyx_TraceReturn(__pyx_r);
3591 __Pyx_RefNannyFinishContext();
3595 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":204
3596 * class StderrStoreWindows():
3597 * '''does nothing. stderr can't be redirected on windows'''
3598 * def __init__(self): pass # <<<<<<<<<<<<<<
3599 * def readAndRelease(self): return []
3600 * def release(self): pass
3603 static PyObject *__pyx_pf_9csamtools_18StderrStoreWindows___init__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
3604 static char __pyx_doc_9csamtools_18StderrStoreWindows___init__[] = "StderrStoreWindows.__init__(self)";
3605 static PyMethodDef __pyx_mdef_9csamtools_18StderrStoreWindows___init__ = {__Pyx_NAMESTR("__init__"), (PyCFunction)__pyx_pf_9csamtools_18StderrStoreWindows___init__, METH_O, __Pyx_DOCSTR(__pyx_doc_9csamtools_18StderrStoreWindows___init__)};
3606 static PyObject *__pyx_pf_9csamtools_18StderrStoreWindows___init__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
3607 PyObject *__pyx_r = NULL;
3608 __Pyx_TraceDeclarations
3609 __Pyx_RefNannySetupContext("__init__");
3610 __Pyx_TraceCall("__init__", __pyx_f[0], 204);
3611 __pyx_self = __pyx_self;
3613 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3614 __Pyx_XGIVEREF(__pyx_r);
3615 __Pyx_TraceReturn(__pyx_r);
3616 __Pyx_RefNannyFinishContext();
3620 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":205
3621 * '''does nothing. stderr can't be redirected on windows'''
3622 * def __init__(self): pass
3623 * def readAndRelease(self): return [] # <<<<<<<<<<<<<<
3624 * def release(self): pass
3628 static PyObject *__pyx_pf_9csamtools_18StderrStoreWindows_readAndRelease(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
3629 static char __pyx_doc_9csamtools_18StderrStoreWindows_readAndRelease[] = "StderrStoreWindows.readAndRelease(self)";
3630 static PyMethodDef __pyx_mdef_9csamtools_18StderrStoreWindows_readAndRelease = {__Pyx_NAMESTR("readAndRelease"), (PyCFunction)__pyx_pf_9csamtools_18StderrStoreWindows_readAndRelease, METH_O, __Pyx_DOCSTR(__pyx_doc_9csamtools_18StderrStoreWindows_readAndRelease)};
3631 static PyObject *__pyx_pf_9csamtools_18StderrStoreWindows_readAndRelease(PyObject *__pyx_self, PyObject *__pyx_v_self) {
3632 PyObject *__pyx_r = NULL;
3633 PyObject *__pyx_t_1 = NULL;
3634 __Pyx_TraceDeclarations
3635 __Pyx_RefNannySetupContext("readAndRelease");
3636 __Pyx_TraceCall("readAndRelease", __pyx_f[0], 205);
3637 __pyx_self = __pyx_self;
3638 __Pyx_XDECREF(__pyx_r);
3639 __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3640 __Pyx_GOTREF(((PyObject *)__pyx_t_1));
3641 __pyx_r = ((PyObject *)__pyx_t_1);
3645 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3648 __Pyx_XDECREF(__pyx_t_1);
3649 __Pyx_AddTraceback("csamtools.StderrStoreWindows.readAndRelease");
3652 __Pyx_XGIVEREF(__pyx_r);
3653 __Pyx_TraceReturn(__pyx_r);
3654 __Pyx_RefNannyFinishContext();
3658 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":206
3659 * def __init__(self): pass
3660 * def readAndRelease(self): return []
3661 * def release(self): pass # <<<<<<<<<<<<<<
3663 * if platform.system()=='Windows':
3666 static PyObject *__pyx_pf_9csamtools_18StderrStoreWindows_release(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
3667 static char __pyx_doc_9csamtools_18StderrStoreWindows_release[] = "StderrStoreWindows.release(self)";
3668 static PyMethodDef __pyx_mdef_9csamtools_18StderrStoreWindows_release = {__Pyx_NAMESTR("release"), (PyCFunction)__pyx_pf_9csamtools_18StderrStoreWindows_release, METH_O, __Pyx_DOCSTR(__pyx_doc_9csamtools_18StderrStoreWindows_release)};
3669 static PyObject *__pyx_pf_9csamtools_18StderrStoreWindows_release(PyObject *__pyx_self, PyObject *__pyx_v_self) {
3670 PyObject *__pyx_r = NULL;
3671 __Pyx_TraceDeclarations
3672 __Pyx_RefNannySetupContext("release");
3673 __Pyx_TraceCall("release", __pyx_f[0], 206);
3674 __pyx_self = __pyx_self;
3676 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3677 __Pyx_XGIVEREF(__pyx_r);
3678 __Pyx_TraceReturn(__pyx_r);
3679 __Pyx_RefNannyFinishContext();
3683 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":260
3684 * cdef faidx_t * fastafile
3686 * def __cinit__(self, *args, **kwargs ): # <<<<<<<<<<<<<<
3687 * self.fastafile = NULL
3688 * self._filename = NULL
3691 static int __pyx_pf_9csamtools_9Fastafile___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
3692 static int __pyx_pf_9csamtools_9Fastafile___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3693 PyObject *__pyx_v_args = 0;
3694 PyObject *__pyx_v_kwargs = 0;
3696 PyObject *__pyx_t_1 = NULL;
3697 PyObject *__pyx_t_2 = NULL;
3698 PyObject *__pyx_t_3 = NULL;
3699 __Pyx_TraceDeclarations
3700 __Pyx_RefNannySetupContext("__cinit__");
3701 __Pyx_TraceCall("__cinit__", __pyx_f[0], 260);
3702 if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 1))) return -1;
3703 __pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New();
3704 if (unlikely(!__pyx_v_kwargs)) return -1;
3705 __Pyx_GOTREF(__pyx_v_kwargs);
3706 __Pyx_INCREF(__pyx_args);
3707 __pyx_v_args = __pyx_args;
3709 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":261
3711 * def __cinit__(self, *args, **kwargs ):
3712 * self.fastafile = NULL # <<<<<<<<<<<<<<
3713 * self._filename = NULL
3714 * self._open( *args, **kwargs )
3716 ((struct __pyx_obj_9csamtools_Fastafile *)__pyx_v_self)->fastafile = NULL;
3718 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":262
3719 * def __cinit__(self, *args, **kwargs ):
3720 * self.fastafile = NULL
3721 * self._filename = NULL # <<<<<<<<<<<<<<
3722 * self._open( *args, **kwargs )
3725 ((struct __pyx_obj_9csamtools_Fastafile *)__pyx_v_self)->_filename = NULL;
3727 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":263
3728 * self.fastafile = NULL
3729 * self._filename = NULL
3730 * self._open( *args, **kwargs ) # <<<<<<<<<<<<<<
3732 * def _isOpen( self ):
3734 __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___open); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3735 __Pyx_GOTREF(__pyx_t_1);
3736 __pyx_t_2 = PySequence_Tuple(((PyObject *)__pyx_v_args)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3737 __Pyx_GOTREF(((PyObject *)__pyx_t_2));
3738 __pyx_t_3 = PyEval_CallObjectWithKeywords(__pyx_t_1, ((PyObject *)__pyx_t_2), ((PyObject *)__pyx_v_kwargs)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3739 __Pyx_GOTREF(__pyx_t_3);
3740 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3741 __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
3742 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3747 __Pyx_XDECREF(__pyx_t_1);
3748 __Pyx_XDECREF(__pyx_t_2);
3749 __Pyx_XDECREF(__pyx_t_3);
3750 __Pyx_AddTraceback("csamtools.Fastafile.__cinit__");
3753 __Pyx_DECREF(__pyx_v_args);
3754 __Pyx_DECREF(__pyx_v_kwargs);
3755 __Pyx_TraceReturn(Py_None);
3756 __Pyx_RefNannyFinishContext();
3760 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":265
3761 * self._open( *args, **kwargs )
3763 * def _isOpen( self ): # <<<<<<<<<<<<<<
3764 * '''return true if samfile has been opened.'''
3765 * return self.fastafile != NULL
3768 static PyObject *__pyx_pf_9csamtools_9Fastafile__isOpen(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
3769 static char __pyx_doc_9csamtools_9Fastafile__isOpen[] = "Fastafile._isOpen(self)\nreturn true if samfile has been opened.";
3770 static PyObject *__pyx_pf_9csamtools_9Fastafile__isOpen(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
3771 PyObject *__pyx_r = NULL;
3772 PyObject *__pyx_t_1 = NULL;
3773 __Pyx_TraceDeclarations
3774 __Pyx_RefNannySetupContext("_isOpen");
3775 __Pyx_TraceCall("_isOpen", __pyx_f[0], 265);
3777 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":267
3778 * def _isOpen( self ):
3779 * '''return true if samfile has been opened.'''
3780 * return self.fastafile != NULL # <<<<<<<<<<<<<<
3782 * def __len__(self):
3784 __Pyx_XDECREF(__pyx_r);
3785 __pyx_t_1 = __Pyx_PyBool_FromLong((((struct __pyx_obj_9csamtools_Fastafile *)__pyx_v_self)->fastafile != NULL)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3786 __Pyx_GOTREF(__pyx_t_1);
3787 __pyx_r = __pyx_t_1;
3791 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3794 __Pyx_XDECREF(__pyx_t_1);
3795 __Pyx_AddTraceback("csamtools.Fastafile._isOpen");
3798 __Pyx_XGIVEREF(__pyx_r);
3799 __Pyx_TraceReturn(__pyx_r);
3800 __Pyx_RefNannyFinishContext();
3804 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":269
3805 * return self.fastafile != NULL
3807 * def __len__(self): # <<<<<<<<<<<<<<
3808 * if self.fastafile == NULL:
3809 * raise ValueError( "calling len() on closed file" )
3812 static Py_ssize_t __pyx_pf_9csamtools_9Fastafile___len__(PyObject *__pyx_v_self); /*proto*/
3813 static Py_ssize_t __pyx_pf_9csamtools_9Fastafile___len__(PyObject *__pyx_v_self) {
3816 PyObject *__pyx_t_2 = NULL;
3817 PyObject *__pyx_t_3 = NULL;
3818 __Pyx_TraceDeclarations
3819 __Pyx_RefNannySetupContext("__len__");
3820 __Pyx_TraceCall("__len__", __pyx_f[0], 269);
3822 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":270
3824 * def __len__(self):
3825 * if self.fastafile == NULL: # <<<<<<<<<<<<<<
3826 * raise ValueError( "calling len() on closed file" )
3829 __pyx_t_1 = (((struct __pyx_obj_9csamtools_Fastafile *)__pyx_v_self)->fastafile == NULL);
3832 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":271
3833 * def __len__(self):
3834 * if self.fastafile == NULL:
3835 * raise ValueError( "calling len() on closed file" ) # <<<<<<<<<<<<<<
3837 * return faidx_fetch_nseq(self.fastafile)
3839 __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3840 __Pyx_GOTREF(__pyx_t_2);
3841 __Pyx_INCREF(((PyObject *)__pyx_kp_s_3));
3842 PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_3));
3843 __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_3));
3844 __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3845 __Pyx_GOTREF(__pyx_t_3);
3846 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3847 __Pyx_Raise(__pyx_t_3, 0, 0);
3848 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3849 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3854 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":273
3855 * raise ValueError( "calling len() on closed file" )
3857 * return faidx_fetch_nseq(self.fastafile) # <<<<<<<<<<<<<<
3861 __pyx_r = faidx_fetch_nseq(((struct __pyx_obj_9csamtools_Fastafile *)__pyx_v_self)->fastafile);
3867 __Pyx_XDECREF(__pyx_t_2);
3868 __Pyx_XDECREF(__pyx_t_3);
3869 __Pyx_AddTraceback("csamtools.Fastafile.__len__");
3872 __Pyx_TraceReturn(Py_None);
3873 __Pyx_RefNannyFinishContext();
3877 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":275
3878 * return faidx_fetch_nseq(self.fastafile)
3880 * def _open( self, # <<<<<<<<<<<<<<
3881 * char * filename ):
3882 * '''open an indexed fasta file.
3885 static PyObject *__pyx_pf_9csamtools_9Fastafile__open(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename); /*proto*/
3886 static char __pyx_doc_9csamtools_9Fastafile__open[] = "Fastafile._open(self, char *filename)\nopen an indexed fasta file.\n\n This method expects an indexed fasta file.\n ";
3887 static PyObject *__pyx_pf_9csamtools_9Fastafile__open(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename) {
3888 char *__pyx_v_filename;
3889 PyObject *__pyx_r = NULL;
3891 PyObject *__pyx_t_2 = NULL;
3892 PyObject *__pyx_t_3 = NULL;
3893 __Pyx_TraceDeclarations
3894 __Pyx_RefNannySetupContext("_open");
3895 __Pyx_TraceCall("_open", __pyx_f[0], 275);
3896 assert(__pyx_arg_filename); {
3897 __pyx_v_filename = PyBytes_AsString(__pyx_arg_filename); if (unlikely((!__pyx_v_filename) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
3899 goto __pyx_L4_argument_unpacking_done;
3901 __Pyx_AddTraceback("csamtools.Fastafile._open");
3902 __Pyx_RefNannyFinishContext();
3904 __pyx_L4_argument_unpacking_done:;
3906 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":283
3908 * # close a previously opened file
3909 * if self.fastafile != NULL: self.close() # <<<<<<<<<<<<<<
3910 * if self._filename != NULL: free(self._filename)
3911 * self._filename = strdup(filename)
3913 __pyx_t_1 = (((struct __pyx_obj_9csamtools_Fastafile *)__pyx_v_self)->fastafile != NULL);
3915 __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__close); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3916 __Pyx_GOTREF(__pyx_t_2);
3917 __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 = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3918 __Pyx_GOTREF(__pyx_t_3);
3919 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3920 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3925 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":284
3926 * # close a previously opened file
3927 * if self.fastafile != NULL: self.close()
3928 * if self._filename != NULL: free(self._filename) # <<<<<<<<<<<<<<
3929 * self._filename = strdup(filename)
3930 * self.fastafile = fai_load( filename )
3932 __pyx_t_1 = (((struct __pyx_obj_9csamtools_Fastafile *)__pyx_v_self)->_filename != NULL);
3934 free(((struct __pyx_obj_9csamtools_Fastafile *)__pyx_v_self)->_filename);
3939 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":285
3940 * if self.fastafile != NULL: self.close()
3941 * if self._filename != NULL: free(self._filename)
3942 * self._filename = strdup(filename) # <<<<<<<<<<<<<<
3943 * self.fastafile = fai_load( filename )
3946 ((struct __pyx_obj_9csamtools_Fastafile *)__pyx_v_self)->_filename = strdup(__pyx_v_filename);
3948 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":286
3949 * if self._filename != NULL: free(self._filename)
3950 * self._filename = strdup(filename)
3951 * self.fastafile = fai_load( filename ) # <<<<<<<<<<<<<<
3953 * if self.fastafile == NULL:
3955 ((struct __pyx_obj_9csamtools_Fastafile *)__pyx_v_self)->fastafile = fai_load(__pyx_v_filename);
3957 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":288
3958 * self.fastafile = fai_load( filename )
3960 * if self.fastafile == NULL: # <<<<<<<<<<<<<<
3961 * raise IOError("could not open file `%s`" % filename )
3964 __pyx_t_1 = (((struct __pyx_obj_9csamtools_Fastafile *)__pyx_v_self)->fastafile == NULL);
3967 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":289
3969 * if self.fastafile == NULL:
3970 * raise IOError("could not open file `%s`" % filename ) # <<<<<<<<<<<<<<
3972 * def close( self ):
3974 __pyx_t_3 = PyBytes_FromString(__pyx_v_filename); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3975 __Pyx_GOTREF(((PyObject *)__pyx_t_3));
3976 __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_4), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3977 __Pyx_GOTREF(((PyObject *)__pyx_t_2));
3978 __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
3979 __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3980 __Pyx_GOTREF(__pyx_t_3);
3981 PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_2));
3982 __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
3984 __pyx_t_2 = PyObject_Call(__pyx_builtin_IOError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3985 __Pyx_GOTREF(__pyx_t_2);
3986 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3987 __Pyx_Raise(__pyx_t_2, 0, 0);
3988 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3989 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3994 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3997 __Pyx_XDECREF(__pyx_t_2);
3998 __Pyx_XDECREF(__pyx_t_3);
3999 __Pyx_AddTraceback("csamtools.Fastafile._open");
4002 __Pyx_XGIVEREF(__pyx_r);
4003 __Pyx_TraceReturn(__pyx_r);
4004 __Pyx_RefNannyFinishContext();
4008 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":291
4009 * raise IOError("could not open file `%s`" % filename )
4011 * def close( self ): # <<<<<<<<<<<<<<
4012 * if self.fastafile != NULL:
4013 * fai_destroy( self.fastafile )
4016 static PyObject *__pyx_pf_9csamtools_9Fastafile_close(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
4017 static char __pyx_doc_9csamtools_9Fastafile_close[] = "Fastafile.close(self)";
4018 static PyObject *__pyx_pf_9csamtools_9Fastafile_close(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
4019 PyObject *__pyx_r = NULL;
4021 __Pyx_TraceDeclarations
4022 __Pyx_RefNannySetupContext("close");
4023 __Pyx_TraceCall("close", __pyx_f[0], 291);
4025 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":292
4027 * def close( self ):
4028 * if self.fastafile != NULL: # <<<<<<<<<<<<<<
4029 * fai_destroy( self.fastafile )
4030 * self.fastafile = NULL
4032 __pyx_t_1 = (((struct __pyx_obj_9csamtools_Fastafile *)__pyx_v_self)->fastafile != NULL);
4035 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":293
4036 * def close( self ):
4037 * if self.fastafile != NULL:
4038 * fai_destroy( self.fastafile ) # <<<<<<<<<<<<<<
4039 * self.fastafile = NULL
4042 fai_destroy(((struct __pyx_obj_9csamtools_Fastafile *)__pyx_v_self)->fastafile);
4044 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":294
4045 * if self.fastafile != NULL:
4046 * fai_destroy( self.fastafile )
4047 * self.fastafile = NULL # <<<<<<<<<<<<<<
4049 * def __dealloc__(self):
4051 ((struct __pyx_obj_9csamtools_Fastafile *)__pyx_v_self)->fastafile = NULL;
4056 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4057 __Pyx_XGIVEREF(__pyx_r);
4058 __Pyx_TraceReturn(__pyx_r);
4059 __Pyx_RefNannyFinishContext();
4063 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":296
4064 * self.fastafile = NULL
4066 * def __dealloc__(self): # <<<<<<<<<<<<<<
4068 * if self._filename != NULL: free(self._filename)
4071 static void __pyx_pf_9csamtools_9Fastafile___dealloc__(PyObject *__pyx_v_self); /*proto*/
4072 static void __pyx_pf_9csamtools_9Fastafile___dealloc__(PyObject *__pyx_v_self) {
4073 PyObject *__pyx_t_1 = NULL;
4074 PyObject *__pyx_t_2 = NULL;
4076 __Pyx_TraceDeclarations
4077 __Pyx_RefNannySetupContext("__dealloc__");
4078 __Pyx_TraceCall("__dealloc__", __pyx_f[0], 296);
4080 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":297
4082 * def __dealloc__(self):
4083 * self.close() # <<<<<<<<<<<<<<
4084 * if self._filename != NULL: free(self._filename)
4087 __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__close); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4088 __Pyx_GOTREF(__pyx_t_1);
4089 __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 = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4090 __Pyx_GOTREF(__pyx_t_2);
4091 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4092 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4094 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":298
4095 * def __dealloc__(self):
4097 * if self._filename != NULL: free(self._filename) # <<<<<<<<<<<<<<
4099 * property filename:
4101 __pyx_t_3 = (((struct __pyx_obj_9csamtools_Fastafile *)__pyx_v_self)->_filename != NULL);
4103 free(((struct __pyx_obj_9csamtools_Fastafile *)__pyx_v_self)->_filename);
4110 __Pyx_XDECREF(__pyx_t_1);
4111 __Pyx_XDECREF(__pyx_t_2);
4112 __Pyx_AddTraceback("csamtools.Fastafile.__dealloc__");
4114 __Pyx_TraceReturn(Py_None);
4115 __Pyx_RefNannyFinishContext();
4118 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":302
4119 * property filename:
4120 * '''number of :term:`filename` associated with this object.'''
4121 * def __get__(self): # <<<<<<<<<<<<<<
4122 * if not self._isOpen(): raise ValueError( "I/O operation on closed file" )
4123 * return self._filename
4126 static PyObject *__pyx_pf_9csamtools_9Fastafile_8filename___get__(PyObject *__pyx_v_self); /*proto*/
4127 static PyObject *__pyx_pf_9csamtools_9Fastafile_8filename___get__(PyObject *__pyx_v_self) {
4128 PyObject *__pyx_r = NULL;
4129 PyObject *__pyx_t_1 = NULL;
4130 PyObject *__pyx_t_2 = NULL;
4133 __Pyx_TraceDeclarations
4134 __Pyx_RefNannySetupContext("__get__");
4135 __Pyx_TraceCall("__get__", __pyx_f[0], 302);
4137 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":303
4138 * '''number of :term:`filename` associated with this object.'''
4139 * def __get__(self):
4140 * if not self._isOpen(): raise ValueError( "I/O operation on closed file" ) # <<<<<<<<<<<<<<
4141 * return self._filename
4144 __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___isOpen); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4145 __Pyx_GOTREF(__pyx_t_1);
4146 __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 = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4147 __Pyx_GOTREF(__pyx_t_2);
4148 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4149 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4150 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4151 __pyx_t_4 = (!__pyx_t_3);
4153 __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4154 __Pyx_GOTREF(__pyx_t_2);
4155 __Pyx_INCREF(((PyObject *)__pyx_kp_s_5));
4156 PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_5));
4157 __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_5));
4158 __pyx_t_1 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4159 __Pyx_GOTREF(__pyx_t_1);
4160 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4161 __Pyx_Raise(__pyx_t_1, 0, 0);
4162 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4163 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4168 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":304
4169 * def __get__(self):
4170 * if not self._isOpen(): raise ValueError( "I/O operation on closed file" )
4171 * return self._filename # <<<<<<<<<<<<<<
4175 __Pyx_XDECREF(__pyx_r);
4176 __pyx_t_1 = PyBytes_FromString(((struct __pyx_obj_9csamtools_Fastafile *)__pyx_v_self)->_filename); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4177 __Pyx_GOTREF(((PyObject *)__pyx_t_1));
4178 __pyx_r = ((PyObject *)__pyx_t_1);
4182 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4185 __Pyx_XDECREF(__pyx_t_1);
4186 __Pyx_XDECREF(__pyx_t_2);
4187 __Pyx_AddTraceback("csamtools.Fastafile.filename.__get__");
4190 __Pyx_XGIVEREF(__pyx_r);
4191 __Pyx_TraceReturn(__pyx_r);
4192 __Pyx_RefNannyFinishContext();
4196 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":306
4197 * return self._filename
4199 * def fetch( self, # <<<<<<<<<<<<<<
4204 static PyObject *__pyx_pf_9csamtools_9Fastafile_fetch(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
4205 static char __pyx_doc_9csamtools_9Fastafile_fetch[] = "Fastafile.fetch(self, reference=None, start=None, end=None, region=None)\n*(reference = None, start = None, end = None, region = None)*\n \n fetch :meth:`AlignedRead` objects in a :term:`region` using 0-based indexing. \n \n The region is specified by :term:`reference`, *start* and *end*. \n \n fetch returns an empty string if the region is out of range or addresses an unknown *reference*.\n\n If *reference* is given and *start* is None, the sequence from the \n first base is returned. Similarly, if *end* is None, the sequence \n until the last base is returned.\n \n Alternatively, a samtools :term:`region` string can be supplied.\n ";
4206 static PyObject *__pyx_pf_9csamtools_9Fastafile_fetch(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4207 PyObject *__pyx_v_reference = 0;
4208 PyObject *__pyx_v_start = 0;
4209 PyObject *__pyx_v_end = 0;
4210 PyObject *__pyx_v_region = 0;
4213 PyObject *__pyx_v_py_seq;
4214 PyObject *__pyx_r = NULL;
4215 PyObject *__pyx_t_1 = NULL;
4216 PyObject *__pyx_t_2 = NULL;
4220 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__reference,&__pyx_n_s__start,&__pyx_n_s__end,&__pyx_n_s__region,0};
4221 __Pyx_TraceDeclarations
4222 __Pyx_RefNannySetupContext("fetch");
4223 __Pyx_TraceCall("fetch", __pyx_f[0], 306);
4224 if (unlikely(__pyx_kwds)) {
4225 Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
4226 PyObject* values[4] = {0,0,0,0};
4228 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":307
4231 * reference = None, # <<<<<<<<<<<<<<
4235 values[0] = ((PyObject *)Py_None);
4237 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":308
4240 * start = None, # <<<<<<<<<<<<<<
4244 values[1] = ((PyObject *)Py_None);
4246 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":309
4249 * end = None, # <<<<<<<<<<<<<<
4253 values[2] = ((PyObject *)Py_None);
4255 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":310
4258 * region = None): # <<<<<<<<<<<<<<
4260 * '''*(reference = None, start = None, end = None, region = None)*
4262 values[3] = ((PyObject *)Py_None);
4263 switch (PyTuple_GET_SIZE(__pyx_args)) {
4264 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4265 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4266 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4267 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4269 default: goto __pyx_L5_argtuple_error;
4271 switch (PyTuple_GET_SIZE(__pyx_args)) {
4274 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__reference);
4275 if (value) { values[0] = value; kw_args--; }
4279 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__start);
4280 if (value) { values[1] = value; kw_args--; }
4284 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__end);
4285 if (value) { values[2] = value; kw_args--; }
4289 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__region);
4290 if (value) { values[3] = value; kw_args--; }
4293 if (unlikely(kw_args > 0)) {
4294 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "fetch") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
4296 __pyx_v_reference = values[0];
4297 __pyx_v_start = values[1];
4298 __pyx_v_end = values[2];
4299 __pyx_v_region = values[3];
4302 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":307
4305 * reference = None, # <<<<<<<<<<<<<<
4309 __pyx_v_reference = ((PyObject *)Py_None);
4311 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":308
4314 * start = None, # <<<<<<<<<<<<<<
4318 __pyx_v_start = ((PyObject *)Py_None);
4320 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":309
4323 * end = None, # <<<<<<<<<<<<<<
4327 __pyx_v_end = ((PyObject *)Py_None);
4329 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":310
4332 * region = None): # <<<<<<<<<<<<<<
4334 * '''*(reference = None, start = None, end = None, region = None)*
4336 __pyx_v_region = ((PyObject *)Py_None);
4337 switch (PyTuple_GET_SIZE(__pyx_args)) {
4338 case 4: __pyx_v_region = PyTuple_GET_ITEM(__pyx_args, 3);
4339 case 3: __pyx_v_end = PyTuple_GET_ITEM(__pyx_args, 2);
4340 case 2: __pyx_v_start = PyTuple_GET_ITEM(__pyx_args, 1);
4341 case 1: __pyx_v_reference = PyTuple_GET_ITEM(__pyx_args, 0);
4343 default: goto __pyx_L5_argtuple_error;
4346 goto __pyx_L4_argument_unpacking_done;
4347 __pyx_L5_argtuple_error:;
4348 __Pyx_RaiseArgtupleInvalid("fetch", 0, 0, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
4350 __Pyx_AddTraceback("csamtools.Fastafile.fetch");
4351 __Pyx_RefNannyFinishContext();
4353 __pyx_L4_argument_unpacking_done:;
4354 __Pyx_INCREF(__pyx_v_start);
4355 __Pyx_INCREF(__pyx_v_end);
4356 __Pyx_INCREF(__pyx_v_region);
4357 __pyx_v_py_seq = Py_None; __Pyx_INCREF(Py_None);
4359 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":327
4362 * if not self._isOpen(): # <<<<<<<<<<<<<<
4363 * raise ValueError( "I/O operation on closed file" )
4366 __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___isOpen); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4367 __Pyx_GOTREF(__pyx_t_1);
4368 __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 = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4369 __Pyx_GOTREF(__pyx_t_2);
4370 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4371 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4372 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4373 __pyx_t_4 = (!__pyx_t_3);
4376 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":328
4378 * if not self._isOpen():
4379 * raise ValueError( "I/O operation on closed file" ) # <<<<<<<<<<<<<<
4383 __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4384 __Pyx_GOTREF(__pyx_t_2);
4385 __Pyx_INCREF(((PyObject *)__pyx_kp_s_5));
4386 PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_5));
4387 __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_5));
4388 __pyx_t_1 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4389 __Pyx_GOTREF(__pyx_t_1);
4390 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4391 __Pyx_Raise(__pyx_t_1, 0, 0);
4392 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4393 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4398 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":333
4401 * if not region: # <<<<<<<<<<<<<<
4402 * if reference is None: raise ValueError( 'no sequence/region supplied.' )
4403 * if start is None: start = 0
4405 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_region); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4406 __pyx_t_3 = (!__pyx_t_4);
4409 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":334
4412 * if reference is None: raise ValueError( 'no sequence/region supplied.' ) # <<<<<<<<<<<<<<
4413 * if start is None: start = 0
4414 * if end is None: end = max_pos -1
4416 __pyx_t_3 = (__pyx_v_reference == Py_None);
4418 __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4419 __Pyx_GOTREF(__pyx_t_1);
4420 __Pyx_INCREF(((PyObject *)__pyx_kp_s_6));
4421 PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_kp_s_6));
4422 __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_6));
4423 __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4424 __Pyx_GOTREF(__pyx_t_2);
4425 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4426 __Pyx_Raise(__pyx_t_2, 0, 0);
4427 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4428 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4433 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":335
4435 * if reference is None: raise ValueError( 'no sequence/region supplied.' )
4436 * if start is None: start = 0 # <<<<<<<<<<<<<<
4437 * if end is None: end = max_pos -1
4440 __pyx_t_3 = (__pyx_v_start == Py_None);
4442 __Pyx_INCREF(__pyx_int_0);
4443 __Pyx_DECREF(__pyx_v_start);
4444 __pyx_v_start = __pyx_int_0;
4449 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":336
4450 * if reference is None: raise ValueError( 'no sequence/region supplied.' )
4451 * if start is None: start = 0
4452 * if end is None: end = max_pos -1 # <<<<<<<<<<<<<<
4454 * if start > end: raise ValueError( 'invalid region: start (%i) > end (%i)' % (start, end) )
4456 __pyx_t_3 = (__pyx_v_end == Py_None);
4458 __pyx_t_2 = PyInt_FromLong((__pyx_v_9csamtools_max_pos - 1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4459 __Pyx_GOTREF(__pyx_t_2);
4460 __Pyx_DECREF(__pyx_v_end);
4461 __pyx_v_end = __pyx_t_2;
4467 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":338
4468 * if end is None: end = max_pos -1
4470 * if start > end: raise ValueError( 'invalid region: start (%i) > end (%i)' % (start, end) ) # <<<<<<<<<<<<<<
4471 * if start == end: return ""
4472 * # valid ranges are from 0 to 2^29-1
4474 __pyx_t_2 = PyObject_RichCompare(__pyx_v_start, __pyx_v_end, Py_GT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4475 __Pyx_GOTREF(__pyx_t_2);
4476 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4477 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4479 __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4480 __Pyx_GOTREF(__pyx_t_2);
4481 __Pyx_INCREF(__pyx_v_start);
4482 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_start);
4483 __Pyx_GIVEREF(__pyx_v_start);
4484 __Pyx_INCREF(__pyx_v_end);
4485 PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_end);
4486 __Pyx_GIVEREF(__pyx_v_end);
4487 __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_7), __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4488 __Pyx_GOTREF(((PyObject *)__pyx_t_1));
4489 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4490 __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4491 __Pyx_GOTREF(__pyx_t_2);
4492 PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_1));
4493 __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
4495 __pyx_t_1 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4496 __Pyx_GOTREF(__pyx_t_1);
4497 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4498 __Pyx_Raise(__pyx_t_1, 0, 0);
4499 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4500 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4505 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":339
4507 * if start > end: raise ValueError( 'invalid region: start (%i) > end (%i)' % (start, end) )
4508 * if start == end: return "" # <<<<<<<<<<<<<<
4509 * # valid ranges are from 0 to 2^29-1
4510 * if not 0 <= start < max_pos: raise ValueError( 'start out of range (%i)' % start )
4512 __pyx_t_1 = PyObject_RichCompare(__pyx_v_start, __pyx_v_end, Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 339; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4513 __Pyx_GOTREF(__pyx_t_1);
4514 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 339; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4515 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4517 __Pyx_XDECREF(__pyx_r);
4518 __Pyx_INCREF(((PyObject *)__pyx_kp_s_8));
4519 __pyx_r = ((PyObject *)__pyx_kp_s_8);
4525 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":341
4526 * if start == end: return ""
4527 * # valid ranges are from 0 to 2^29-1
4528 * if not 0 <= start < max_pos: raise ValueError( 'start out of range (%i)' % start ) # <<<<<<<<<<<<<<
4529 * if not 0 <= end < max_pos: raise ValueError( 'end out of range (%i)' % end )
4530 * # note: faidx_fetch_seq has a bug such that out-of-range access
4532 __pyx_t_1 = PyObject_RichCompare(__pyx_int_0, __pyx_v_start, Py_LE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4533 __Pyx_GOTREF(__pyx_t_1);
4534 if (__Pyx_PyObject_IsTrue(__pyx_t_1)) {
4535 __Pyx_DECREF(__pyx_t_1);
4536 __pyx_t_2 = PyInt_FromLong(__pyx_v_9csamtools_max_pos); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4537 __Pyx_GOTREF(__pyx_t_2);
4538 __pyx_t_1 = PyObject_RichCompare(__pyx_v_start, __pyx_t_2, Py_LT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4539 __Pyx_GOTREF(__pyx_t_1);
4540 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4542 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4543 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4544 __pyx_t_4 = (!__pyx_t_3);
4546 __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_9), __pyx_v_start); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4547 __Pyx_GOTREF(((PyObject *)__pyx_t_1));
4548 __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;}
4549 __Pyx_GOTREF(__pyx_t_2);
4550 PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_1));
4551 __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
4553 __pyx_t_1 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4554 __Pyx_GOTREF(__pyx_t_1);
4555 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4556 __Pyx_Raise(__pyx_t_1, 0, 0);
4557 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4558 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4563 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":342
4564 * # valid ranges are from 0 to 2^29-1
4565 * if not 0 <= start < max_pos: raise ValueError( 'start out of range (%i)' % start )
4566 * if not 0 <= end < max_pos: raise ValueError( 'end out of range (%i)' % end ) # <<<<<<<<<<<<<<
4567 * # note: faidx_fetch_seq has a bug such that out-of-range access
4568 * # always returns the last residue. Hence do not use faidx_fetch_seq,
4570 __pyx_t_1 = PyObject_RichCompare(__pyx_int_0, __pyx_v_end, Py_LE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4571 __Pyx_GOTREF(__pyx_t_1);
4572 if (__Pyx_PyObject_IsTrue(__pyx_t_1)) {
4573 __Pyx_DECREF(__pyx_t_1);
4574 __pyx_t_2 = PyInt_FromLong(__pyx_v_9csamtools_max_pos); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4575 __Pyx_GOTREF(__pyx_t_2);
4576 __pyx_t_1 = PyObject_RichCompare(__pyx_v_end, __pyx_t_2, Py_LT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4577 __Pyx_GOTREF(__pyx_t_1);
4578 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4580 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4581 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4582 __pyx_t_3 = (!__pyx_t_4);
4584 __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_10), __pyx_v_end); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4585 __Pyx_GOTREF(((PyObject *)__pyx_t_1));
4586 __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4587 __Pyx_GOTREF(__pyx_t_2);
4588 PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_1));
4589 __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
4591 __pyx_t_1 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4592 __Pyx_GOTREF(__pyx_t_1);
4593 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4594 __Pyx_Raise(__pyx_t_1, 0, 0);
4595 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4596 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4601 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":351
4604 * region = "%s:%i-%i" % (reference, start+1, end) # <<<<<<<<<<<<<<
4605 * seq = fai_fetch( self.fastafile,
4608 __pyx_t_1 = PyNumber_Add(__pyx_v_start, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4609 __Pyx_GOTREF(__pyx_t_1);
4610 __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4611 __Pyx_GOTREF(__pyx_t_2);
4612 __Pyx_INCREF(__pyx_v_reference);
4613 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_reference);
4614 __Pyx_GIVEREF(__pyx_v_reference);
4615 PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
4616 __Pyx_GIVEREF(__pyx_t_1);
4617 __Pyx_INCREF(__pyx_v_end);
4618 PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_end);
4619 __Pyx_GIVEREF(__pyx_v_end);
4621 __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_11), __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4622 __Pyx_GOTREF(((PyObject *)__pyx_t_1));
4623 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4624 __Pyx_DECREF(__pyx_v_region);
4625 __pyx_v_region = ((PyObject *)__pyx_t_1);
4628 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":353
4629 * region = "%s:%i-%i" % (reference, start+1, end)
4630 * seq = fai_fetch( self.fastafile,
4631 * region, # <<<<<<<<<<<<<<
4635 __pyx_t_5 = PyBytes_AsString(__pyx_v_region); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4637 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":354
4638 * seq = fai_fetch( self.fastafile,
4640 * &length ) # <<<<<<<<<<<<<<
4642 * # samtools adds a '\0' at the end
4644 __pyx_v_seq = fai_fetch(((struct __pyx_obj_9csamtools_Fastafile *)__pyx_v_self)->fastafile, __pyx_t_5, (&__pyx_v_length));
4649 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":357
4651 * # samtools adds a '\0' at the end
4652 * seq = fai_fetch( self.fastafile, region, &length ) # <<<<<<<<<<<<<<
4656 __pyx_t_5 = PyBytes_AsString(__pyx_v_region); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4657 __pyx_v_seq = fai_fetch(((struct __pyx_obj_9csamtools_Fastafile *)__pyx_v_self)->fastafile, __pyx_t_5, (&__pyx_v_length));
4661 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":360
4664 * if seq == NULL: # <<<<<<<<<<<<<<
4668 __pyx_t_3 = (__pyx_v_seq == NULL);
4671 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":361
4674 * return "" # <<<<<<<<<<<<<<
4678 __Pyx_XDECREF(__pyx_r);
4679 __Pyx_INCREF(((PyObject *)__pyx_kp_s_8));
4680 __pyx_r = ((PyObject *)__pyx_kp_s_8);
4686 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":363
4689 * try: # <<<<<<<<<<<<<<
4690 * py_seq = PyString_FromStringAndSize(seq, length)
4695 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":364
4698 * py_seq = PyString_FromStringAndSize(seq, length) # <<<<<<<<<<<<<<
4702 __pyx_t_1 = PyString_FromStringAndSize(__pyx_v_seq, __pyx_v_length); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L17;}
4703 __Pyx_GOTREF(__pyx_t_1);
4704 __Pyx_DECREF(__pyx_v_py_seq);
4705 __pyx_v_py_seq = __pyx_t_1;
4709 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":366
4710 * py_seq = PyString_FromStringAndSize(seq, length)
4712 * free(seq) # <<<<<<<<<<<<<<
4718 PyObject *__pyx_exc_type, *__pyx_exc_value, *__pyx_exc_tb;
4719 int __pyx_exc_lineno;
4720 __pyx_exc_type = 0; __pyx_exc_value = 0; __pyx_exc_tb = 0; __pyx_exc_lineno = 0;
4721 __pyx_why = 0; goto __pyx_L18;
4724 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
4725 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
4726 __Pyx_ErrFetch(&__pyx_exc_type, &__pyx_exc_value, &__pyx_exc_tb);
4727 __pyx_exc_lineno = __pyx_lineno;
4732 switch (__pyx_why) {
4734 __Pyx_ErrRestore(__pyx_exc_type, __pyx_exc_value, __pyx_exc_tb);
4735 __pyx_lineno = __pyx_exc_lineno;
4737 __pyx_exc_value = 0;
4739 goto __pyx_L1_error;
4746 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":368
4749 * return py_seq # <<<<<<<<<<<<<<
4751 * cdef char * _fetch( self, char * reference, int start, int end, int * length ):
4753 __Pyx_XDECREF(__pyx_r);
4754 __Pyx_INCREF(__pyx_v_py_seq);
4755 __pyx_r = __pyx_v_py_seq;
4758 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4761 __Pyx_XDECREF(__pyx_t_1);
4762 __Pyx_XDECREF(__pyx_t_2);
4763 __Pyx_AddTraceback("csamtools.Fastafile.fetch");
4766 __Pyx_DECREF(__pyx_v_py_seq);
4767 __Pyx_DECREF(__pyx_v_start);
4768 __Pyx_DECREF(__pyx_v_end);
4769 __Pyx_DECREF(__pyx_v_region);
4770 __Pyx_XGIVEREF(__pyx_r);
4771 __Pyx_TraceReturn(__pyx_r);
4772 __Pyx_RefNannyFinishContext();
4776 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":370
4779 * cdef char * _fetch( self, char * reference, int start, int end, int * length ): # <<<<<<<<<<<<<<
4780 * '''fetch sequence for reference, start and end'''
4784 static char *__pyx_f_9csamtools_9Fastafile__fetch(struct __pyx_obj_9csamtools_Fastafile *__pyx_v_self, char *__pyx_v_reference, int __pyx_v_start, int __pyx_v_end, int *__pyx_v_length) {
4786 __Pyx_TraceDeclarations
4787 __Pyx_RefNannySetupContext("_fetch");
4788 __Pyx_TraceCall("_fetch", __pyx_f[0], 370);
4790 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":377
4793 * length ) # <<<<<<<<<<<<<<
4795 * #------------------------------------------------------------------------
4797 __pyx_r = faidx_fetch_seq(__pyx_v_self->fastafile, __pyx_v_reference, __pyx_v_start, (__pyx_v_end - 1), __pyx_v_length);
4802 __Pyx_TraceReturn(Py_None);
4803 __Pyx_RefNannyFinishContext();
4807 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":382
4808 * #------------------------------------------------------------------------
4809 * #------------------------------------------------------------------------
4810 * cdef int count_callback( bam1_t *alignment, void *f): # <<<<<<<<<<<<<<
4811 * '''callback for bam_fetch - count number of reads.
4815 static int __pyx_f_9csamtools_count_callback(bam1_t *__pyx_v_alignment, void *__pyx_v_f) {
4816 int *__pyx_v_counter;
4818 __Pyx_TraceDeclarations
4819 __Pyx_RefNannySetupContext("count_callback");
4820 __Pyx_TraceCall("count_callback", __pyx_f[0], 382);
4822 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":385
4823 * '''callback for bam_fetch - count number of reads.
4825 * cdef int* counter = (<int*>f) # <<<<<<<<<<<<<<
4829 __pyx_v_counter = ((int *)__pyx_v_f);
4831 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":386
4833 * cdef int* counter = (<int*>f)
4834 * counter[0] += 1; # <<<<<<<<<<<<<<
4836 * ctypedef struct MateData:
4838 (__pyx_v_counter[0]) += 1;
4841 __Pyx_TraceReturn(Py_None);
4842 __Pyx_RefNannyFinishContext();
4846 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":396
4847 * #------------------------------------------------------------------------
4848 * #------------------------------------------------------------------------
4849 * cdef int mate_callback( bam1_t *alignment, void *f): # <<<<<<<<<<<<<<
4850 * '''callback for bam_fetch = filter mate
4854 static int __pyx_f_9csamtools_mate_callback(bam1_t *__pyx_v_alignment, void *__pyx_v_f) {
4855 __pyx_t_9csamtools_MateData *__pyx_v_d;
4860 __Pyx_TraceDeclarations
4861 __Pyx_RefNannySetupContext("mate_callback");
4862 __Pyx_TraceCall("mate_callback", __pyx_f[0], 396);
4864 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":399
4865 * '''callback for bam_fetch = filter mate
4867 * cdef MateData * d = (<MateData*>f) # <<<<<<<<<<<<<<
4868 * # printf("mate = %p, name1 = %s, name2=%s\t%i\t%i\t%i\n",
4869 * # d.mate, d.name, bam1_qname(alignment),
4871 __pyx_v_d = ((__pyx_t_9csamtools_MateData *)__pyx_v_f);
4873 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":404
4874 * # d.flag, alignment.core.flag, alignment.core.flag & d.flag)
4876 * if d.mate == NULL: # <<<<<<<<<<<<<<
4877 * # could be sped up by comparing the lengths of query strings first
4880 __pyx_t_1 = (__pyx_v_d->mate == NULL);
4883 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":410
4884 * # also, make sure that we get the other read by comparing
4886 * if alignment.core.flag & d.flag != 0 and \ # <<<<<<<<<<<<<<
4887 * strcmp( bam1_qname( alignment ), d.name ) == 0:
4888 * d.mate = bam_dup1( alignment )
4890 __pyx_t_1 = ((__pyx_v_alignment->core.flag & __pyx_v_d->flag) != 0);
4893 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":411
4895 * if alignment.core.flag & d.flag != 0 and \
4896 * strcmp( bam1_qname( alignment ), d.name ) == 0: # <<<<<<<<<<<<<<
4897 * d.mate = bam_dup1( alignment )
4900 __pyx_t_2 = (strcmp(bam1_qname(__pyx_v_alignment), __pyx_v_d->name) == 0);
4901 __pyx_t_3 = __pyx_t_2;
4903 __pyx_t_3 = __pyx_t_1;
4907 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":412
4908 * if alignment.core.flag & d.flag != 0 and \
4909 * strcmp( bam1_qname( alignment ), d.name ) == 0:
4910 * d.mate = bam_dup1( alignment ) # <<<<<<<<<<<<<<
4914 __pyx_v_d->mate = bam_dup1(__pyx_v_alignment);
4923 __Pyx_TraceReturn(Py_None);
4924 __Pyx_RefNannyFinishContext();
4928 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":455
4931 * def __cinit__(self, *args, **kwargs ): # <<<<<<<<<<<<<<
4932 * self.samfile = NULL
4933 * self._filename = NULL
4936 static int __pyx_pf_9csamtools_7Samfile___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
4937 static int __pyx_pf_9csamtools_7Samfile___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4938 PyObject *__pyx_v_args = 0;
4939 PyObject *__pyx_v_kwargs = 0;
4941 PyObject *__pyx_t_1 = NULL;
4942 PyObject *__pyx_t_2 = NULL;
4943 PyObject *__pyx_t_3 = NULL;
4944 __Pyx_TraceDeclarations
4945 __Pyx_RefNannySetupContext("__cinit__");
4946 __Pyx_TraceCall("__cinit__", __pyx_f[0], 455);
4947 if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 1))) return -1;
4948 __pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New();
4949 if (unlikely(!__pyx_v_kwargs)) return -1;
4950 __Pyx_GOTREF(__pyx_v_kwargs);
4951 __Pyx_INCREF(__pyx_args);
4952 __pyx_v_args = __pyx_args;
4954 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":456
4956 * def __cinit__(self, *args, **kwargs ):
4957 * self.samfile = NULL # <<<<<<<<<<<<<<
4958 * self._filename = NULL
4959 * self.isbam = False
4961 ((struct __pyx_obj_9csamtools_Samfile *)__pyx_v_self)->samfile = NULL;
4963 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":457
4964 * def __cinit__(self, *args, **kwargs ):
4965 * self.samfile = NULL
4966 * self._filename = NULL # <<<<<<<<<<<<<<
4967 * self.isbam = False
4968 * self._open( *args, **kwargs )
4970 ((struct __pyx_obj_9csamtools_Samfile *)__pyx_v_self)->_filename = NULL;
4972 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":458
4973 * self.samfile = NULL
4974 * self._filename = NULL
4975 * self.isbam = False # <<<<<<<<<<<<<<
4976 * self._open( *args, **kwargs )
4979 ((struct __pyx_obj_9csamtools_Samfile *)__pyx_v_self)->isbam = 0;
4981 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":459
4982 * self._filename = NULL
4983 * self.isbam = False
4984 * self._open( *args, **kwargs ) # <<<<<<<<<<<<<<
4986 * # allocate memory for iterator
4988 __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___open); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4989 __Pyx_GOTREF(__pyx_t_1);
4990 __pyx_t_2 = PySequence_Tuple(((PyObject *)__pyx_v_args)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4991 __Pyx_GOTREF(((PyObject *)__pyx_t_2));
4992 __pyx_t_3 = PyEval_CallObjectWithKeywords(__pyx_t_1, ((PyObject *)__pyx_t_2), ((PyObject *)__pyx_v_kwargs)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4993 __Pyx_GOTREF(__pyx_t_3);
4994 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4995 __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
4996 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4998 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":462
5000 * # allocate memory for iterator
5001 * self.b = <bam1_t*>calloc(1, sizeof(bam1_t)) # <<<<<<<<<<<<<<
5003 * def _isOpen( self ):
5005 ((struct __pyx_obj_9csamtools_Samfile *)__pyx_v_self)->b = ((bam1_t *)calloc(1, (sizeof(bam1_t))));
5010 __Pyx_XDECREF(__pyx_t_1);
5011 __Pyx_XDECREF(__pyx_t_2);
5012 __Pyx_XDECREF(__pyx_t_3);
5013 __Pyx_AddTraceback("csamtools.Samfile.__cinit__");
5016 __Pyx_DECREF(__pyx_v_args);
5017 __Pyx_DECREF(__pyx_v_kwargs);
5018 __Pyx_TraceReturn(Py_None);
5019 __Pyx_RefNannyFinishContext();
5023 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":464
5024 * self.b = <bam1_t*>calloc(1, sizeof(bam1_t))
5026 * def _isOpen( self ): # <<<<<<<<<<<<<<
5027 * '''return true if samfile has been opened.'''
5028 * return self.samfile != NULL
5031 static PyObject *__pyx_pf_9csamtools_7Samfile__isOpen(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
5032 static char __pyx_doc_9csamtools_7Samfile__isOpen[] = "Samfile._isOpen(self)\nreturn true if samfile has been opened.";
5033 static PyObject *__pyx_pf_9csamtools_7Samfile__isOpen(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
5034 PyObject *__pyx_r = NULL;
5035 PyObject *__pyx_t_1 = NULL;
5036 __Pyx_TraceDeclarations
5037 __Pyx_RefNannySetupContext("_isOpen");
5038 __Pyx_TraceCall("_isOpen", __pyx_f[0], 464);
5040 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":466
5041 * def _isOpen( self ):
5042 * '''return true if samfile has been opened.'''
5043 * return self.samfile != NULL # <<<<<<<<<<<<<<
5045 * def _hasIndex( self ):
5047 __Pyx_XDECREF(__pyx_r);
5048 __pyx_t_1 = __Pyx_PyBool_FromLong((((struct __pyx_obj_9csamtools_Samfile *)__pyx_v_self)->samfile != NULL)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5049 __Pyx_GOTREF(__pyx_t_1);
5050 __pyx_r = __pyx_t_1;
5054 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5057 __Pyx_XDECREF(__pyx_t_1);
5058 __Pyx_AddTraceback("csamtools.Samfile._isOpen");
5061 __Pyx_XGIVEREF(__pyx_r);
5062 __Pyx_TraceReturn(__pyx_r);
5063 __Pyx_RefNannyFinishContext();
5067 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":468
5068 * return self.samfile != NULL
5070 * def _hasIndex( self ): # <<<<<<<<<<<<<<
5071 * '''return true if samfile has an existing (and opened) index.'''
5072 * return self.index != NULL
5075 static PyObject *__pyx_pf_9csamtools_7Samfile__hasIndex(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
5076 static char __pyx_doc_9csamtools_7Samfile__hasIndex[] = "Samfile._hasIndex(self)\nreturn true if samfile has an existing (and opened) index.";
5077 static PyObject *__pyx_pf_9csamtools_7Samfile__hasIndex(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
5078 PyObject *__pyx_r = NULL;
5079 PyObject *__pyx_t_1 = NULL;
5080 __Pyx_TraceDeclarations
5081 __Pyx_RefNannySetupContext("_hasIndex");
5082 __Pyx_TraceCall("_hasIndex", __pyx_f[0], 468);
5084 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":470
5085 * def _hasIndex( self ):
5086 * '''return true if samfile has an existing (and opened) index.'''
5087 * return self.index != NULL # <<<<<<<<<<<<<<
5091 __Pyx_XDECREF(__pyx_r);
5092 __pyx_t_1 = __Pyx_PyBool_FromLong((((struct __pyx_obj_9csamtools_Samfile *)__pyx_v_self)->index != NULL)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5093 __Pyx_GOTREF(__pyx_t_1);
5094 __pyx_r = __pyx_t_1;
5098 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5101 __Pyx_XDECREF(__pyx_t_1);
5102 __Pyx_AddTraceback("csamtools.Samfile._hasIndex");
5105 __Pyx_XGIVEREF(__pyx_r);
5106 __Pyx_TraceReturn(__pyx_r);
5107 __Pyx_RefNannyFinishContext();
5111 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":472
5112 * return self.index != NULL
5114 * def _open( self, # <<<<<<<<<<<<<<
5119 static PyObject *__pyx_pf_9csamtools_7Samfile__open(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
5120 static char __pyx_doc_9csamtools_7Samfile__open[] = "Samfile._open(self, char *filename, mode=None, Samfile template=None, referencenames=None, referencelengths=None, text=None, header=None, port=None)\nopen a sam/bam file.\n\n If _open is called on an existing bamfile, the current file will be\n closed and a new file will be opened.\n ";
5121 static PyObject *__pyx_pf_9csamtools_7Samfile__open(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5122 char *__pyx_v_filename;
5123 PyObject *__pyx_v_mode = 0;
5124 struct __pyx_obj_9csamtools_Samfile *__pyx_v_template = 0;
5125 PyObject *__pyx_v_referencenames = 0;
5126 PyObject *__pyx_v_referencelengths = 0;
5127 PyObject *__pyx_v_text = 0;
5128 PyObject *__pyx_v_header = 0;
5129 PyObject *__pyx_v_port = 0;
5130 PyObject *__pyx_v_msg;
5131 bam_header_t *__pyx_v_header_to_write;
5132 char *__pyx_v_ctext;
5133 PyObject *__pyx_v_n;
5134 PyObject *__pyx_v_x;
5135 PyObject *__pyx_v_name;
5136 PyObject *__pyx_v_store;
5137 PyObject *__pyx_r = NULL;
5139 PyObject *__pyx_t_2 = NULL;
5140 PyObject *__pyx_t_3 = NULL;
5141 PyObject *__pyx_t_4 = NULL;
5142 PyObject *__pyx_t_5 = NULL;
5146 Py_ssize_t __pyx_t_9;
5147 Py_ssize_t __pyx_t_10;
5151 uint32_t __pyx_t_14;
5154 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__filename,&__pyx_n_s__mode,&__pyx_n_s__template,&__pyx_n_s__referencenames,&__pyx_n_s__referencelengths,&__pyx_n_s__text,&__pyx_n_s__header,&__pyx_n_s__port,0};
5155 __Pyx_TraceDeclarations
5156 __Pyx_RefNannySetupContext("_open");
5157 __Pyx_TraceCall("_open", __pyx_f[0], 472);
5158 if (unlikely(__pyx_kwds)) {
5159 Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
5160 PyObject* values[8] = {0,0,0,0,0,0,0,0};
5162 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":474
5165 * mode = None, # <<<<<<<<<<<<<<
5166 * Samfile template = None,
5167 * referencenames = None,
5169 values[1] = ((PyObject *)Py_None);
5171 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":475
5174 * Samfile template = None, # <<<<<<<<<<<<<<
5175 * referencenames = None,
5176 * referencelengths = None,
5178 values[2] = (PyObject *)((struct __pyx_obj_9csamtools_Samfile *)Py_None);
5180 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":476
5182 * Samfile template = None,
5183 * referencenames = None, # <<<<<<<<<<<<<<
5184 * referencelengths = None,
5187 values[3] = ((PyObject *)Py_None);
5189 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":477
5190 * Samfile template = None,
5191 * referencenames = None,
5192 * referencelengths = None, # <<<<<<<<<<<<<<
5196 values[4] = ((PyObject *)Py_None);
5198 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":478
5199 * referencenames = None,
5200 * referencelengths = None,
5201 * text = None, # <<<<<<<<<<<<<<
5205 values[5] = ((PyObject *)Py_None);
5207 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":479
5208 * referencelengths = None,
5210 * header = None, # <<<<<<<<<<<<<<
5214 values[6] = ((PyObject *)Py_None);
5216 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":480
5219 * port = None, # <<<<<<<<<<<<<<
5221 * '''open a sam/bam file.
5223 values[7] = ((PyObject *)Py_None);
5224 switch (PyTuple_GET_SIZE(__pyx_args)) {
5225 case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
5226 case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
5227 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
5228 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5229 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5230 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5231 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5232 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5234 default: goto __pyx_L5_argtuple_error;
5236 switch (PyTuple_GET_SIZE(__pyx_args)) {
5238 values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__filename);
5239 if (likely(values[0])) kw_args--;
5240 else goto __pyx_L5_argtuple_error;
5243 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__mode);
5244 if (value) { values[1] = value; kw_args--; }
5248 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__template);
5249 if (value) { values[2] = value; kw_args--; }
5253 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__referencenames);
5254 if (value) { values[3] = value; kw_args--; }
5258 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__referencelengths);
5259 if (value) { values[4] = value; kw_args--; }
5263 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__text);
5264 if (value) { values[5] = value; kw_args--; }
5268 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__header);
5269 if (value) { values[6] = value; kw_args--; }
5273 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__port);
5274 if (value) { values[7] = value; kw_args--; }
5277 if (unlikely(kw_args > 0)) {
5278 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "_open") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
5280 __pyx_v_filename = PyBytes_AsString(values[0]); if (unlikely((!__pyx_v_filename) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
5281 __pyx_v_mode = values[1];
5282 __pyx_v_template = ((struct __pyx_obj_9csamtools_Samfile *)values[2]);
5283 __pyx_v_referencenames = values[3];
5284 __pyx_v_referencelengths = values[4];
5285 __pyx_v_text = values[5];
5286 __pyx_v_header = values[6];
5287 __pyx_v_port = values[7];
5290 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":474
5293 * mode = None, # <<<<<<<<<<<<<<
5294 * Samfile template = None,
5295 * referencenames = None,
5297 __pyx_v_mode = ((PyObject *)Py_None);
5299 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":475
5302 * Samfile template = None, # <<<<<<<<<<<<<<
5303 * referencenames = None,
5304 * referencelengths = None,
5306 __pyx_v_template = ((struct __pyx_obj_9csamtools_Samfile *)Py_None);
5308 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":476
5310 * Samfile template = None,
5311 * referencenames = None, # <<<<<<<<<<<<<<
5312 * referencelengths = None,
5315 __pyx_v_referencenames = ((PyObject *)Py_None);
5317 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":477
5318 * Samfile template = None,
5319 * referencenames = None,
5320 * referencelengths = None, # <<<<<<<<<<<<<<
5324 __pyx_v_referencelengths = ((PyObject *)Py_None);
5326 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":478
5327 * referencenames = None,
5328 * referencelengths = None,
5329 * text = None, # <<<<<<<<<<<<<<
5333 __pyx_v_text = ((PyObject *)Py_None);
5335 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":479
5336 * referencelengths = None,
5338 * header = None, # <<<<<<<<<<<<<<
5342 __pyx_v_header = ((PyObject *)Py_None);
5344 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":480
5347 * port = None, # <<<<<<<<<<<<<<
5349 * '''open a sam/bam file.
5351 __pyx_v_port = ((PyObject *)Py_None);
5352 switch (PyTuple_GET_SIZE(__pyx_args)) {
5353 case 8: __pyx_v_port = PyTuple_GET_ITEM(__pyx_args, 7);
5354 case 7: __pyx_v_header = PyTuple_GET_ITEM(__pyx_args, 6);
5355 case 6: __pyx_v_text = PyTuple_GET_ITEM(__pyx_args, 5);
5356 case 5: __pyx_v_referencelengths = PyTuple_GET_ITEM(__pyx_args, 4);
5357 case 4: __pyx_v_referencenames = PyTuple_GET_ITEM(__pyx_args, 3);
5358 case 3: __pyx_v_template = ((struct __pyx_obj_9csamtools_Samfile *)PyTuple_GET_ITEM(__pyx_args, 2));
5359 case 2: __pyx_v_mode = PyTuple_GET_ITEM(__pyx_args, 1);
5360 case 1: __pyx_v_filename = PyBytes_AsString(PyTuple_GET_ITEM(__pyx_args, 0)); if (unlikely((!__pyx_v_filename) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
5362 default: goto __pyx_L5_argtuple_error;
5365 goto __pyx_L4_argument_unpacking_done;
5366 __pyx_L5_argtuple_error:;
5367 __Pyx_RaiseArgtupleInvalid("_open", 0, 1, 8, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
5369 __Pyx_AddTraceback("csamtools.Samfile._open");
5370 __Pyx_RefNannyFinishContext();
5372 __pyx_L4_argument_unpacking_done:;
5373 __pyx_v_msg = Py_None; __Pyx_INCREF(Py_None);
5374 __pyx_v_n = Py_None; __Pyx_INCREF(Py_None);
5375 __pyx_v_x = Py_None; __Pyx_INCREF(Py_None);
5376 __pyx_v_name = Py_None; __Pyx_INCREF(Py_None);
5377 __pyx_v_store = Py_None; __Pyx_INCREF(Py_None);
5378 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_template), __pyx_ptype_9csamtools_Samfile, 1, "template", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5380 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":489
5382 * # read mode autodetection
5383 * if mode is None: # <<<<<<<<<<<<<<
5385 * self._open(filename, 'r', template=template,
5387 __pyx_t_1 = (__pyx_v_mode == Py_None);
5390 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":490
5391 * # read mode autodetection
5393 * try: # <<<<<<<<<<<<<<
5394 * self._open(filename, 'r', template=template,
5395 * referencenames=referencenames,
5398 PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb;
5399 __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb);
5400 __Pyx_XGOTREF(__pyx_save_exc_type);
5401 __Pyx_XGOTREF(__pyx_save_exc_value);
5402 __Pyx_XGOTREF(__pyx_save_exc_tb);
5405 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":491
5408 * self._open(filename, 'r', template=template, # <<<<<<<<<<<<<<
5409 * referencenames=referencenames,
5410 * referencelengths=referencelengths,
5412 __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___open); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
5413 __Pyx_GOTREF(__pyx_t_2);
5414 __pyx_t_3 = PyBytes_FromString(__pyx_v_filename); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
5415 __Pyx_GOTREF(((PyObject *)__pyx_t_3));
5416 __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
5417 __Pyx_GOTREF(__pyx_t_4);
5418 PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_3));
5419 __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
5420 __Pyx_INCREF(((PyObject *)__pyx_n_s__r));
5421 PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_n_s__r));
5422 __Pyx_GIVEREF(((PyObject *)__pyx_n_s__r));
5424 __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
5425 __Pyx_GOTREF(((PyObject *)__pyx_t_3));
5426 if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__template), ((PyObject *)__pyx_v_template)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
5428 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":492
5430 * self._open(filename, 'r', template=template,
5431 * referencenames=referencenames, # <<<<<<<<<<<<<<
5432 * referencelengths=referencelengths,
5433 * text=text, header=header, port=port)
5435 if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__referencenames), __pyx_v_referencenames) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
5437 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":493
5438 * self._open(filename, 'r', template=template,
5439 * referencenames=referencenames,
5440 * referencelengths=referencelengths, # <<<<<<<<<<<<<<
5441 * text=text, header=header, port=port)
5444 if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__referencelengths), __pyx_v_referencelengths) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
5446 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":494
5447 * referencenames=referencenames,
5448 * referencelengths=referencelengths,
5449 * text=text, header=header, port=port) # <<<<<<<<<<<<<<
5451 * except ValueError, msg:
5453 if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__text), __pyx_v_text) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
5454 if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__header), __pyx_v_header) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
5455 if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__port), __pyx_v_port) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
5456 __pyx_t_5 = PyEval_CallObjectWithKeywords(__pyx_t_2, __pyx_t_4, ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
5457 __Pyx_GOTREF(__pyx_t_5);
5458 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5459 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5460 __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
5461 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5463 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":495
5464 * referencelengths=referencelengths,
5465 * text=text, header=header, port=port)
5466 * return # <<<<<<<<<<<<<<
5467 * except ValueError, msg:
5470 __Pyx_XDECREF(__pyx_r);
5471 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5472 goto __pyx_L11_try_return;
5474 __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
5475 __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0;
5476 __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0;
5477 goto __pyx_L14_try_end;
5478 __pyx_L11_try_return:;
5479 __Pyx_XGIVEREF(__pyx_save_exc_type);
5480 __Pyx_XGIVEREF(__pyx_save_exc_value);
5481 __Pyx_XGIVEREF(__pyx_save_exc_tb);
5482 __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
5485 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
5486 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
5487 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
5488 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
5490 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":496
5491 * text=text, header=header, port=port)
5493 * except ValueError, msg: # <<<<<<<<<<<<<<
5495 * self._open(filename, 'rb', template=template,
5497 __pyx_t_6 = PyErr_ExceptionMatches(__pyx_builtin_ValueError);
5499 __Pyx_AddTraceback("csamtools.Samfile._open");
5500 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_3, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
5501 __Pyx_GOTREF(__pyx_t_5);
5502 __Pyx_GOTREF(__pyx_t_3);
5503 __Pyx_GOTREF(__pyx_t_4);
5504 __Pyx_INCREF(__pyx_t_3);
5505 __Pyx_DECREF(__pyx_v_msg);
5506 __pyx_v_msg = __pyx_t_3;
5507 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5508 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5509 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5510 goto __pyx_L8_exception_handled;
5512 __pyx_L9_except_error:;
5513 __Pyx_XGIVEREF(__pyx_save_exc_type);
5514 __Pyx_XGIVEREF(__pyx_save_exc_value);
5515 __Pyx_XGIVEREF(__pyx_save_exc_tb);
5516 __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
5517 goto __pyx_L1_error;
5518 __pyx_L8_exception_handled:;
5519 __Pyx_XGIVEREF(__pyx_save_exc_type);
5520 __Pyx_XGIVEREF(__pyx_save_exc_value);
5521 __Pyx_XGIVEREF(__pyx_save_exc_tb);
5522 __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
5526 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":498
5527 * except ValueError, msg:
5529 * self._open(filename, 'rb', template=template, # <<<<<<<<<<<<<<
5530 * referencenames=referencenames,
5531 * referencelengths=referencelengths,
5533 __pyx_t_4 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___open); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5534 __Pyx_GOTREF(__pyx_t_4);
5535 __pyx_t_3 = PyBytes_FromString(__pyx_v_filename); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5536 __Pyx_GOTREF(((PyObject *)__pyx_t_3));
5537 __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5538 __Pyx_GOTREF(__pyx_t_5);
5539 PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_3));
5540 __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
5541 __Pyx_INCREF(((PyObject *)__pyx_n_s__rb));
5542 PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_n_s__rb));
5543 __Pyx_GIVEREF(((PyObject *)__pyx_n_s__rb));
5545 __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5546 __Pyx_GOTREF(((PyObject *)__pyx_t_3));
5547 if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__template), ((PyObject *)__pyx_v_template)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5549 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":499
5551 * self._open(filename, 'rb', template=template,
5552 * referencenames=referencenames, # <<<<<<<<<<<<<<
5553 * referencelengths=referencelengths,
5554 * text=text, header=header, port=port)
5556 if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__referencenames), __pyx_v_referencenames) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5558 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":500
5559 * self._open(filename, 'rb', template=template,
5560 * referencenames=referencenames,
5561 * referencelengths=referencelengths, # <<<<<<<<<<<<<<
5562 * text=text, header=header, port=port)
5565 if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__referencelengths), __pyx_v_referencelengths) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5567 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":501
5568 * referencenames=referencenames,
5569 * referencelengths=referencelengths,
5570 * text=text, header=header, port=port) # <<<<<<<<<<<<<<
5574 if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__text), __pyx_v_text) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5575 if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__header), __pyx_v_header) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5576 if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__port), __pyx_v_port) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5577 __pyx_t_2 = PyEval_CallObjectWithKeywords(__pyx_t_4, __pyx_t_5, ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5578 __Pyx_GOTREF(__pyx_t_2);
5579 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5580 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5581 __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
5582 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5584 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":502
5585 * referencelengths=referencelengths,
5586 * text=text, header=header, port=port)
5587 * return # <<<<<<<<<<<<<<
5589 * assert mode in ( "r","w","rb","wb", "wh", "wbu" ), "invalid file opening mode `%s`" % mode
5591 __Pyx_XDECREF(__pyx_r);
5592 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5598 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":504
5601 * assert mode in ( "r","w","rb","wb", "wh", "wbu" ), "invalid file opening mode `%s`" % mode # <<<<<<<<<<<<<<
5602 * assert filename != NULL
5605 #ifndef PYREX_WITHOUT_ASSERTIONS
5606 __Pyx_INCREF(__pyx_v_mode);
5607 __pyx_t_2 = __pyx_v_mode;
5608 __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, ((PyObject *)__pyx_n_s__r), Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5609 __Pyx_GOTREF(__pyx_t_3);
5610 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5611 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5612 __pyx_t_7 = __pyx_t_1;
5614 __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, ((PyObject *)__pyx_n_s__w), Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5615 __Pyx_GOTREF(__pyx_t_3);
5616 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5617 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5618 __pyx_t_8 = __pyx_t_1;
5619 __pyx_t_1 = __pyx_t_8;
5621 __pyx_t_1 = __pyx_t_7;
5624 __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, ((PyObject *)__pyx_n_s__rb), Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5625 __Pyx_GOTREF(__pyx_t_3);
5626 __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5627 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5628 __pyx_t_8 = __pyx_t_7;
5629 __pyx_t_7 = __pyx_t_8;
5631 __pyx_t_7 = __pyx_t_1;
5634 __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, ((PyObject *)__pyx_n_s__wb), Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5635 __Pyx_GOTREF(__pyx_t_3);
5636 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5637 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5638 __pyx_t_8 = __pyx_t_1;
5639 __pyx_t_1 = __pyx_t_8;
5641 __pyx_t_1 = __pyx_t_7;
5644 __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, ((PyObject *)__pyx_n_s__wh), Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5645 __Pyx_GOTREF(__pyx_t_3);
5646 __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5647 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5648 __pyx_t_8 = __pyx_t_7;
5649 __pyx_t_7 = __pyx_t_8;
5651 __pyx_t_7 = __pyx_t_1;
5654 __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, ((PyObject *)__pyx_n_s__wbu), Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5655 __Pyx_GOTREF(__pyx_t_3);
5656 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5657 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5658 __pyx_t_8 = __pyx_t_1;
5659 __pyx_t_1 = __pyx_t_8;
5661 __pyx_t_1 = __pyx_t_7;
5663 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5664 if (unlikely(!__pyx_t_1)) {
5665 __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_12), __pyx_v_mode); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5666 __Pyx_GOTREF(((PyObject *)__pyx_t_2));
5667 PyErr_SetObject(PyExc_AssertionError, ((PyObject *)__pyx_t_2));
5668 __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
5669 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5673 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":505
5675 * assert mode in ( "r","w","rb","wb", "wh", "wbu" ), "invalid file opening mode `%s`" % mode
5676 * assert filename != NULL # <<<<<<<<<<<<<<
5678 * # close a previously opened file
5680 #ifndef PYREX_WITHOUT_ASSERTIONS
5681 if (unlikely(!(__pyx_v_filename != NULL))) {
5682 PyErr_SetNone(PyExc_AssertionError);
5683 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5687 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":508
5689 * # close a previously opened file
5690 * if self.samfile != NULL: self.close() # <<<<<<<<<<<<<<
5691 * self.samfile = NULL
5694 __pyx_t_1 = (((struct __pyx_obj_9csamtools_Samfile *)__pyx_v_self)->samfile != NULL);
5696 __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__close); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5697 __Pyx_GOTREF(__pyx_t_2);
5698 __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 = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5699 __Pyx_GOTREF(__pyx_t_3);
5700 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5701 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5706 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":509
5707 * # close a previously opened file
5708 * if self.samfile != NULL: self.close()
5709 * self.samfile = NULL # <<<<<<<<<<<<<<
5711 * cdef bam_header_t * header_to_write
5713 ((struct __pyx_obj_9csamtools_Samfile *)__pyx_v_self)->samfile = NULL;
5715 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":512
5717 * cdef bam_header_t * header_to_write
5718 * header_to_write = NULL # <<<<<<<<<<<<<<
5720 * if self._filename != NULL: free(self._filename )
5722 __pyx_v_header_to_write = NULL;
5724 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":514
5725 * header_to_write = NULL
5727 * if self._filename != NULL: free(self._filename ) # <<<<<<<<<<<<<<
5728 * self._filename = strdup( filename )
5731 __pyx_t_1 = (((struct __pyx_obj_9csamtools_Samfile *)__pyx_v_self)->_filename != NULL);
5733 free(((struct __pyx_obj_9csamtools_Samfile *)__pyx_v_self)->_filename);
5738 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":515
5740 * if self._filename != NULL: free(self._filename )
5741 * self._filename = strdup( filename ) # <<<<<<<<<<<<<<
5743 * self.isbam = len(mode) > 1 and mode[1] == 'b'
5745 ((struct __pyx_obj_9csamtools_Samfile *)__pyx_v_self)->_filename = strdup(__pyx_v_filename);
5747 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":517
5748 * self._filename = strdup( filename )
5750 * self.isbam = len(mode) > 1 and mode[1] == 'b' # <<<<<<<<<<<<<<
5752 * self.isremote = strncmp(filename,"http:",5) == 0 or \
5754 __pyx_t_9 = PyObject_Length(__pyx_v_mode); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5755 __pyx_t_3 = __Pyx_PyBool_FromLong((__pyx_t_9 > 1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5756 __Pyx_GOTREF(__pyx_t_3);
5757 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5759 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5760 __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_mode, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5761 __Pyx_GOTREF(__pyx_t_2);
5762 __pyx_t_5 = PyObject_RichCompare(__pyx_t_2, ((PyObject *)__pyx_n_s__b), Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5763 __Pyx_GOTREF(__pyx_t_5);
5764 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5765 __pyx_t_2 = __pyx_t_5;
5768 __pyx_t_2 = __pyx_t_3;
5771 __pyx_t_6 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5772 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5773 ((struct __pyx_obj_9csamtools_Samfile *)__pyx_v_self)->isbam = __pyx_t_6;
5775 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":519
5776 * self.isbam = len(mode) > 1 and mode[1] == 'b'
5778 * self.isremote = strncmp(filename,"http:",5) == 0 or \ # <<<<<<<<<<<<<<
5779 * strncmp(filename,"ftp:",4) == 0
5782 __pyx_t_1 = (strncmp(__pyx_v_filename, __pyx_k_13, 5) == 0);
5785 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":520
5787 * self.isremote = strncmp(filename,"http:",5) == 0 or \
5788 * strncmp(filename,"ftp:",4) == 0 # <<<<<<<<<<<<<<
5792 __pyx_t_7 = (strncmp(__pyx_v_filename, __pyx_k_14, 4) == 0);
5793 __pyx_t_8 = __pyx_t_7;
5795 __pyx_t_8 = __pyx_t_1;
5798 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":519
5799 * self.isbam = len(mode) > 1 and mode[1] == 'b'
5801 * self.isremote = strncmp(filename,"http:",5) == 0 or \ # <<<<<<<<<<<<<<
5802 * strncmp(filename,"ftp:",4) == 0
5805 ((struct __pyx_obj_9csamtools_Samfile *)__pyx_v_self)->isremote = __pyx_t_8;
5807 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":523
5810 * ctext = NULL # <<<<<<<<<<<<<<
5812 * if mode[0] == 'w':
5814 __pyx_v_ctext = NULL;
5816 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":525
5819 * if mode[0] == 'w': # <<<<<<<<<<<<<<
5820 * # open file for writing
5823 __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_mode, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5824 __Pyx_GOTREF(__pyx_t_2);
5825 __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, ((PyObject *)__pyx_n_s__w), Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5826 __Pyx_GOTREF(__pyx_t_3);
5827 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5828 __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5829 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5832 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":529
5834 * # header structure (used for writing)
5835 * if template: # <<<<<<<<<<<<<<
5836 * # copy header from another file
5837 * header_to_write = template.samfile.header
5839 __pyx_t_8 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_template)); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5842 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":531
5844 * # copy header from another file
5845 * header_to_write = template.samfile.header # <<<<<<<<<<<<<<
5849 __pyx_v_header_to_write = __pyx_v_template->samfile->header;
5853 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":533
5854 * header_to_write = template.samfile.header
5856 * elif header: # <<<<<<<<<<<<<<
5857 * header_to_write = self._buildHeader( header )
5860 __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_header); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5863 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":534
5866 * header_to_write = self._buildHeader( header ) # <<<<<<<<<<<<<<
5870 __pyx_v_header_to_write = ((struct __pyx_vtabstruct_9csamtools_Samfile *)((struct __pyx_obj_9csamtools_Samfile *)__pyx_v_self)->__pyx_vtab)->_buildHeader(((struct __pyx_obj_9csamtools_Samfile *)__pyx_v_self), __pyx_v_header);
5875 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":538
5877 * # build header from a target names and lengths
5878 * assert referencenames and referencelengths, "either supply options `template`, `header` or both `referencenames` and `referencelengths` for writing" # <<<<<<<<<<<<<<
5879 * assert len(referencenames) == len(referencelengths), "unequal names and lengths of reference sequences"
5882 #ifndef PYREX_WITHOUT_ASSERTIONS
5883 __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_referencenames); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 538; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5885 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_referencelengths); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 538; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5886 __pyx_t_7 = __pyx_t_1;
5888 __pyx_t_7 = __pyx_t_8;
5890 if (unlikely(!__pyx_t_7)) {
5891 PyErr_SetObject(PyExc_AssertionError, ((PyObject *)__pyx_kp_s_15));
5892 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 538; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5896 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":539
5897 * # build header from a target names and lengths
5898 * assert referencenames and referencelengths, "either supply options `template`, `header` or both `referencenames` and `referencelengths` for writing"
5899 * assert len(referencenames) == len(referencelengths), "unequal names and lengths of reference sequences" # <<<<<<<<<<<<<<
5901 * # allocate and fill header
5903 #ifndef PYREX_WITHOUT_ASSERTIONS
5904 __pyx_t_9 = PyObject_Length(__pyx_v_referencenames); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5905 __pyx_t_10 = PyObject_Length(__pyx_v_referencelengths); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5906 if (unlikely(!(__pyx_t_9 == __pyx_t_10))) {
5907 PyErr_SetObject(PyExc_AssertionError, ((PyObject *)__pyx_kp_s_16));
5908 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5912 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":542
5914 * # allocate and fill header
5915 * header_to_write = bam_header_init() # <<<<<<<<<<<<<<
5916 * header_to_write.n_targets = len(referencenames)
5919 __pyx_v_header_to_write = bam_header_init();
5921 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":543
5922 * # allocate and fill header
5923 * header_to_write = bam_header_init()
5924 * header_to_write.n_targets = len(referencenames) # <<<<<<<<<<<<<<
5926 * for x in referencenames: n += len(x) + 1
5928 __pyx_t_10 = PyObject_Length(__pyx_v_referencenames); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5929 __pyx_v_header_to_write->n_targets = __pyx_t_10;
5931 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":544
5932 * header_to_write = bam_header_init()
5933 * header_to_write.n_targets = len(referencenames)
5934 * n = 0 # <<<<<<<<<<<<<<
5935 * for x in referencenames: n += len(x) + 1
5936 * header_to_write.target_name = <char**>calloc(n, sizeof(char*))
5938 __Pyx_INCREF(__pyx_int_0);
5939 __Pyx_DECREF(__pyx_v_n);
5940 __pyx_v_n = __pyx_int_0;
5942 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":545
5943 * header_to_write.n_targets = len(referencenames)
5945 * for x in referencenames: n += len(x) + 1 # <<<<<<<<<<<<<<
5946 * header_to_write.target_name = <char**>calloc(n, sizeof(char*))
5947 * header_to_write.target_len = <uint32_t*>calloc(n, sizeof(uint32_t))
5949 if (PyList_CheckExact(__pyx_v_referencenames) || PyTuple_CheckExact(__pyx_v_referencenames)) {
5950 __pyx_t_10 = 0; __pyx_t_3 = __pyx_v_referencenames; __Pyx_INCREF(__pyx_t_3);
5952 __pyx_t_10 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_referencenames); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 545; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5953 __Pyx_GOTREF(__pyx_t_3);
5956 if (likely(PyList_CheckExact(__pyx_t_3))) {
5957 if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_3)) break;
5958 __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_10); __Pyx_INCREF(__pyx_t_2); __pyx_t_10++;
5959 } else if (likely(PyTuple_CheckExact(__pyx_t_3))) {
5960 if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
5961 __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_10); __Pyx_INCREF(__pyx_t_2); __pyx_t_10++;
5963 __pyx_t_2 = PyIter_Next(__pyx_t_3);
5965 if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 545; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5968 __Pyx_GOTREF(__pyx_t_2);
5970 __Pyx_DECREF(__pyx_v_x);
5971 __pyx_v_x = __pyx_t_2;
5973 __pyx_t_9 = PyObject_Length(__pyx_v_x); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 545; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5974 __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_9 + 1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 545; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5975 __Pyx_GOTREF(__pyx_t_2);
5976 __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_n, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 545; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5977 __Pyx_GOTREF(__pyx_t_5);
5978 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5979 __Pyx_DECREF(__pyx_v_n);
5980 __pyx_v_n = __pyx_t_5;
5983 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5985 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":546
5987 * for x in referencenames: n += len(x) + 1
5988 * header_to_write.target_name = <char**>calloc(n, sizeof(char*)) # <<<<<<<<<<<<<<
5989 * header_to_write.target_len = <uint32_t*>calloc(n, sizeof(uint32_t))
5990 * for x from 0 <= x < header_to_write.n_targets:
5992 __pyx_t_11 = __Pyx_PyInt_AsSize_t(__pyx_v_n); if (unlikely((__pyx_t_11 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5993 __pyx_v_header_to_write->target_name = ((char **)calloc(__pyx_t_11, (sizeof(char *))));
5995 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":547
5996 * for x in referencenames: n += len(x) + 1
5997 * header_to_write.target_name = <char**>calloc(n, sizeof(char*))
5998 * header_to_write.target_len = <uint32_t*>calloc(n, sizeof(uint32_t)) # <<<<<<<<<<<<<<
5999 * for x from 0 <= x < header_to_write.n_targets:
6000 * header_to_write.target_len[x] = referencelengths[x]
6002 __pyx_t_11 = __Pyx_PyInt_AsSize_t(__pyx_v_n); if (unlikely((__pyx_t_11 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 547; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6003 __pyx_v_header_to_write->target_len = ((uint32_t *)calloc(__pyx_t_11, (sizeof(uint32_t))));
6005 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":548
6006 * header_to_write.target_name = <char**>calloc(n, sizeof(char*))
6007 * header_to_write.target_len = <uint32_t*>calloc(n, sizeof(uint32_t))
6008 * for x from 0 <= x < header_to_write.n_targets: # <<<<<<<<<<<<<<
6009 * header_to_write.target_len[x] = referencelengths[x]
6010 * name = referencenames[x]
6012 __pyx_t_12 = __pyx_v_header_to_write->n_targets;
6013 for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13++) {
6014 __pyx_t_3 = PyInt_FromLong(__pyx_t_13); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6015 __Pyx_GOTREF(__pyx_t_3);
6016 __Pyx_DECREF(__pyx_v_x);
6017 __pyx_v_x = __pyx_t_3;
6020 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":549
6021 * header_to_write.target_len = <uint32_t*>calloc(n, sizeof(uint32_t))
6022 * for x from 0 <= x < header_to_write.n_targets:
6023 * header_to_write.target_len[x] = referencelengths[x] # <<<<<<<<<<<<<<
6024 * name = referencenames[x]
6025 * header_to_write.target_name[x] = <char*>calloc(len(name)+1, sizeof(char))
6027 __pyx_t_3 = PyObject_GetItem(__pyx_v_referencelengths, __pyx_v_x); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6028 __Pyx_GOTREF(__pyx_t_3);
6029 __pyx_t_14 = __Pyx_PyInt_from_py_uint32_t(__pyx_t_3); if (unlikely((__pyx_t_14 == (uint32_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6030 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6031 __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_x); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6032 (__pyx_v_header_to_write->target_len[__pyx_t_10]) = __pyx_t_14;
6034 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":550
6035 * for x from 0 <= x < header_to_write.n_targets:
6036 * header_to_write.target_len[x] = referencelengths[x]
6037 * name = referencenames[x] # <<<<<<<<<<<<<<
6038 * header_to_write.target_name[x] = <char*>calloc(len(name)+1, sizeof(char))
6039 * strncpy( header_to_write.target_name[x], name, len(name) )
6041 __pyx_t_3 = PyObject_GetItem(__pyx_v_referencenames, __pyx_v_x); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 550; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6042 __Pyx_GOTREF(__pyx_t_3);
6043 __Pyx_DECREF(__pyx_v_name);
6044 __pyx_v_name = __pyx_t_3;
6047 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":551
6048 * header_to_write.target_len[x] = referencelengths[x]
6049 * name = referencenames[x]
6050 * header_to_write.target_name[x] = <char*>calloc(len(name)+1, sizeof(char)) # <<<<<<<<<<<<<<
6051 * strncpy( header_to_write.target_name[x], name, len(name) )
6054 __pyx_t_10 = PyObject_Length(__pyx_v_name); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 551; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6055 __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_v_x); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 551; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6056 (__pyx_v_header_to_write->target_name[__pyx_t_9]) = ((char *)calloc((__pyx_t_10 + 1), (sizeof(char))));
6058 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":552
6059 * name = referencenames[x]
6060 * header_to_write.target_name[x] = <char*>calloc(len(name)+1, sizeof(char))
6061 * strncpy( header_to_write.target_name[x], name, len(name) ) # <<<<<<<<<<<<<<
6065 __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_x); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 552; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6066 __pyx_t_15 = PyBytes_AsString(__pyx_v_name); if (unlikely((!__pyx_t_15) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 552; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6067 __pyx_t_9 = PyObject_Length(__pyx_v_name); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 552; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6068 strncpy((__pyx_v_header_to_write->target_name[__pyx_t_10]), __pyx_t_15, __pyx_t_9);
6069 __pyx_t_13 = __Pyx_PyInt_AsLong(__pyx_v_x); if (unlikely((__pyx_t_13 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6072 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":548
6073 * header_to_write.target_name = <char**>calloc(n, sizeof(char*))
6074 * header_to_write.target_len = <uint32_t*>calloc(n, sizeof(uint32_t))
6075 * for x from 0 <= x < header_to_write.n_targets: # <<<<<<<<<<<<<<
6076 * header_to_write.target_len[x] = referencelengths[x]
6077 * name = referencenames[x]
6079 __pyx_t_3 = PyInt_FromLong(__pyx_t_13); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6080 __Pyx_GOTREF(__pyx_t_3);
6081 __Pyx_DECREF(__pyx_v_x);
6082 __pyx_v_x = __pyx_t_3;
6085 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":554
6086 * strncpy( header_to_write.target_name[x], name, len(name) )
6088 * if text != None: # <<<<<<<<<<<<<<
6092 __pyx_t_3 = PyObject_RichCompare(__pyx_v_text, Py_None, Py_NE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6093 __Pyx_GOTREF(__pyx_t_3);
6094 __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6095 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6098 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":556
6101 * ctext = text # <<<<<<<<<<<<<<
6102 * header_to_write.l_text = strlen(ctext)
6103 * header_to_write.text = <char*>calloc( strlen(ctext), sizeof(char) )
6105 __pyx_t_15 = PyBytes_AsString(__pyx_v_text); if (unlikely((!__pyx_t_15) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6106 __pyx_v_ctext = __pyx_t_15;
6108 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":557
6111 * header_to_write.l_text = strlen(ctext) # <<<<<<<<<<<<<<
6112 * header_to_write.text = <char*>calloc( strlen(ctext), sizeof(char) )
6113 * memcpy( header_to_write.text, ctext, strlen(ctext) )
6115 __pyx_v_header_to_write->l_text = strlen(__pyx_v_ctext);
6117 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":558
6119 * header_to_write.l_text = strlen(ctext)
6120 * header_to_write.text = <char*>calloc( strlen(ctext), sizeof(char) ) # <<<<<<<<<<<<<<
6121 * memcpy( header_to_write.text, ctext, strlen(ctext) )
6124 __pyx_v_header_to_write->text = ((char *)calloc(strlen(__pyx_v_ctext), (sizeof(char))));
6126 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":559
6127 * header_to_write.l_text = strlen(ctext)
6128 * header_to_write.text = <char*>calloc( strlen(ctext), sizeof(char) )
6129 * memcpy( header_to_write.text, ctext, strlen(ctext) ) # <<<<<<<<<<<<<<
6131 * header_to_write.hash = NULL
6133 memcpy(__pyx_v_header_to_write->text, __pyx_v_ctext, strlen(__pyx_v_ctext));
6138 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":561
6139 * memcpy( header_to_write.text, ctext, strlen(ctext) )
6141 * header_to_write.hash = NULL # <<<<<<<<<<<<<<
6142 * header_to_write.rg2lib = NULL
6145 __pyx_v_header_to_write->hash = NULL;
6147 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":562
6149 * header_to_write.hash = NULL
6150 * header_to_write.rg2lib = NULL # <<<<<<<<<<<<<<
6152 * # open file. Header gets written to file at the same time for bam files
6154 __pyx_v_header_to_write->rg2lib = NULL;
6158 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":566
6159 * # open file. Header gets written to file at the same time for bam files
6160 * # and sam files (in the latter case, the mode needs to be wh)
6161 * store = StderrStore() # <<<<<<<<<<<<<<
6162 * self.samfile = samopen( filename, mode, header_to_write )
6165 __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__StderrStore); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 566; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6166 __Pyx_GOTREF(__pyx_t_3);
6167 __pyx_t_5 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 566; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6168 __Pyx_GOTREF(__pyx_t_5);
6169 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6170 __Pyx_DECREF(__pyx_v_store);
6171 __pyx_v_store = __pyx_t_5;
6174 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":567
6175 * # and sam files (in the latter case, the mode needs to be wh)
6176 * store = StderrStore()
6177 * self.samfile = samopen( filename, mode, header_to_write ) # <<<<<<<<<<<<<<
6181 __pyx_t_15 = PyBytes_AsString(__pyx_v_mode); if (unlikely((!__pyx_t_15) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 567; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6182 ((struct __pyx_obj_9csamtools_Samfile *)__pyx_v_self)->samfile = samopen(__pyx_v_filename, __pyx_t_15, __pyx_v_header_to_write);
6184 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":568
6185 * store = StderrStore()
6186 * self.samfile = samopen( filename, mode, header_to_write )
6187 * store.release() # <<<<<<<<<<<<<<
6189 * # bam_header_destroy takes care of cleaning up of all the members
6191 __pyx_t_5 = PyObject_GetAttr(__pyx_v_store, __pyx_n_s__release); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6192 __Pyx_GOTREF(__pyx_t_5);
6193 __pyx_t_3 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6194 __Pyx_GOTREF(__pyx_t_3);
6195 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6196 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6198 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":571
6200 * # bam_header_destroy takes care of cleaning up of all the members
6201 * if not template and header_to_write != NULL: # <<<<<<<<<<<<<<
6202 * bam_header_destroy( header_to_write )
6205 __pyx_t_7 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_template)); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6206 __pyx_t_8 = (!__pyx_t_7);
6208 __pyx_t_7 = (__pyx_v_header_to_write != NULL);
6209 __pyx_t_1 = __pyx_t_7;
6211 __pyx_t_1 = __pyx_t_8;
6215 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":572
6216 * # bam_header_destroy takes care of cleaning up of all the members
6217 * if not template and header_to_write != NULL:
6218 * bam_header_destroy( header_to_write ) # <<<<<<<<<<<<<<
6220 * elif mode[0] == "r":
6222 bam_header_destroy(__pyx_v_header_to_write);
6229 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":574
6230 * bam_header_destroy( header_to_write )
6232 * elif mode[0] == "r": # <<<<<<<<<<<<<<
6233 * # open file for reading
6234 * if strncmp( filename, "-", 1) != 0 and \
6236 __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_mode, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6237 __Pyx_GOTREF(__pyx_t_3);
6238 __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, ((PyObject *)__pyx_n_s__r), Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6239 __Pyx_GOTREF(__pyx_t_5);
6240 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6241 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6242 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6245 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":576
6246 * elif mode[0] == "r":
6247 * # open file for reading
6248 * if strncmp( filename, "-", 1) != 0 and \ # <<<<<<<<<<<<<<
6249 * not self.isremote and \
6250 * not os.path.exists( filename ):
6252 __pyx_t_1 = (strncmp(__pyx_v_filename, __pyx_k_17, 1) != 0);
6255 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":577
6256 * # open file for reading
6257 * if strncmp( filename, "-", 1) != 0 and \
6258 * not self.isremote and \ # <<<<<<<<<<<<<<
6259 * not os.path.exists( filename ):
6260 * raise IOError( "file `%s` not found" % filename)
6262 __pyx_t_8 = (!((struct __pyx_obj_9csamtools_Samfile *)__pyx_v_self)->isremote);
6265 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":578
6266 * if strncmp( filename, "-", 1) != 0 and \
6267 * not self.isremote and \
6268 * not os.path.exists( filename ): # <<<<<<<<<<<<<<
6269 * raise IOError( "file `%s` not found" % filename)
6272 __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__os); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6273 __Pyx_GOTREF(__pyx_t_5);
6274 __pyx_t_3 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__path); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6275 __Pyx_GOTREF(__pyx_t_3);
6276 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6277 __pyx_t_5 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__exists); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6278 __Pyx_GOTREF(__pyx_t_5);
6279 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6280 __pyx_t_3 = PyBytes_FromString(__pyx_v_filename); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6281 __Pyx_GOTREF(((PyObject *)__pyx_t_3));
6282 __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6283 __Pyx_GOTREF(__pyx_t_2);
6284 PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_3));
6285 __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
6287 __pyx_t_3 = PyObject_Call(__pyx_t_5, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6288 __Pyx_GOTREF(__pyx_t_3);
6289 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6290 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6291 __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6292 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6293 __pyx_t_16 = (!__pyx_t_7);
6294 __pyx_t_7 = __pyx_t_16;
6296 __pyx_t_7 = __pyx_t_8;
6298 __pyx_t_8 = __pyx_t_7;
6300 __pyx_t_8 = __pyx_t_1;
6304 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":579
6305 * not self.isremote and \
6306 * not os.path.exists( filename ):
6307 * raise IOError( "file `%s` not found" % filename) # <<<<<<<<<<<<<<
6309 * # try to detect errors
6311 __pyx_t_3 = PyBytes_FromString(__pyx_v_filename); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 579; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6312 __Pyx_GOTREF(((PyObject *)__pyx_t_3));
6313 __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_18), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 579; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6314 __Pyx_GOTREF(((PyObject *)__pyx_t_2));
6315 __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
6316 __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 579; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6317 __Pyx_GOTREF(__pyx_t_3);
6318 PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_2));
6319 __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
6321 __pyx_t_2 = PyObject_Call(__pyx_builtin_IOError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 579; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6322 __Pyx_GOTREF(__pyx_t_2);
6323 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6324 __Pyx_Raise(__pyx_t_2, 0, 0);
6325 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6326 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 579; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6331 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":582
6333 * # try to detect errors
6334 * self.samfile = samopen( filename, mode, NULL ) # <<<<<<<<<<<<<<
6335 * if self.samfile == NULL:
6336 * raise ValueError( "could not open file (mode='%s') - is it SAM/BAM format?" % mode)
6338 __pyx_t_15 = PyBytes_AsString(__pyx_v_mode); if (unlikely((!__pyx_t_15) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 582; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6339 ((struct __pyx_obj_9csamtools_Samfile *)__pyx_v_self)->samfile = samopen(__pyx_v_filename, __pyx_t_15, NULL);
6341 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":583
6342 * # try to detect errors
6343 * self.samfile = samopen( filename, mode, NULL )
6344 * if self.samfile == NULL: # <<<<<<<<<<<<<<
6345 * raise ValueError( "could not open file (mode='%s') - is it SAM/BAM format?" % mode)
6348 __pyx_t_8 = (((struct __pyx_obj_9csamtools_Samfile *)__pyx_v_self)->samfile == NULL);
6351 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":584
6352 * self.samfile = samopen( filename, mode, NULL )
6353 * if self.samfile == NULL:
6354 * raise ValueError( "could not open file (mode='%s') - is it SAM/BAM format?" % mode) # <<<<<<<<<<<<<<
6356 * if self.samfile.header == NULL:
6358 __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_19), __pyx_v_mode); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 584; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6359 __Pyx_GOTREF(((PyObject *)__pyx_t_2));
6360 __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 584; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6361 __Pyx_GOTREF(__pyx_t_3);
6362 PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_2));
6363 __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
6365 __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 584; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6366 __Pyx_GOTREF(__pyx_t_2);
6367 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6368 __Pyx_Raise(__pyx_t_2, 0, 0);
6369 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6370 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 584; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6375 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":586
6376 * raise ValueError( "could not open file (mode='%s') - is it SAM/BAM format?" % mode)
6378 * if self.samfile.header == NULL: # <<<<<<<<<<<<<<
6379 * raise ValueError( "file does not have valid header (mode='%s') - is it SAM/BAM format?" % mode )
6382 __pyx_t_8 = (((struct __pyx_obj_9csamtools_Samfile *)__pyx_v_self)->samfile->header == NULL);
6385 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":587
6387 * if self.samfile.header == NULL:
6388 * raise ValueError( "file does not have valid header (mode='%s') - is it SAM/BAM format?" % mode ) # <<<<<<<<<<<<<<
6390 * #disabled for autodetection to work
6392 __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_20), __pyx_v_mode); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 587; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6393 __Pyx_GOTREF(((PyObject *)__pyx_t_2));
6394 __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 587; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6395 __Pyx_GOTREF(__pyx_t_3);
6396 PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_2));
6397 __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
6399 __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 587; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6400 __Pyx_GOTREF(__pyx_t_2);
6401 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6402 __Pyx_Raise(__pyx_t_2, 0, 0);
6403 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6404 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 587; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6409 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":590
6411 * #disabled for autodetection to work
6412 * if self.samfile.header.n_targets == 0: # <<<<<<<<<<<<<<
6413 * raise ValueError( "file header is empty (mode='%s') - is it SAM/BAM format?" % mode)
6416 __pyx_t_8 = (((struct __pyx_obj_9csamtools_Samfile *)__pyx_v_self)->samfile->header->n_targets == 0);
6419 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":591
6420 * #disabled for autodetection to work
6421 * if self.samfile.header.n_targets == 0:
6422 * raise ValueError( "file header is empty (mode='%s') - is it SAM/BAM format?" % mode) # <<<<<<<<<<<<<<
6424 * if self.samfile == NULL:
6426 __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_21), __pyx_v_mode); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6427 __Pyx_GOTREF(((PyObject *)__pyx_t_2));
6428 __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6429 __Pyx_GOTREF(__pyx_t_3);
6430 PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_2));
6431 __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
6433 __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6434 __Pyx_GOTREF(__pyx_t_2);
6435 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6436 __Pyx_Raise(__pyx_t_2, 0, 0);
6437 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6438 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6446 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":593
6447 * raise ValueError( "file header is empty (mode='%s') - is it SAM/BAM format?" % mode)
6449 * if self.samfile == NULL: # <<<<<<<<<<<<<<
6450 * raise IOError("could not open file `%s`" % filename )
6453 __pyx_t_8 = (((struct __pyx_obj_9csamtools_Samfile *)__pyx_v_self)->samfile == NULL);
6456 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":594
6458 * if self.samfile == NULL:
6459 * raise IOError("could not open file `%s`" % filename ) # <<<<<<<<<<<<<<
6461 * # check for index and open if present
6463 __pyx_t_2 = PyBytes_FromString(__pyx_v_filename); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6464 __Pyx_GOTREF(((PyObject *)__pyx_t_2));
6465 __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_4), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6466 __Pyx_GOTREF(((PyObject *)__pyx_t_3));
6467 __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
6468 __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6469 __Pyx_GOTREF(__pyx_t_2);
6470 PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_3));
6471 __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
6473 __pyx_t_3 = PyObject_Call(__pyx_builtin_IOError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6474 __Pyx_GOTREF(__pyx_t_3);
6475 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6476 __Pyx_Raise(__pyx_t_3, 0, 0);
6477 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6478 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6483 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":597
6485 * # check for index and open if present
6486 * if mode[0] == "r" and self.isbam: # <<<<<<<<<<<<<<
6488 * if not self.isremote:
6490 __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_mode, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6491 __Pyx_GOTREF(__pyx_t_3);
6492 __pyx_t_2 = PyObject_RichCompare(__pyx_t_3, ((PyObject *)__pyx_n_s__r), Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6493 __Pyx_GOTREF(__pyx_t_2);
6494 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6495 __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6496 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6498 __pyx_t_1 = ((struct __pyx_obj_9csamtools_Samfile *)__pyx_v_self)->isbam;
6500 __pyx_t_1 = __pyx_t_8;
6504 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":599
6505 * if mode[0] == "r" and self.isbam:
6507 * if not self.isremote: # <<<<<<<<<<<<<<
6508 * if not os.path.exists(filename +".bai"):
6511 __pyx_t_1 = (!((struct __pyx_obj_9csamtools_Samfile *)__pyx_v_self)->isremote);
6514 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":600
6516 * if not self.isremote:
6517 * if not os.path.exists(filename +".bai"): # <<<<<<<<<<<<<<
6521 __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__os); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 600; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6522 __Pyx_GOTREF(__pyx_t_2);
6523 __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__path); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 600; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6524 __Pyx_GOTREF(__pyx_t_3);
6525 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6526 __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__exists); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 600; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6527 __Pyx_GOTREF(__pyx_t_2);
6528 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6529 __pyx_t_3 = PyBytes_FromString(__pyx_v_filename); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 600; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6530 __Pyx_GOTREF(((PyObject *)__pyx_t_3));
6531 __pyx_t_5 = PyNumber_Add(((PyObject *)__pyx_t_3), ((PyObject *)__pyx_kp_s_22)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 600; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6532 __Pyx_GOTREF(__pyx_t_5);
6533 __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
6534 __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 600; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6535 __Pyx_GOTREF(__pyx_t_3);
6536 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5);
6537 __Pyx_GIVEREF(__pyx_t_5);
6539 __pyx_t_5 = PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 600; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6540 __Pyx_GOTREF(__pyx_t_5);
6541 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6542 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6543 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 600; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6544 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6545 __pyx_t_8 = (!__pyx_t_1);
6548 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":601
6549 * if not self.isremote:
6550 * if not os.path.exists(filename +".bai"):
6551 * self.index = NULL # <<<<<<<<<<<<<<
6553 * # returns NULL if there is no index or index could not be opened
6555 ((struct __pyx_obj_9csamtools_Samfile *)__pyx_v_self)->index = NULL;
6560 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":604
6562 * # returns NULL if there is no index or index could not be opened
6563 * self.index = bam_index_load(filename) # <<<<<<<<<<<<<<
6564 * if self.index == NULL:
6565 * raise IOError("error while opening index `%s` " % filename )
6567 ((struct __pyx_obj_9csamtools_Samfile *)__pyx_v_self)->index = bam_index_load(__pyx_v_filename);
6569 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":605
6570 * # returns NULL if there is no index or index could not be opened
6571 * self.index = bam_index_load(filename)
6572 * if self.index == NULL: # <<<<<<<<<<<<<<
6573 * raise IOError("error while opening index `%s` " % filename )
6576 __pyx_t_8 = (((struct __pyx_obj_9csamtools_Samfile *)__pyx_v_self)->index == NULL);
6579 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":606
6580 * self.index = bam_index_load(filename)
6581 * if self.index == NULL:
6582 * raise IOError("error while opening index `%s` " % filename ) # <<<<<<<<<<<<<<
6584 * self.index = bam_index_load(filename)
6586 __pyx_t_5 = PyBytes_FromString(__pyx_v_filename); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 606; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6587 __Pyx_GOTREF(((PyObject *)__pyx_t_5));
6588 __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_23), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 606; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6589 __Pyx_GOTREF(((PyObject *)__pyx_t_3));
6590 __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
6591 __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 606; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6592 __Pyx_GOTREF(__pyx_t_5);
6593 PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_3));
6594 __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
6596 __pyx_t_3 = PyObject_Call(__pyx_builtin_IOError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 606; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6597 __Pyx_GOTREF(__pyx_t_3);
6598 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6599 __Pyx_Raise(__pyx_t_3, 0, 0);
6600 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6601 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 606; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6611 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":608
6612 * raise IOError("error while opening index `%s` " % filename )
6614 * self.index = bam_index_load(filename) # <<<<<<<<<<<<<<
6615 * if self.index == NULL:
6616 * raise IOError("error while opening index `%s` " % filename )
6618 ((struct __pyx_obj_9csamtools_Samfile *)__pyx_v_self)->index = bam_index_load(__pyx_v_filename);
6620 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":609
6622 * self.index = bam_index_load(filename)
6623 * if self.index == NULL: # <<<<<<<<<<<<<<
6624 * raise IOError("error while opening index `%s` " % filename )
6627 __pyx_t_8 = (((struct __pyx_obj_9csamtools_Samfile *)__pyx_v_self)->index == NULL);
6630 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":610
6631 * self.index = bam_index_load(filename)
6632 * if self.index == NULL:
6633 * raise IOError("error while opening index `%s` " % filename ) # <<<<<<<<<<<<<<
6635 * def gettid( self, reference ):
6637 __pyx_t_3 = PyBytes_FromString(__pyx_v_filename); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 610; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6638 __Pyx_GOTREF(((PyObject *)__pyx_t_3));
6639 __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_23), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 610; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6640 __Pyx_GOTREF(((PyObject *)__pyx_t_5));
6641 __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
6642 __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 610; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6643 __Pyx_GOTREF(__pyx_t_3);
6644 PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_5));
6645 __Pyx_GIVEREF(((PyObject *)__pyx_t_5));
6647 __pyx_t_5 = PyObject_Call(__pyx_builtin_IOError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 610; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6648 __Pyx_GOTREF(__pyx_t_5);
6649 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6650 __Pyx_Raise(__pyx_t_5, 0, 0);
6651 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6652 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 610; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6662 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6665 __Pyx_XDECREF(__pyx_t_2);
6666 __Pyx_XDECREF(__pyx_t_3);
6667 __Pyx_XDECREF(__pyx_t_4);
6668 __Pyx_XDECREF(__pyx_t_5);
6669 __Pyx_AddTraceback("csamtools.Samfile._open");
6672 __Pyx_DECREF(__pyx_v_msg);
6673 __Pyx_DECREF(__pyx_v_n);
6674 __Pyx_DECREF(__pyx_v_x);
6675 __Pyx_DECREF(__pyx_v_name);
6676 __Pyx_DECREF(__pyx_v_store);
6677 __Pyx_XGIVEREF(__pyx_r);
6678 __Pyx_TraceReturn(__pyx_r);
6679 __Pyx_RefNannyFinishContext();
6683 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":612
6684 * raise IOError("error while opening index `%s` " % filename )
6686 * def gettid( self, reference ): # <<<<<<<<<<<<<<
6688 * convert :term:`reference` name into numerical :term:`tid`
6691 static PyObject *__pyx_pf_9csamtools_7Samfile_gettid(PyObject *__pyx_v_self, PyObject *__pyx_v_reference); /*proto*/
6692 static char __pyx_doc_9csamtools_7Samfile_gettid[] = "Samfile.gettid(self, reference)\n\n convert :term:`reference` name into numerical :term:`tid`\n\n returns -1 if reference is not known.\n ";
6693 static PyObject *__pyx_pf_9csamtools_7Samfile_gettid(PyObject *__pyx_v_self, PyObject *__pyx_v_reference) {
6694 PyObject *__pyx_r = NULL;
6695 PyObject *__pyx_t_1 = NULL;
6696 PyObject *__pyx_t_2 = NULL;
6700 __Pyx_TraceDeclarations
6701 __Pyx_RefNannySetupContext("gettid");
6702 __Pyx_TraceCall("gettid", __pyx_f[0], 612);
6704 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":618
6705 * returns -1 if reference is not known.
6707 * if not self._isOpen(): raise ValueError( "I/O operation on closed file" ) # <<<<<<<<<<<<<<
6708 * return pysam_reference2tid( self.samfile.header, reference )
6711 __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___isOpen); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 618; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6712 __Pyx_GOTREF(__pyx_t_1);
6713 __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 = 618; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6714 __Pyx_GOTREF(__pyx_t_2);
6715 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6716 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 618; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6717 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6718 __pyx_t_4 = (!__pyx_t_3);
6720 __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 618; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6721 __Pyx_GOTREF(__pyx_t_2);
6722 __Pyx_INCREF(((PyObject *)__pyx_kp_s_5));
6723 PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_5));
6724 __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_5));
6725 __pyx_t_1 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 618; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6726 __Pyx_GOTREF(__pyx_t_1);
6727 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6728 __Pyx_Raise(__pyx_t_1, 0, 0);
6729 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6730 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 618; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6735 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":619
6737 * if not self._isOpen(): raise ValueError( "I/O operation on closed file" )
6738 * return pysam_reference2tid( self.samfile.header, reference ) # <<<<<<<<<<<<<<
6740 * def getrname( self, tid ):
6742 __Pyx_XDECREF(__pyx_r);
6743 __pyx_t_5 = PyBytes_AsString(__pyx_v_reference); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6744 __pyx_t_1 = PyInt_FromLong(pysam_reference2tid(((struct __pyx_obj_9csamtools_Samfile *)__pyx_v_self)->samfile->header, __pyx_t_5)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6745 __Pyx_GOTREF(__pyx_t_1);
6746 __pyx_r = __pyx_t_1;
6750 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6753 __Pyx_XDECREF(__pyx_t_1);
6754 __Pyx_XDECREF(__pyx_t_2);
6755 __Pyx_AddTraceback("csamtools.Samfile.gettid");
6758 __Pyx_XGIVEREF(__pyx_r);
6759 __Pyx_TraceReturn(__pyx_r);
6760 __Pyx_RefNannyFinishContext();
6764 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":621
6765 * return pysam_reference2tid( self.samfile.header, reference )
6767 * def getrname( self, tid ): # <<<<<<<<<<<<<<
6769 * convert numerical :term:`tid` into :term:`reference` name.'''
6772 static PyObject *__pyx_pf_9csamtools_7Samfile_getrname(PyObject *__pyx_v_self, PyObject *__pyx_v_tid); /*proto*/
6773 static char __pyx_doc_9csamtools_7Samfile_getrname[] = "Samfile.getrname(self, tid)\n\n convert numerical :term:`tid` into :term:`reference` name.";
6774 static PyObject *__pyx_pf_9csamtools_7Samfile_getrname(PyObject *__pyx_v_self, PyObject *__pyx_v_tid) {
6775 PyObject *__pyx_r = NULL;
6776 PyObject *__pyx_t_1 = NULL;
6777 PyObject *__pyx_t_2 = NULL;
6780 Py_ssize_t __pyx_t_5;
6781 __Pyx_TraceDeclarations
6782 __Pyx_RefNannySetupContext("getrname");
6783 __Pyx_TraceCall("getrname", __pyx_f[0], 621);
6785 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":624
6787 * convert numerical :term:`tid` into :term:`reference` name.'''
6788 * if not self._isOpen(): raise ValueError( "I/O operation on closed file" ) # <<<<<<<<<<<<<<
6789 * if not 0 <= tid < self.samfile.header.n_targets:
6790 * raise ValueError( "tid %i out of range 0<=tid<%i" % (tid, self.samfile.header.n_targets ) )
6792 __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___isOpen); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 624; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6793 __Pyx_GOTREF(__pyx_t_1);
6794 __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 = 624; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6795 __Pyx_GOTREF(__pyx_t_2);
6796 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6797 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 624; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6798 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6799 __pyx_t_4 = (!__pyx_t_3);
6801 __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 624; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6802 __Pyx_GOTREF(__pyx_t_2);
6803 __Pyx_INCREF(((PyObject *)__pyx_kp_s_5));
6804 PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_5));
6805 __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_5));
6806 __pyx_t_1 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 624; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6807 __Pyx_GOTREF(__pyx_t_1);
6808 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6809 __Pyx_Raise(__pyx_t_1, 0, 0);
6810 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6811 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 624; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6816 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":625
6817 * convert numerical :term:`tid` into :term:`reference` name.'''
6818 * if not self._isOpen(): raise ValueError( "I/O operation on closed file" )
6819 * if not 0 <= tid < self.samfile.header.n_targets: # <<<<<<<<<<<<<<
6820 * raise ValueError( "tid %i out of range 0<=tid<%i" % (tid, self.samfile.header.n_targets ) )
6821 * return self.samfile.header.target_name[tid]
6823 __pyx_t_1 = PyObject_RichCompare(__pyx_int_0, __pyx_v_tid, Py_LE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 625; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6824 __Pyx_GOTREF(__pyx_t_1);
6825 if (__Pyx_PyObject_IsTrue(__pyx_t_1)) {
6826 __Pyx_DECREF(__pyx_t_1);
6827 __pyx_t_2 = __Pyx_PyInt_to_py_int32_t(((struct __pyx_obj_9csamtools_Samfile *)__pyx_v_self)->samfile->header->n_targets); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 625; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6828 __Pyx_GOTREF(__pyx_t_2);
6829 __pyx_t_1 = PyObject_RichCompare(__pyx_v_tid, __pyx_t_2, Py_LT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 625; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6830 __Pyx_GOTREF(__pyx_t_1);
6831 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6833 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 625; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6834 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6835 __pyx_t_3 = (!__pyx_t_4);
6838 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":626
6839 * if not self._isOpen(): raise ValueError( "I/O operation on closed file" )
6840 * if not 0 <= tid < self.samfile.header.n_targets:
6841 * raise ValueError( "tid %i out of range 0<=tid<%i" % (tid, self.samfile.header.n_targets ) ) # <<<<<<<<<<<<<<
6842 * return self.samfile.header.target_name[tid]
6845 __pyx_t_1 = __Pyx_PyInt_to_py_int32_t(((struct __pyx_obj_9csamtools_Samfile *)__pyx_v_self)->samfile->header->n_targets); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 626; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6846 __Pyx_GOTREF(__pyx_t_1);
6847 __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 626; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6848 __Pyx_GOTREF(__pyx_t_2);
6849 __Pyx_INCREF(__pyx_v_tid);
6850 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_tid);
6851 __Pyx_GIVEREF(__pyx_v_tid);
6852 PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
6853 __Pyx_GIVEREF(__pyx_t_1);
6855 __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_24), __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 626; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6856 __Pyx_GOTREF(((PyObject *)__pyx_t_1));
6857 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6858 __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 626; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6859 __Pyx_GOTREF(__pyx_t_2);
6860 PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_1));
6861 __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
6863 __pyx_t_1 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 626; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6864 __Pyx_GOTREF(__pyx_t_1);
6865 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6866 __Pyx_Raise(__pyx_t_1, 0, 0);
6867 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6868 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 626; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6873 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":627
6874 * if not 0 <= tid < self.samfile.header.n_targets:
6875 * raise ValueError( "tid %i out of range 0<=tid<%i" % (tid, self.samfile.header.n_targets ) )
6876 * return self.samfile.header.target_name[tid] # <<<<<<<<<<<<<<
6878 * cdef char * _getrname( self, int tid ):
6880 __Pyx_XDECREF(__pyx_r);
6881 __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_v_tid); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 627; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6882 __pyx_t_1 = PyBytes_FromString((((struct __pyx_obj_9csamtools_Samfile *)__pyx_v_self)->samfile->header->target_name[__pyx_t_5])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 627; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6883 __Pyx_GOTREF(((PyObject *)__pyx_t_1));
6884 __pyx_r = ((PyObject *)__pyx_t_1);
6888 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6891 __Pyx_XDECREF(__pyx_t_1);
6892 __Pyx_XDECREF(__pyx_t_2);
6893 __Pyx_AddTraceback("csamtools.Samfile.getrname");
6896 __Pyx_XGIVEREF(__pyx_r);
6897 __Pyx_TraceReturn(__pyx_r);
6898 __Pyx_RefNannyFinishContext();
6902 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":629
6903 * return self.samfile.header.target_name[tid]
6905 * cdef char * _getrname( self, int tid ): # <<<<<<<<<<<<<<
6907 * convert numerical :term:`tid` into :term:`reference` name.'''
6910 static char *__pyx_f_9csamtools_7Samfile__getrname(struct __pyx_obj_9csamtools_Samfile *__pyx_v_self, int __pyx_v_tid) {
6912 PyObject *__pyx_t_1 = NULL;
6913 PyObject *__pyx_t_2 = NULL;
6916 PyObject *__pyx_t_5 = NULL;
6917 __Pyx_TraceDeclarations
6918 __Pyx_RefNannySetupContext("_getrname");
6919 __Pyx_TraceCall("_getrname", __pyx_f[0], 629);
6921 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":632
6923 * convert numerical :term:`tid` into :term:`reference` name.'''
6924 * if not self._isOpen(): raise ValueError( "I/O operation on closed file" ) # <<<<<<<<<<<<<<
6925 * if not 0 <= tid < self.samfile.header.n_targets:
6926 * raise ValueError( "tid %i out of range 0<=tid<%i" % (tid, self.samfile.header.n_targets ) )
6928 __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s___isOpen); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 632; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6929 __Pyx_GOTREF(__pyx_t_1);
6930 __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 = 632; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6931 __Pyx_GOTREF(__pyx_t_2);
6932 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6933 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 632; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6934 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6935 __pyx_t_4 = (!__pyx_t_3);
6937 __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 632; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6938 __Pyx_GOTREF(__pyx_t_2);
6939 __Pyx_INCREF(((PyObject *)__pyx_kp_s_5));
6940 PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_5));
6941 __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_5));
6942 __pyx_t_1 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 632; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6943 __Pyx_GOTREF(__pyx_t_1);
6944 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6945 __Pyx_Raise(__pyx_t_1, 0, 0);
6946 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6947 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 632; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6952 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":633
6953 * convert numerical :term:`tid` into :term:`reference` name.'''
6954 * if not self._isOpen(): raise ValueError( "I/O operation on closed file" )
6955 * if not 0 <= tid < self.samfile.header.n_targets: # <<<<<<<<<<<<<<
6956 * raise ValueError( "tid %i out of range 0<=tid<%i" % (tid, self.samfile.header.n_targets ) )
6957 * return self.samfile.header.target_name[tid]
6959 __pyx_t_4 = (0 <= __pyx_v_tid);
6961 __pyx_t_4 = (__pyx_v_tid < __pyx_v_self->samfile->header->n_targets);
6963 __pyx_t_3 = (!__pyx_t_4);
6966 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":634
6967 * if not self._isOpen(): raise ValueError( "I/O operation on closed file" )
6968 * if not 0 <= tid < self.samfile.header.n_targets:
6969 * raise ValueError( "tid %i out of range 0<=tid<%i" % (tid, self.samfile.header.n_targets ) ) # <<<<<<<<<<<<<<
6970 * return self.samfile.header.target_name[tid]
6973 __pyx_t_1 = PyInt_FromLong(__pyx_v_tid); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 634; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6974 __Pyx_GOTREF(__pyx_t_1);
6975 __pyx_t_2 = __Pyx_PyInt_to_py_int32_t(__pyx_v_self->samfile->header->n_targets); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 634; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6976 __Pyx_GOTREF(__pyx_t_2);
6977 __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 634; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6978 __Pyx_GOTREF(__pyx_t_5);
6979 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
6980 __Pyx_GIVEREF(__pyx_t_1);
6981 PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
6982 __Pyx_GIVEREF(__pyx_t_2);
6985 __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_24), __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 634; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6986 __Pyx_GOTREF(((PyObject *)__pyx_t_2));
6987 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6988 __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 634; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6989 __Pyx_GOTREF(__pyx_t_5);
6990 PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_2));
6991 __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
6993 __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 634; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6994 __Pyx_GOTREF(__pyx_t_2);
6995 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6996 __Pyx_Raise(__pyx_t_2, 0, 0);
6997 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6998 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 634; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7003 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":635
7004 * if not 0 <= tid < self.samfile.header.n_targets:
7005 * raise ValueError( "tid %i out of range 0<=tid<%i" % (tid, self.samfile.header.n_targets ) )
7006 * return self.samfile.header.target_name[tid] # <<<<<<<<<<<<<<
7008 * def _parseRegion( self,
7010 __pyx_r = (__pyx_v_self->samfile->header->target_name[__pyx_v_tid]);
7016 __Pyx_XDECREF(__pyx_t_1);
7017 __Pyx_XDECREF(__pyx_t_2);
7018 __Pyx_XDECREF(__pyx_t_5);
7019 __Pyx_WriteUnraisable("csamtools.Samfile._getrname");
7022 __Pyx_TraceReturn(Py_None);
7023 __Pyx_RefNannyFinishContext();
7027 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":637
7028 * return self.samfile.header.target_name[tid]
7030 * def _parseRegion( self, # <<<<<<<<<<<<<<
7035 static PyObject *__pyx_pf_9csamtools_7Samfile__parseRegion(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
7036 static char __pyx_doc_9csamtools_7Samfile__parseRegion[] = "Samfile._parseRegion(self, reference=None, start=None, end=None, region=None)\n\n parse region information.\n\n raise ValueError for for invalid regions.\n\n returns a tuple of flag, tid, start and end. Flag indicates\n whether some coordinates were supplied.\n\n Note that regions are 1-based, while start,end are python coordinates.\n ";
7037 static PyObject *__pyx_pf_9csamtools_7Samfile__parseRegion(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
7038 PyObject *__pyx_v_reference = 0;
7039 PyObject *__pyx_v_start = 0;
7040 PyObject *__pyx_v_end = 0;
7041 PyObject *__pyx_v_region = 0;
7043 PY_LONG_LONG __pyx_v_rstart;
7044 PY_LONG_LONG __pyx_v_rend;
7045 PyObject *__pyx_v_parts;
7046 PyObject *__pyx_r = NULL;
7047 PyObject *__pyx_t_1 = NULL;
7049 PY_LONG_LONG __pyx_t_3;
7051 PyObject *__pyx_t_5 = NULL;
7052 PyObject *__pyx_t_6 = NULL;
7053 PyObject *__pyx_t_7 = NULL;
7054 PyObject *__pyx_t_8 = NULL;
7055 Py_ssize_t __pyx_t_9;
7057 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__reference,&__pyx_n_s__start,&__pyx_n_s__end,&__pyx_n_s__region,0};
7058 __Pyx_TraceDeclarations
7059 __Pyx_RefNannySetupContext("_parseRegion");
7060 __Pyx_TraceCall("_parseRegion", __pyx_f[0], 637);
7061 if (unlikely(__pyx_kwds)) {
7062 Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
7063 PyObject* values[4] = {0,0,0,0};
7065 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":638
7067 * def _parseRegion( self,
7068 * reference = None, # <<<<<<<<<<<<<<
7072 values[0] = ((PyObject *)Py_None);
7074 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":639
7075 * def _parseRegion( self,
7077 * start = None, # <<<<<<<<<<<<<<
7081 values[1] = ((PyObject *)Py_None);
7083 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":640
7086 * end = None, # <<<<<<<<<<<<<<
7090 values[2] = ((PyObject *)Py_None);
7092 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":641
7095 * region = None ): # <<<<<<<<<<<<<<
7097 * parse region information.
7099 values[3] = ((PyObject *)Py_None);
7100 switch (PyTuple_GET_SIZE(__pyx_args)) {
7101 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
7102 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
7103 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7104 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7106 default: goto __pyx_L5_argtuple_error;
7108 switch (PyTuple_GET_SIZE(__pyx_args)) {
7111 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__reference);
7112 if (value) { values[0] = value; kw_args--; }
7116 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__start);
7117 if (value) { values[1] = value; kw_args--; }
7121 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__end);
7122 if (value) { values[2] = value; kw_args--; }
7126 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__region);
7127 if (value) { values[3] = value; kw_args--; }
7130 if (unlikely(kw_args > 0)) {
7131 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "_parseRegion") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
7133 __pyx_v_reference = values[0];
7134 __pyx_v_start = values[1];
7135 __pyx_v_end = values[2];
7136 __pyx_v_region = values[3];
7139 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":638
7141 * def _parseRegion( self,
7142 * reference = None, # <<<<<<<<<<<<<<
7146 __pyx_v_reference = ((PyObject *)Py_None);
7148 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":639
7149 * def _parseRegion( self,
7151 * start = None, # <<<<<<<<<<<<<<
7155 __pyx_v_start = ((PyObject *)Py_None);
7157 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":640
7160 * end = None, # <<<<<<<<<<<<<<
7164 __pyx_v_end = ((PyObject *)Py_None);
7166 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":641
7169 * region = None ): # <<<<<<<<<<<<<<
7171 * parse region information.
7173 __pyx_v_region = ((PyObject *)Py_None);
7174 switch (PyTuple_GET_SIZE(__pyx_args)) {
7175 case 4: __pyx_v_region = PyTuple_GET_ITEM(__pyx_args, 3);
7176 case 3: __pyx_v_end = PyTuple_GET_ITEM(__pyx_args, 2);
7177 case 2: __pyx_v_start = PyTuple_GET_ITEM(__pyx_args, 1);
7178 case 1: __pyx_v_reference = PyTuple_GET_ITEM(__pyx_args, 0);
7180 default: goto __pyx_L5_argtuple_error;
7183 goto __pyx_L4_argument_unpacking_done;
7184 __pyx_L5_argtuple_error:;
7185 __Pyx_RaiseArgtupleInvalid("_parseRegion", 0, 0, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
7187 __Pyx_AddTraceback("csamtools.Samfile._parseRegion");
7188 __Pyx_RefNannyFinishContext();
7190 __pyx_L4_argument_unpacking_done:;
7191 __Pyx_INCREF(__pyx_v_reference);
7192 __pyx_v_parts = Py_None; __Pyx_INCREF(Py_None);
7194 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":660
7195 * cdef long long rend
7197 * rtid = -1 # <<<<<<<<<<<<<<
7203 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":661
7206 * rstart = 0 # <<<<<<<<<<<<<<
7212 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":662
7215 * rend = max_pos # <<<<<<<<<<<<<<
7219 __pyx_v_rend = __pyx_v_9csamtools_max_pos;
7221 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":663
7224 * if start != None: # <<<<<<<<<<<<<<
7228 __pyx_t_1 = PyObject_RichCompare(__pyx_v_start, Py_None, Py_NE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 663; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7229 __Pyx_GOTREF(__pyx_t_1);
7230 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 663; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7231 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7234 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":664
7237 * try: # <<<<<<<<<<<<<<
7239 * except OverflowError:
7242 PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb;
7243 __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb);
7244 __Pyx_XGOTREF(__pyx_save_exc_type);
7245 __Pyx_XGOTREF(__pyx_save_exc_value);
7246 __Pyx_XGOTREF(__pyx_save_exc_tb);
7249 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":665
7252 * rstart = start # <<<<<<<<<<<<<<
7253 * except OverflowError:
7254 * raise ValueError( 'start out of range (%i)' % start )
7256 __pyx_t_3 = __Pyx_PyInt_AsLongLong(__pyx_v_start); if (unlikely((__pyx_t_3 == (PY_LONG_LONG)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 665; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
7257 __pyx_v_rstart = __pyx_t_3;
7259 __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
7260 __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0;
7261 __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0;
7262 goto __pyx_L14_try_end;
7264 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
7266 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":666
7269 * except OverflowError: # <<<<<<<<<<<<<<
7270 * raise ValueError( 'start out of range (%i)' % start )
7273 __pyx_t_4 = PyErr_ExceptionMatches(__pyx_builtin_OverflowError);
7275 __Pyx_AddTraceback("csamtools.Samfile._parseRegion");
7276 if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_5, &__pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 666; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
7277 __Pyx_GOTREF(__pyx_t_1);
7278 __Pyx_GOTREF(__pyx_t_5);
7279 __Pyx_GOTREF(__pyx_t_6);
7281 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":667
7283 * except OverflowError:
7284 * raise ValueError( 'start out of range (%i)' % start ) # <<<<<<<<<<<<<<
7288 __pyx_t_7 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_9), __pyx_v_start); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 667; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
7289 __Pyx_GOTREF(((PyObject *)__pyx_t_7));
7290 __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 667; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
7291 __Pyx_GOTREF(__pyx_t_8);
7292 PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)__pyx_t_7));
7293 __Pyx_GIVEREF(((PyObject *)__pyx_t_7));
7295 __pyx_t_7 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 667; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
7296 __Pyx_GOTREF(__pyx_t_7);
7297 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7298 __Pyx_Raise(__pyx_t_7, 0, 0);
7299 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7300 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 667; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
7301 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7302 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7303 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7304 goto __pyx_L8_exception_handled;
7306 __pyx_L9_except_error:;
7307 __Pyx_XGIVEREF(__pyx_save_exc_type);
7308 __Pyx_XGIVEREF(__pyx_save_exc_value);
7309 __Pyx_XGIVEREF(__pyx_save_exc_tb);
7310 __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
7311 goto __pyx_L1_error;
7312 __pyx_L8_exception_handled:;
7313 __Pyx_XGIVEREF(__pyx_save_exc_type);
7314 __Pyx_XGIVEREF(__pyx_save_exc_value);
7315 __Pyx_XGIVEREF(__pyx_save_exc_tb);
7316 __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
7323 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":669
7324 * raise ValueError( 'start out of range (%i)' % start )
7326 * if end != None: # <<<<<<<<<<<<<<
7330 __pyx_t_6 = PyObject_RichCompare(__pyx_v_end, Py_None, Py_NE); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 669; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7331 __Pyx_GOTREF(__pyx_t_6);
7332 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 669; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7333 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7336 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":670
7339 * try: # <<<<<<<<<<<<<<
7341 * except OverflowError:
7344 PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb;
7345 __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb);
7346 __Pyx_XGOTREF(__pyx_save_exc_type);
7347 __Pyx_XGOTREF(__pyx_save_exc_value);
7348 __Pyx_XGOTREF(__pyx_save_exc_tb);
7351 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":671
7354 * rend = end # <<<<<<<<<<<<<<
7355 * except OverflowError:
7356 * raise ValueError( 'end out of range (%i)' % end )
7358 __pyx_t_3 = __Pyx_PyInt_AsLongLong(__pyx_v_end); if (unlikely((__pyx_t_3 == (PY_LONG_LONG)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 671; __pyx_clineno = __LINE__; goto __pyx_L18_error;}
7359 __pyx_v_rend = __pyx_t_3;
7361 __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
7362 __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0;
7363 __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0;
7364 goto __pyx_L25_try_end;
7366 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
7367 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
7368 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
7369 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
7370 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
7372 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":672
7375 * except OverflowError: # <<<<<<<<<<<<<<
7376 * raise ValueError( 'end out of range (%i)' % end )
7379 __pyx_t_4 = PyErr_ExceptionMatches(__pyx_builtin_OverflowError);
7381 __Pyx_AddTraceback("csamtools.Samfile._parseRegion");
7382 if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 672; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;}
7383 __Pyx_GOTREF(__pyx_t_6);
7384 __Pyx_GOTREF(__pyx_t_5);
7385 __Pyx_GOTREF(__pyx_t_1);
7387 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":673
7389 * except OverflowError:
7390 * raise ValueError( 'end out of range (%i)' % end ) # <<<<<<<<<<<<<<
7394 __pyx_t_7 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_10), __pyx_v_end); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;}
7395 __Pyx_GOTREF(((PyObject *)__pyx_t_7));
7396 __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;}
7397 __Pyx_GOTREF(__pyx_t_8);
7398 PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)__pyx_t_7));
7399 __Pyx_GIVEREF(((PyObject *)__pyx_t_7));
7401 __pyx_t_7 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;}
7402 __Pyx_GOTREF(__pyx_t_7);
7403 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7404 __Pyx_Raise(__pyx_t_7, 0, 0);
7405 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7406 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;}
7407 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7408 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7409 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7410 goto __pyx_L19_exception_handled;
7412 __pyx_L20_except_error:;
7413 __Pyx_XGIVEREF(__pyx_save_exc_type);
7414 __Pyx_XGIVEREF(__pyx_save_exc_value);
7415 __Pyx_XGIVEREF(__pyx_save_exc_tb);
7416 __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
7417 goto __pyx_L1_error;
7418 __pyx_L19_exception_handled:;
7419 __Pyx_XGIVEREF(__pyx_save_exc_type);
7420 __Pyx_XGIVEREF(__pyx_save_exc_value);
7421 __Pyx_XGIVEREF(__pyx_save_exc_tb);
7422 __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
7429 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":675
7430 * raise ValueError( 'end out of range (%i)' % end )
7432 * if region: # <<<<<<<<<<<<<<
7433 * parts = re.split( "[:-]", region )
7434 * reference = parts[0]
7436 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_region); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 675; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7439 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":676
7442 * parts = re.split( "[:-]", region ) # <<<<<<<<<<<<<<
7443 * reference = parts[0]
7444 * if len(parts) >= 2: rstart = int(parts[1]) - 1
7446 __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__re); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 676; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7447 __Pyx_GOTREF(__pyx_t_1);
7448 __pyx_t_5 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__split); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 676; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7449 __Pyx_GOTREF(__pyx_t_5);
7450 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7451 __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 676; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7452 __Pyx_GOTREF(__pyx_t_1);
7453 __Pyx_INCREF(((PyObject *)__pyx_kp_s_25));
7454 PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_kp_s_25));
7455 __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_25));
7456 __Pyx_INCREF(__pyx_v_region);
7457 PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_region);
7458 __Pyx_GIVEREF(__pyx_v_region);
7459 __pyx_t_6 = PyObject_Call(__pyx_t_5, __pyx_t_1, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 676; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7460 __Pyx_GOTREF(__pyx_t_6);
7461 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7462 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7463 __Pyx_DECREF(__pyx_v_parts);
7464 __pyx_v_parts = __pyx_t_6;
7467 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":677
7469 * parts = re.split( "[:-]", region )
7470 * reference = parts[0] # <<<<<<<<<<<<<<
7471 * if len(parts) >= 2: rstart = int(parts[1]) - 1
7472 * if len(parts) >= 3: rend = int(parts[2])
7474 __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_parts, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 677; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7475 __Pyx_GOTREF(__pyx_t_6);
7476 __Pyx_DECREF(__pyx_v_reference);
7477 __pyx_v_reference = __pyx_t_6;
7480 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":678
7481 * parts = re.split( "[:-]", region )
7482 * reference = parts[0]
7483 * if len(parts) >= 2: rstart = int(parts[1]) - 1 # <<<<<<<<<<<<<<
7484 * if len(parts) >= 3: rend = int(parts[2])
7487 __pyx_t_9 = PyObject_Length(__pyx_v_parts); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 678; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7488 __pyx_t_2 = (__pyx_t_9 >= 2);
7490 __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_parts, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 678; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7491 __Pyx_GOTREF(__pyx_t_6);
7492 __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 678; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7493 __Pyx_GOTREF(__pyx_t_1);
7494 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6);
7495 __Pyx_GIVEREF(__pyx_t_6);
7497 __pyx_t_6 = PyObject_Call(((PyObject *)((PyObject*)&PyInt_Type)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 678; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7498 __Pyx_GOTREF(__pyx_t_6);
7499 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7500 __pyx_t_1 = PyNumber_Subtract(__pyx_t_6, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 678; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7501 __Pyx_GOTREF(__pyx_t_1);
7502 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7503 __pyx_t_3 = __Pyx_PyInt_AsLongLong(__pyx_t_1); if (unlikely((__pyx_t_3 == (PY_LONG_LONG)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 678; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7504 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7505 __pyx_v_rstart = __pyx_t_3;
7510 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":679
7511 * reference = parts[0]
7512 * if len(parts) >= 2: rstart = int(parts[1]) - 1
7513 * if len(parts) >= 3: rend = int(parts[2]) # <<<<<<<<<<<<<<
7515 * if not reference: return 0, 0, 0, 0
7517 __pyx_t_9 = PyObject_Length(__pyx_v_parts); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 679; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7518 __pyx_t_2 = (__pyx_t_9 >= 3);
7520 __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_parts, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 679; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7521 __Pyx_GOTREF(__pyx_t_1);
7522 __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 679; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7523 __Pyx_GOTREF(__pyx_t_6);
7524 PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1);
7525 __Pyx_GIVEREF(__pyx_t_1);
7527 __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)&PyInt_Type)), __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 679; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7528 __Pyx_GOTREF(__pyx_t_1);
7529 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7530 __pyx_t_3 = __Pyx_PyInt_AsLongLong(__pyx_t_1); if (unlikely((__pyx_t_3 == (PY_LONG_LONG)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 679; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7531 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7532 __pyx_v_rend = __pyx_t_3;
7540 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":681
7541 * if len(parts) >= 3: rend = int(parts[2])
7543 * if not reference: return 0, 0, 0, 0 # <<<<<<<<<<<<<<
7545 * rtid = self.gettid( reference )
7547 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_reference); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 681; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7548 __pyx_t_10 = (!__pyx_t_2);
7550 __Pyx_XDECREF(__pyx_r);
7551 __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 681; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7552 __Pyx_GOTREF(__pyx_t_1);
7553 __Pyx_INCREF(__pyx_int_0);
7554 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_int_0);
7555 __Pyx_GIVEREF(__pyx_int_0);
7556 __Pyx_INCREF(__pyx_int_0);
7557 PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_0);
7558 __Pyx_GIVEREF(__pyx_int_0);
7559 __Pyx_INCREF(__pyx_int_0);
7560 PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_int_0);
7561 __Pyx_GIVEREF(__pyx_int_0);
7562 __Pyx_INCREF(__pyx_int_0);
7563 PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_int_0);
7564 __Pyx_GIVEREF(__pyx_int_0);
7565 __pyx_r = __pyx_t_1;
7572 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":683
7573 * if not reference: return 0, 0, 0, 0
7575 * rtid = self.gettid( reference ) # <<<<<<<<<<<<<<
7576 * if rtid < 0: raise ValueError( "invalid reference `%s`" % reference )
7577 * if rstart > rend: raise ValueError( 'invalid coordinates: start (%i) > end (%i)' % (rstart, rend) )
7579 __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__gettid); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 683; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7580 __Pyx_GOTREF(__pyx_t_1);
7581 __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 683; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7582 __Pyx_GOTREF(__pyx_t_6);
7583 __Pyx_INCREF(__pyx_v_reference);
7584 PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_reference);
7585 __Pyx_GIVEREF(__pyx_v_reference);
7586 __pyx_t_5 = PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 683; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7587 __Pyx_GOTREF(__pyx_t_5);
7588 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7589 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7590 __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_t_5); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 683; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7591 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7592 __pyx_v_rtid = __pyx_t_4;
7594 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":684
7596 * rtid = self.gettid( reference )
7597 * if rtid < 0: raise ValueError( "invalid reference `%s`" % reference ) # <<<<<<<<<<<<<<
7598 * if rstart > rend: raise ValueError( 'invalid coordinates: start (%i) > end (%i)' % (rstart, rend) )
7599 * if not 0 <= rstart < max_pos: raise ValueError( 'start out of range (%i)' % rstart )
7601 __pyx_t_10 = (__pyx_v_rtid < 0);
7603 __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_26), __pyx_v_reference); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 684; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7604 __Pyx_GOTREF(((PyObject *)__pyx_t_5));
7605 __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 684; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7606 __Pyx_GOTREF(__pyx_t_6);
7607 PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_t_5));
7608 __Pyx_GIVEREF(((PyObject *)__pyx_t_5));
7610 __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 684; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7611 __Pyx_GOTREF(__pyx_t_5);
7612 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7613 __Pyx_Raise(__pyx_t_5, 0, 0);
7614 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7615 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 684; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7620 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":685
7621 * rtid = self.gettid( reference )
7622 * if rtid < 0: raise ValueError( "invalid reference `%s`" % reference )
7623 * if rstart > rend: raise ValueError( 'invalid coordinates: start (%i) > end (%i)' % (rstart, rend) ) # <<<<<<<<<<<<<<
7624 * if not 0 <= rstart < max_pos: raise ValueError( 'start out of range (%i)' % rstart )
7625 * if not 0 <= rend <= max_pos: raise ValueError( 'end out of range (%i)' % rend )
7627 __pyx_t_10 = (__pyx_v_rstart > __pyx_v_rend);
7629 __pyx_t_5 = PyLong_FromLongLong(__pyx_v_rstart); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7630 __Pyx_GOTREF(__pyx_t_5);
7631 __pyx_t_6 = PyLong_FromLongLong(__pyx_v_rend); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7632 __Pyx_GOTREF(__pyx_t_6);
7633 __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7634 __Pyx_GOTREF(__pyx_t_1);
7635 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5);
7636 __Pyx_GIVEREF(__pyx_t_5);
7637 PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_6);
7638 __Pyx_GIVEREF(__pyx_t_6);
7641 __pyx_t_6 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_27), __pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7642 __Pyx_GOTREF(((PyObject *)__pyx_t_6));
7643 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7644 __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7645 __Pyx_GOTREF(__pyx_t_1);
7646 PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_6));
7647 __Pyx_GIVEREF(((PyObject *)__pyx_t_6));
7649 __pyx_t_6 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7650 __Pyx_GOTREF(__pyx_t_6);
7651 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7652 __Pyx_Raise(__pyx_t_6, 0, 0);
7653 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7654 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7659 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":686
7660 * if rtid < 0: raise ValueError( "invalid reference `%s`" % reference )
7661 * if rstart > rend: raise ValueError( 'invalid coordinates: start (%i) > end (%i)' % (rstart, rend) )
7662 * if not 0 <= rstart < max_pos: raise ValueError( 'start out of range (%i)' % rstart ) # <<<<<<<<<<<<<<
7663 * if not 0 <= rend <= max_pos: raise ValueError( 'end out of range (%i)' % rend )
7666 __pyx_t_10 = (0 <= __pyx_v_rstart);
7668 __pyx_t_10 = (__pyx_v_rstart < __pyx_v_9csamtools_max_pos);
7670 __pyx_t_2 = (!__pyx_t_10);
7672 __pyx_t_6 = PyLong_FromLongLong(__pyx_v_rstart); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 686; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7673 __Pyx_GOTREF(__pyx_t_6);
7674 __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_9), __pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 686; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7675 __Pyx_GOTREF(((PyObject *)__pyx_t_1));
7676 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7677 __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 686; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7678 __Pyx_GOTREF(__pyx_t_6);
7679 PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_t_1));
7680 __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
7682 __pyx_t_1 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 686; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7683 __Pyx_GOTREF(__pyx_t_1);
7684 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7685 __Pyx_Raise(__pyx_t_1, 0, 0);
7686 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7687 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 686; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7692 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":687
7693 * if rstart > rend: raise ValueError( 'invalid coordinates: start (%i) > end (%i)' % (rstart, rend) )
7694 * if not 0 <= rstart < max_pos: raise ValueError( 'start out of range (%i)' % rstart )
7695 * if not 0 <= rend <= max_pos: raise ValueError( 'end out of range (%i)' % rend ) # <<<<<<<<<<<<<<
7697 * return 1, rtid, rstart, rend
7699 __pyx_t_2 = (0 <= __pyx_v_rend);
7701 __pyx_t_2 = (__pyx_v_rend <= __pyx_v_9csamtools_max_pos);
7703 __pyx_t_10 = (!__pyx_t_2);
7705 __pyx_t_1 = PyLong_FromLongLong(__pyx_v_rend); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7706 __Pyx_GOTREF(__pyx_t_1);
7707 __pyx_t_6 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_10), __pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7708 __Pyx_GOTREF(((PyObject *)__pyx_t_6));
7709 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7710 __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7711 __Pyx_GOTREF(__pyx_t_1);
7712 PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_6));
7713 __Pyx_GIVEREF(((PyObject *)__pyx_t_6));
7715 __pyx_t_6 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7716 __Pyx_GOTREF(__pyx_t_6);
7717 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7718 __Pyx_Raise(__pyx_t_6, 0, 0);
7719 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7720 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7725 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":689
7726 * if not 0 <= rend <= max_pos: raise ValueError( 'end out of range (%i)' % rend )
7728 * return 1, rtid, rstart, rend # <<<<<<<<<<<<<<
7730 * def seek( self, uint64_t offset, int where = 0):
7732 __Pyx_XDECREF(__pyx_r);
7733 __pyx_t_6 = PyInt_FromLong(__pyx_v_rtid); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7734 __Pyx_GOTREF(__pyx_t_6);
7735 __pyx_t_1 = PyLong_FromLongLong(__pyx_v_rstart); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7736 __Pyx_GOTREF(__pyx_t_1);
7737 __pyx_t_5 = PyLong_FromLongLong(__pyx_v_rend); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7738 __Pyx_GOTREF(__pyx_t_5);
7739 __pyx_t_7 = PyTuple_New(4); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7740 __Pyx_GOTREF(__pyx_t_7);
7741 __Pyx_INCREF(__pyx_int_1);
7742 PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_int_1);
7743 __Pyx_GIVEREF(__pyx_int_1);
7744 PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6);
7745 __Pyx_GIVEREF(__pyx_t_6);
7746 PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_1);
7747 __Pyx_GIVEREF(__pyx_t_1);
7748 PyTuple_SET_ITEM(__pyx_t_7, 3, __pyx_t_5);
7749 __Pyx_GIVEREF(__pyx_t_5);
7753 __pyx_r = __pyx_t_7;
7757 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7760 __Pyx_XDECREF(__pyx_t_1);
7761 __Pyx_XDECREF(__pyx_t_5);
7762 __Pyx_XDECREF(__pyx_t_6);
7763 __Pyx_XDECREF(__pyx_t_7);
7764 __Pyx_XDECREF(__pyx_t_8);
7765 __Pyx_AddTraceback("csamtools.Samfile._parseRegion");
7768 __Pyx_DECREF(__pyx_v_parts);
7769 __Pyx_DECREF(__pyx_v_reference);
7770 __Pyx_XGIVEREF(__pyx_r);
7771 __Pyx_TraceReturn(__pyx_r);
7772 __Pyx_RefNannyFinishContext();
7776 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":691
7777 * return 1, rtid, rstart, rend
7779 * def seek( self, uint64_t offset, int where = 0): # <<<<<<<<<<<<<<
7781 * move file pointer to position *offset*, see :meth:`pysam.Samfile.tell`.
7784 static PyObject *__pyx_pf_9csamtools_7Samfile_seek(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
7785 static char __pyx_doc_9csamtools_7Samfile_seek[] = "Samfile.seek(self, uint64_t offset, int where=0)\n\n move file pointer to position *offset*, see :meth:`pysam.Samfile.tell`.\n ";
7786 static PyObject *__pyx_pf_9csamtools_7Samfile_seek(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
7787 uint64_t __pyx_v_offset;
7789 PyObject *__pyx_r = NULL;
7790 PyObject *__pyx_t_1 = NULL;
7791 PyObject *__pyx_t_2 = NULL;
7794 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__offset,&__pyx_n_s__where,0};
7795 __Pyx_TraceDeclarations
7796 __Pyx_RefNannySetupContext("seek");
7797 __Pyx_TraceCall("seek", __pyx_f[0], 691);
7798 if (unlikely(__pyx_kwds)) {
7799 Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
7800 PyObject* values[2] = {0,0};
7801 switch (PyTuple_GET_SIZE(__pyx_args)) {
7802 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7803 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7805 default: goto __pyx_L5_argtuple_error;
7807 switch (PyTuple_GET_SIZE(__pyx_args)) {
7809 values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__offset);
7810 if (likely(values[0])) kw_args--;
7811 else goto __pyx_L5_argtuple_error;
7814 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__where);
7815 if (value) { values[1] = value; kw_args--; }
7818 if (unlikely(kw_args > 0)) {
7819 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "seek") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
7821 __pyx_v_offset = __Pyx_PyInt_from_py_uint64_t(values[0]); if (unlikely((__pyx_v_offset == (uint64_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
7823 __pyx_v_where = __Pyx_PyInt_AsInt(values[1]); if (unlikely((__pyx_v_where == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
7825 __pyx_v_where = ((int)0);
7828 __pyx_v_where = ((int)0);
7829 switch (PyTuple_GET_SIZE(__pyx_args)) {
7830 case 2: __pyx_v_where = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely((__pyx_v_where == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
7831 case 1: __pyx_v_offset = __Pyx_PyInt_from_py_uint64_t(PyTuple_GET_ITEM(__pyx_args, 0)); if (unlikely((__pyx_v_offset == (uint64_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
7833 default: goto __pyx_L5_argtuple_error;
7836 goto __pyx_L4_argument_unpacking_done;
7837 __pyx_L5_argtuple_error:;
7838 __Pyx_RaiseArgtupleInvalid("seek", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
7840 __Pyx_AddTraceback("csamtools.Samfile.seek");
7841 __Pyx_RefNannyFinishContext();
7843 __pyx_L4_argument_unpacking_done:;
7845 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":696
7848 * if not self._isOpen(): # <<<<<<<<<<<<<<
7849 * raise ValueError( "I/O operation on closed file" )
7850 * if not self.isbam:
7852 __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___isOpen); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7853 __Pyx_GOTREF(__pyx_t_1);
7854 __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 = 696; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7855 __Pyx_GOTREF(__pyx_t_2);
7856 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7857 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7858 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7859 __pyx_t_4 = (!__pyx_t_3);
7862 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":697
7864 * if not self._isOpen():
7865 * raise ValueError( "I/O operation on closed file" ) # <<<<<<<<<<<<<<
7866 * if not self.isbam:
7867 * raise NotImplementedError("seek only available in bam files")
7869 __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 697; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7870 __Pyx_GOTREF(__pyx_t_2);
7871 __Pyx_INCREF(((PyObject *)__pyx_kp_s_5));
7872 PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_5));
7873 __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_5));
7874 __pyx_t_1 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 697; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7875 __Pyx_GOTREF(__pyx_t_1);
7876 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7877 __Pyx_Raise(__pyx_t_1, 0, 0);
7878 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7879 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 697; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7884 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":698
7885 * if not self._isOpen():
7886 * raise ValueError( "I/O operation on closed file" )
7887 * if not self.isbam: # <<<<<<<<<<<<<<
7888 * raise NotImplementedError("seek only available in bam files")
7889 * return bam_seek( self.samfile.x.bam, offset, where )
7891 __pyx_t_4 = (!((struct __pyx_obj_9csamtools_Samfile *)__pyx_v_self)->isbam);
7894 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":699
7895 * raise ValueError( "I/O operation on closed file" )
7896 * if not self.isbam:
7897 * raise NotImplementedError("seek only available in bam files") # <<<<<<<<<<<<<<
7898 * return bam_seek( self.samfile.x.bam, offset, where )
7901 __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 699; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7902 __Pyx_GOTREF(__pyx_t_1);
7903 __Pyx_INCREF(((PyObject *)__pyx_kp_s_28));
7904 PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_kp_s_28));
7905 __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_28));
7906 __pyx_t_2 = PyObject_Call(__pyx_builtin_NotImplementedError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 699; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7907 __Pyx_GOTREF(__pyx_t_2);
7908 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7909 __Pyx_Raise(__pyx_t_2, 0, 0);
7910 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7911 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 699; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7916 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":700
7917 * if not self.isbam:
7918 * raise NotImplementedError("seek only available in bam files")
7919 * return bam_seek( self.samfile.x.bam, offset, where ) # <<<<<<<<<<<<<<
7923 __Pyx_XDECREF(__pyx_r);
7924 __pyx_t_2 = __Pyx_PyInt_to_py_int64_t(bam_seek(((struct __pyx_obj_9csamtools_Samfile *)__pyx_v_self)->samfile->x.bam, __pyx_v_offset, __pyx_v_where)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 700; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7925 __Pyx_GOTREF(__pyx_t_2);
7926 __pyx_r = __pyx_t_2;
7930 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7933 __Pyx_XDECREF(__pyx_t_1);
7934 __Pyx_XDECREF(__pyx_t_2);
7935 __Pyx_AddTraceback("csamtools.Samfile.seek");
7938 __Pyx_XGIVEREF(__pyx_r);
7939 __Pyx_TraceReturn(__pyx_r);
7940 __Pyx_RefNannyFinishContext();
7944 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":702
7945 * return bam_seek( self.samfile.x.bam, offset, where )
7947 * def tell( self ): # <<<<<<<<<<<<<<
7949 * return current file position
7952 static PyObject *__pyx_pf_9csamtools_7Samfile_tell(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
7953 static char __pyx_doc_9csamtools_7Samfile_tell[] = "Samfile.tell(self)\n\n return current file position\n ";
7954 static PyObject *__pyx_pf_9csamtools_7Samfile_tell(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
7955 PyObject *__pyx_r = NULL;
7956 PyObject *__pyx_t_1 = NULL;
7957 PyObject *__pyx_t_2 = NULL;
7960 __Pyx_TraceDeclarations
7961 __Pyx_RefNannySetupContext("tell");
7962 __Pyx_TraceCall("tell", __pyx_f[0], 702);
7964 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":706
7965 * return current file position
7967 * if not self._isOpen(): # <<<<<<<<<<<<<<
7968 * raise ValueError( "I/O operation on closed file" )
7969 * if not self.isbam:
7971 __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___isOpen); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 706; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7972 __Pyx_GOTREF(__pyx_t_1);
7973 __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 = 706; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7974 __Pyx_GOTREF(__pyx_t_2);
7975 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7976 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 706; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7977 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7978 __pyx_t_4 = (!__pyx_t_3);
7981 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":707
7983 * if not self._isOpen():
7984 * raise ValueError( "I/O operation on closed file" ) # <<<<<<<<<<<<<<
7985 * if not self.isbam:
7986 * raise NotImplementedError("seek only available in bam files")
7988 __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 707; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7989 __Pyx_GOTREF(__pyx_t_2);
7990 __Pyx_INCREF(((PyObject *)__pyx_kp_s_5));
7991 PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_5));
7992 __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_5));
7993 __pyx_t_1 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 707; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7994 __Pyx_GOTREF(__pyx_t_1);
7995 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7996 __Pyx_Raise(__pyx_t_1, 0, 0);
7997 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7998 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 707; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8003 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":708
8004 * if not self._isOpen():
8005 * raise ValueError( "I/O operation on closed file" )
8006 * if not self.isbam: # <<<<<<<<<<<<<<
8007 * raise NotImplementedError("seek only available in bam files")
8010 __pyx_t_4 = (!((struct __pyx_obj_9csamtools_Samfile *)__pyx_v_self)->isbam);
8013 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":709
8014 * raise ValueError( "I/O operation on closed file" )
8015 * if not self.isbam:
8016 * raise NotImplementedError("seek only available in bam files") # <<<<<<<<<<<<<<
8018 * return bam_tell( self.samfile.x.bam )
8020 __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 709; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8021 __Pyx_GOTREF(__pyx_t_1);
8022 __Pyx_INCREF(((PyObject *)__pyx_kp_s_28));
8023 PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_kp_s_28));
8024 __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_28));
8025 __pyx_t_2 = PyObject_Call(__pyx_builtin_NotImplementedError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 709; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8026 __Pyx_GOTREF(__pyx_t_2);
8027 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8028 __Pyx_Raise(__pyx_t_2, 0, 0);
8029 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8030 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 709; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8035 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":711
8036 * raise NotImplementedError("seek only available in bam files")
8038 * return bam_tell( self.samfile.x.bam ) # <<<<<<<<<<<<<<
8042 __Pyx_XDECREF(__pyx_r);
8043 __pyx_t_2 = __Pyx_PyInt_to_py_int64_t(bam_tell(((struct __pyx_obj_9csamtools_Samfile *)__pyx_v_self)->samfile->x.bam)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 711; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8044 __Pyx_GOTREF(__pyx_t_2);
8045 __pyx_r = __pyx_t_2;
8049 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
8052 __Pyx_XDECREF(__pyx_t_1);
8053 __Pyx_XDECREF(__pyx_t_2);
8054 __Pyx_AddTraceback("csamtools.Samfile.tell");
8057 __Pyx_XGIVEREF(__pyx_r);
8058 __Pyx_TraceReturn(__pyx_r);
8059 __Pyx_RefNannyFinishContext();
8063 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":713
8064 * return bam_tell( self.samfile.x.bam )
8066 * def fetch( self, # <<<<<<<<<<<<<<
8071 static PyObject *__pyx_pf_9csamtools_7Samfile_fetch(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
8072 static char __pyx_doc_9csamtools_7Samfile_fetch[] = "Samfile.fetch(self, reference=None, start=None, end=None, region=None, callback=None, until_eof=False)\n\n fetch aligned reads in a :term:`region` using 0-based indexing. The region is specified by\n :term:`reference`, *start* and *end*. Alternatively, a samtools :term:`region` string can \n be supplied.\n\n Without *reference* or *region* all reads will be fetched. The reads will be returned\n ordered by reference sequence, which will not necessarily be the order within the file.\n If *until_eof* is given, all reads from the current file position will be returned\n *in order as they are within the file*. \n \n If only *reference* is set, all reads aligned to *reference* will be fetched.\n\n The method returns an iterator of type :class:`pysam.IteratorRow` unless\n a *callback is provided. If *callback* is given, the callback will be executed \n for each position within the :term:`region`. Note that callbacks currently work\n only, if *region* or *reference* is given.\n\n Note that a :term:`SAM` file does not allow random access. If *region* or *reference* are given,\n an exception is raised.\n ";
8073 static PyObject *__pyx_pf_9csamtools_7Samfile_fetch(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
8074 PyObject *__pyx_v_reference = 0;
8075 PyObject *__pyx_v_start = 0;
8076 PyObject *__pyx_v_end = 0;
8077 PyObject *__pyx_v_region = 0;
8078 PyObject *__pyx_v_callback = 0;
8079 PyObject *__pyx_v_until_eof = 0;
8083 int __pyx_v_has_coord;
8084 PyObject *__pyx_r = NULL;
8085 PyObject *__pyx_t_1 = NULL;
8086 PyObject *__pyx_t_2 = NULL;
8089 PyObject *__pyx_t_5 = NULL;
8090 PyObject *__pyx_t_6 = NULL;
8091 PyObject *__pyx_t_7 = NULL;
8096 PyObject *__pyx_t_12 = NULL;
8099 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__reference,&__pyx_n_s__start,&__pyx_n_s__end,&__pyx_n_s__region,&__pyx_n_s__callback,&__pyx_n_s__until_eof,0};
8100 __Pyx_TraceDeclarations
8101 __Pyx_RefNannySetupContext("fetch");
8102 __Pyx_TraceCall("fetch", __pyx_f[0], 713);
8103 if (unlikely(__pyx_kwds)) {
8104 Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
8105 PyObject* values[6] = {0,0,0,0,0,0};
8107 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":714
8110 * reference = None, # <<<<<<<<<<<<<<
8114 values[0] = ((PyObject *)Py_None);
8116 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":715
8119 * start = None, # <<<<<<<<<<<<<<
8123 values[1] = ((PyObject *)Py_None);
8125 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":716
8128 * end = None, # <<<<<<<<<<<<<<
8132 values[2] = ((PyObject *)Py_None);
8134 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":717
8137 * region = None, # <<<<<<<<<<<<<<
8139 * until_eof = False ):
8141 values[3] = ((PyObject *)Py_None);
8143 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":718
8146 * callback = None, # <<<<<<<<<<<<<<
8147 * until_eof = False ):
8150 values[4] = ((PyObject *)Py_None);
8151 values[5] = __pyx_k_29;
8152 switch (PyTuple_GET_SIZE(__pyx_args)) {
8153 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
8154 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
8155 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
8156 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
8157 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8158 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8160 default: goto __pyx_L5_argtuple_error;
8162 switch (PyTuple_GET_SIZE(__pyx_args)) {
8165 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__reference);
8166 if (value) { values[0] = value; kw_args--; }
8170 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__start);
8171 if (value) { values[1] = value; kw_args--; }
8175 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__end);
8176 if (value) { values[2] = value; kw_args--; }
8180 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__region);
8181 if (value) { values[3] = value; kw_args--; }
8185 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__callback);
8186 if (value) { values[4] = value; kw_args--; }
8190 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__until_eof);
8191 if (value) { values[5] = value; kw_args--; }
8194 if (unlikely(kw_args > 0)) {
8195 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "fetch") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
8197 __pyx_v_reference = values[0];
8198 __pyx_v_start = values[1];
8199 __pyx_v_end = values[2];
8200 __pyx_v_region = values[3];
8201 __pyx_v_callback = values[4];
8202 __pyx_v_until_eof = values[5];
8205 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":714
8208 * reference = None, # <<<<<<<<<<<<<<
8212 __pyx_v_reference = ((PyObject *)Py_None);
8214 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":715
8217 * start = None, # <<<<<<<<<<<<<<
8221 __pyx_v_start = ((PyObject *)Py_None);
8223 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":716
8226 * end = None, # <<<<<<<<<<<<<<
8230 __pyx_v_end = ((PyObject *)Py_None);
8232 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":717
8235 * region = None, # <<<<<<<<<<<<<<
8237 * until_eof = False ):
8239 __pyx_v_region = ((PyObject *)Py_None);
8241 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":718
8244 * callback = None, # <<<<<<<<<<<<<<
8245 * until_eof = False ):
8248 __pyx_v_callback = ((PyObject *)Py_None);
8249 __pyx_v_until_eof = __pyx_k_29;
8250 switch (PyTuple_GET_SIZE(__pyx_args)) {
8251 case 6: __pyx_v_until_eof = PyTuple_GET_ITEM(__pyx_args, 5);
8252 case 5: __pyx_v_callback = PyTuple_GET_ITEM(__pyx_args, 4);
8253 case 4: __pyx_v_region = PyTuple_GET_ITEM(__pyx_args, 3);
8254 case 3: __pyx_v_end = PyTuple_GET_ITEM(__pyx_args, 2);
8255 case 2: __pyx_v_start = PyTuple_GET_ITEM(__pyx_args, 1);
8256 case 1: __pyx_v_reference = PyTuple_GET_ITEM(__pyx_args, 0);
8258 default: goto __pyx_L5_argtuple_error;
8261 goto __pyx_L4_argument_unpacking_done;
8262 __pyx_L5_argtuple_error:;
8263 __Pyx_RaiseArgtupleInvalid("fetch", 0, 0, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
8265 __Pyx_AddTraceback("csamtools.Samfile.fetch");
8266 __Pyx_RefNannyFinishContext();
8268 __pyx_L4_argument_unpacking_done:;
8270 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":742
8271 * cdef int rtid, rstart, rend, has_coord
8273 * if not self._isOpen(): # <<<<<<<<<<<<<<
8274 * raise ValueError( "I/O operation on closed file" )
8277 __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___isOpen); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 742; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8278 __Pyx_GOTREF(__pyx_t_1);
8279 __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 = 742; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8280 __Pyx_GOTREF(__pyx_t_2);
8281 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8282 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 742; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8283 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8284 __pyx_t_4 = (!__pyx_t_3);
8287 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":743
8289 * if not self._isOpen():
8290 * raise ValueError( "I/O operation on closed file" ) # <<<<<<<<<<<<<<
8292 * has_coord, rtid, rstart, rend = self._parseRegion( reference, start, end, region )
8294 __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 743; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8295 __Pyx_GOTREF(__pyx_t_2);
8296 __Pyx_INCREF(((PyObject *)__pyx_kp_s_5));
8297 PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_5));
8298 __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_5));
8299 __pyx_t_1 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 743; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8300 __Pyx_GOTREF(__pyx_t_1);
8301 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8302 __Pyx_Raise(__pyx_t_1, 0, 0);
8303 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8304 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 743; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8309 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":745
8310 * raise ValueError( "I/O operation on closed file" )
8312 * has_coord, rtid, rstart, rend = self._parseRegion( reference, start, end, region ) # <<<<<<<<<<<<<<
8316 __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___parseRegion); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8317 __Pyx_GOTREF(__pyx_t_1);
8318 __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8319 __Pyx_GOTREF(__pyx_t_2);
8320 __Pyx_INCREF(__pyx_v_reference);
8321 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_reference);
8322 __Pyx_GIVEREF(__pyx_v_reference);
8323 __Pyx_INCREF(__pyx_v_start);
8324 PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_start);
8325 __Pyx_GIVEREF(__pyx_v_start);
8326 __Pyx_INCREF(__pyx_v_end);
8327 PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_end);
8328 __Pyx_GIVEREF(__pyx_v_end);
8329 __Pyx_INCREF(__pyx_v_region);
8330 PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_v_region);
8331 __Pyx_GIVEREF(__pyx_v_region);
8332 __pyx_t_5 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8333 __Pyx_GOTREF(__pyx_t_5);
8334 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8335 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8336 if (PyTuple_CheckExact(__pyx_t_5) && likely(PyTuple_GET_SIZE(__pyx_t_5) == 4)) {
8337 PyObject* tuple = __pyx_t_5;
8338 __pyx_t_2 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_2);
8339 __pyx_t_8 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8340 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8341 __pyx_t_1 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_1);
8342 __pyx_t_9 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8343 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8344 __pyx_t_6 = PyTuple_GET_ITEM(tuple, 2); __Pyx_INCREF(__pyx_t_6);
8345 __pyx_t_10 = __Pyx_PyInt_AsInt(__pyx_t_6); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8346 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8347 __pyx_t_7 = PyTuple_GET_ITEM(tuple, 3); __Pyx_INCREF(__pyx_t_7);
8348 __pyx_t_11 = __Pyx_PyInt_AsInt(__pyx_t_7); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8349 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
8350 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8351 __pyx_v_has_coord = __pyx_t_8;
8352 __pyx_v_rtid = __pyx_t_9;
8353 __pyx_v_rstart = __pyx_t_10;
8354 __pyx_v_rend = __pyx_t_11;
8356 __pyx_t_12 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8357 __Pyx_GOTREF(__pyx_t_12);
8358 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8359 __pyx_t_2 = __Pyx_UnpackItem(__pyx_t_12, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8360 __Pyx_GOTREF(__pyx_t_2);
8361 __pyx_t_11 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8362 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8363 __pyx_t_1 = __Pyx_UnpackItem(__pyx_t_12, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8364 __Pyx_GOTREF(__pyx_t_1);
8365 __pyx_t_10 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8366 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8367 __pyx_t_6 = __Pyx_UnpackItem(__pyx_t_12, 2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8368 __Pyx_GOTREF(__pyx_t_6);
8369 __pyx_t_9 = __Pyx_PyInt_AsInt(__pyx_t_6); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8370 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8371 __pyx_t_7 = __Pyx_UnpackItem(__pyx_t_12, 3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8372 __Pyx_GOTREF(__pyx_t_7);
8373 __pyx_t_8 = __Pyx_PyInt_AsInt(__pyx_t_7); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8374 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
8375 if (__Pyx_EndUnpack(__pyx_t_12, 4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8376 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
8377 __pyx_v_has_coord = __pyx_t_11;
8378 __pyx_v_rtid = __pyx_t_10;
8379 __pyx_v_rstart = __pyx_t_9;
8380 __pyx_v_rend = __pyx_t_8;
8383 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":747
8384 * has_coord, rtid, rstart, rend = self._parseRegion( reference, start, end, region )
8386 * if self.isbam: # <<<<<<<<<<<<<<
8387 * if not until_eof and not self._hasIndex() and not self.isremote:
8388 * raise ValueError( "fetch called on bamfile without index" )
8390 if (((struct __pyx_obj_9csamtools_Samfile *)__pyx_v_self)->isbam) {
8392 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":748
8395 * if not until_eof and not self._hasIndex() and not self.isremote: # <<<<<<<<<<<<<<
8396 * raise ValueError( "fetch called on bamfile without index" )
8399 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_until_eof); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 748; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8400 __pyx_t_3 = (!__pyx_t_4);
8402 __pyx_t_5 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___hasIndex); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 748; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8403 __Pyx_GOTREF(__pyx_t_5);
8404 __pyx_t_7 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 748; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8405 __Pyx_GOTREF(__pyx_t_7);
8406 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8407 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 748; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8408 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
8409 __pyx_t_13 = (!__pyx_t_4);
8411 __pyx_t_4 = (!((struct __pyx_obj_9csamtools_Samfile *)__pyx_v_self)->isremote);
8412 __pyx_t_14 = __pyx_t_4;
8414 __pyx_t_14 = __pyx_t_13;
8416 __pyx_t_13 = __pyx_t_14;
8418 __pyx_t_13 = __pyx_t_3;
8422 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":749
8424 * if not until_eof and not self._hasIndex() and not self.isremote:
8425 * raise ValueError( "fetch called on bamfile without index" ) # <<<<<<<<<<<<<<
8429 __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 749; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8430 __Pyx_GOTREF(__pyx_t_7);
8431 __Pyx_INCREF(((PyObject *)__pyx_kp_s_30));
8432 PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_kp_s_30));
8433 __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_30));
8434 __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_7, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 749; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8435 __Pyx_GOTREF(__pyx_t_5);
8436 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
8437 __Pyx_Raise(__pyx_t_5, 0, 0);
8438 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8439 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 749; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8444 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":751
8445 * raise ValueError( "fetch called on bamfile without index" )
8447 * if callback: # <<<<<<<<<<<<<<
8448 * if not has_coord: raise ValueError( "callback functionality requires a region/reference" )
8449 * if not self._hasIndex(): raise ValueError( "no index available for fetch" )
8451 __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_v_callback); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 751; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8454 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":752
8457 * if not has_coord: raise ValueError( "callback functionality requires a region/reference" ) # <<<<<<<<<<<<<<
8458 * if not self._hasIndex(): raise ValueError( "no index available for fetch" )
8459 * return bam_fetch(self.samfile.x.bam,
8461 __pyx_t_13 = (!__pyx_v_has_coord);
8463 __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 752; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8464 __Pyx_GOTREF(__pyx_t_5);
8465 __Pyx_INCREF(((PyObject *)__pyx_kp_s_31));
8466 PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_kp_s_31));
8467 __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_31));
8468 __pyx_t_7 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 752; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8469 __Pyx_GOTREF(__pyx_t_7);
8470 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8471 __Pyx_Raise(__pyx_t_7, 0, 0);
8472 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
8473 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 752; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8478 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":753
8480 * if not has_coord: raise ValueError( "callback functionality requires a region/reference" )
8481 * if not self._hasIndex(): raise ValueError( "no index available for fetch" ) # <<<<<<<<<<<<<<
8482 * return bam_fetch(self.samfile.x.bam,
8485 __pyx_t_7 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___hasIndex); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8486 __Pyx_GOTREF(__pyx_t_7);
8487 __pyx_t_5 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8488 __Pyx_GOTREF(__pyx_t_5);
8489 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
8490 __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8491 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8492 __pyx_t_3 = (!__pyx_t_13);
8494 __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8495 __Pyx_GOTREF(__pyx_t_5);
8496 __Pyx_INCREF(((PyObject *)__pyx_kp_s_32));
8497 PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_kp_s_32));
8498 __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_32));
8499 __pyx_t_7 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8500 __Pyx_GOTREF(__pyx_t_7);
8501 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8502 __Pyx_Raise(__pyx_t_7, 0, 0);
8503 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
8504 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8509 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":754
8510 * if not has_coord: raise ValueError( "callback functionality requires a region/reference" )
8511 * if not self._hasIndex(): raise ValueError( "no index available for fetch" )
8512 * return bam_fetch(self.samfile.x.bam, # <<<<<<<<<<<<<<
8516 __Pyx_XDECREF(__pyx_r);
8518 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":760
8521 * fetch_callback ) # <<<<<<<<<<<<<<
8525 __pyx_t_7 = PyInt_FromLong(bam_fetch(((struct __pyx_obj_9csamtools_Samfile *)__pyx_v_self)->samfile->x.bam, ((struct __pyx_obj_9csamtools_Samfile *)__pyx_v_self)->index, __pyx_v_rtid, __pyx_v_rstart, __pyx_v_rend, ((void *)__pyx_v_callback), __pyx_f_9csamtools_fetch_callback)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 754; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8526 __Pyx_GOTREF(__pyx_t_7);
8527 __pyx_r = __pyx_t_7;
8534 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":762
8537 * if has_coord: # <<<<<<<<<<<<<<
8538 * return IteratorRowRegion( self, rtid, rstart, rend )
8541 if (__pyx_v_has_coord) {
8543 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":763
8546 * return IteratorRowRegion( self, rtid, rstart, rend ) # <<<<<<<<<<<<<<
8550 __Pyx_XDECREF(__pyx_r);
8551 __pyx_t_7 = PyInt_FromLong(__pyx_v_rtid); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 763; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8552 __Pyx_GOTREF(__pyx_t_7);
8553 __pyx_t_5 = PyInt_FromLong(__pyx_v_rstart); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 763; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8554 __Pyx_GOTREF(__pyx_t_5);
8555 __pyx_t_6 = PyInt_FromLong(__pyx_v_rend); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 763; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8556 __Pyx_GOTREF(__pyx_t_6);
8557 __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 763; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8558 __Pyx_GOTREF(__pyx_t_1);
8559 __Pyx_INCREF(__pyx_v_self);
8560 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self);
8561 __Pyx_GIVEREF(__pyx_v_self);
8562 PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_7);
8563 __Pyx_GIVEREF(__pyx_t_7);
8564 PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_5);
8565 __Pyx_GIVEREF(__pyx_t_5);
8566 PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_6);
8567 __Pyx_GIVEREF(__pyx_t_6);
8571 __pyx_t_6 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_9csamtools_IteratorRowRegion)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 763; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8572 __Pyx_GOTREF(__pyx_t_6);
8573 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8574 __pyx_r = __pyx_t_6;
8581 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":765
8582 * return IteratorRowRegion( self, rtid, rstart, rend )
8584 * if until_eof: # <<<<<<<<<<<<<<
8585 * return IteratorRowAll( self )
8588 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_until_eof); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 765; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8591 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":766
8594 * return IteratorRowAll( self ) # <<<<<<<<<<<<<<
8596 * return IteratorRowAllRefs(self)
8598 __Pyx_XDECREF(__pyx_r);
8599 __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 766; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8600 __Pyx_GOTREF(__pyx_t_6);
8601 __Pyx_INCREF(__pyx_v_self);
8602 PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_self);
8603 __Pyx_GIVEREF(__pyx_v_self);
8604 __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_9csamtools_IteratorRowAll)), __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 766; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8605 __Pyx_GOTREF(__pyx_t_1);
8606 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8607 __pyx_r = __pyx_t_1;
8614 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":768
8615 * return IteratorRowAll( self )
8617 * return IteratorRowAllRefs(self) # <<<<<<<<<<<<<<
8619 * # check if header is present - otherwise sam_read1 aborts
8621 __Pyx_XDECREF(__pyx_r);
8622 __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 768; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8623 __Pyx_GOTREF(__pyx_t_1);
8624 __Pyx_INCREF(__pyx_v_self);
8625 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self);
8626 __Pyx_GIVEREF(__pyx_v_self);
8627 __pyx_t_6 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_9csamtools_IteratorRowAllRefs)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 768; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8628 __Pyx_GOTREF(__pyx_t_6);
8629 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8630 __pyx_r = __pyx_t_6;
8643 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":772
8644 * # check if header is present - otherwise sam_read1 aborts
8645 * # this happens if a bamfile is opened with mode 'r'
8646 * if self.samfile.header.n_targets == 0: # <<<<<<<<<<<<<<
8647 * raise ValueError( "fetch called for samfile without header")
8650 __pyx_t_3 = (((struct __pyx_obj_9csamtools_Samfile *)__pyx_v_self)->samfile->header->n_targets == 0);
8653 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":773
8654 * # this happens if a bamfile is opened with mode 'r'
8655 * if self.samfile.header.n_targets == 0:
8656 * raise ValueError( "fetch called for samfile without header") # <<<<<<<<<<<<<<
8658 * if region != None:
8660 __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8661 __Pyx_GOTREF(__pyx_t_6);
8662 __Pyx_INCREF(((PyObject *)__pyx_kp_s_33));
8663 PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_kp_s_33));
8664 __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_33));
8665 __pyx_t_1 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8666 __Pyx_GOTREF(__pyx_t_1);
8667 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8668 __Pyx_Raise(__pyx_t_1, 0, 0);
8669 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8670 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8675 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":775
8676 * raise ValueError( "fetch called for samfile without header")
8678 * if region != None: # <<<<<<<<<<<<<<
8679 * raise ValueError ("fetch for a region is not available for sam files" )
8682 __pyx_t_1 = PyObject_RichCompare(__pyx_v_region, Py_None, Py_NE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 775; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8683 __Pyx_GOTREF(__pyx_t_1);
8684 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 775; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8685 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8688 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":776
8690 * if region != None:
8691 * raise ValueError ("fetch for a region is not available for sam files" ) # <<<<<<<<<<<<<<
8693 * raise NotImplementedError( "callback not implemented yet" )
8695 __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8696 __Pyx_GOTREF(__pyx_t_1);
8697 __Pyx_INCREF(((PyObject *)__pyx_kp_s_34));
8698 PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_kp_s_34));
8699 __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_34));
8700 __pyx_t_6 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8701 __Pyx_GOTREF(__pyx_t_6);
8702 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8703 __Pyx_Raise(__pyx_t_6, 0, 0);
8704 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8705 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8710 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":777
8711 * if region != None:
8712 * raise ValueError ("fetch for a region is not available for sam files" )
8713 * if callback: # <<<<<<<<<<<<<<
8714 * raise NotImplementedError( "callback not implemented yet" )
8717 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_callback); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8720 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":778
8721 * raise ValueError ("fetch for a region is not available for sam files" )
8723 * raise NotImplementedError( "callback not implemented yet" ) # <<<<<<<<<<<<<<
8725 * return IteratorRowAll( self )
8727 __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 778; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8728 __Pyx_GOTREF(__pyx_t_6);
8729 __Pyx_INCREF(((PyObject *)__pyx_kp_s_35));
8730 PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_kp_s_35));
8731 __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_35));
8732 __pyx_t_1 = PyObject_Call(__pyx_builtin_NotImplementedError, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 778; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8733 __Pyx_GOTREF(__pyx_t_1);
8734 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8735 __Pyx_Raise(__pyx_t_1, 0, 0);
8736 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8737 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 778; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8742 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":780
8743 * raise NotImplementedError( "callback not implemented yet" )
8745 * return IteratorRowAll( self ) # <<<<<<<<<<<<<<
8749 __Pyx_XDECREF(__pyx_r);
8750 __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8751 __Pyx_GOTREF(__pyx_t_1);
8752 __Pyx_INCREF(__pyx_v_self);
8753 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self);
8754 __Pyx_GIVEREF(__pyx_v_self);
8755 __pyx_t_6 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_9csamtools_IteratorRowAll)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8756 __Pyx_GOTREF(__pyx_t_6);
8757 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8758 __pyx_r = __pyx_t_6;
8766 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
8769 __Pyx_XDECREF(__pyx_t_1);
8770 __Pyx_XDECREF(__pyx_t_2);
8771 __Pyx_XDECREF(__pyx_t_5);
8772 __Pyx_XDECREF(__pyx_t_6);
8773 __Pyx_XDECREF(__pyx_t_7);
8774 __Pyx_XDECREF(__pyx_t_12);
8775 __Pyx_AddTraceback("csamtools.Samfile.fetch");
8778 __Pyx_XGIVEREF(__pyx_r);
8779 __Pyx_TraceReturn(__pyx_r);
8780 __Pyx_RefNannyFinishContext();
8784 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":782
8785 * return IteratorRowAll( self )
8787 * def mate( self, # <<<<<<<<<<<<<<
8788 * AlignedRead read ):
8789 * '''return the mate of :class:`AlignedRead` *read*.
8792 static PyObject *__pyx_pf_9csamtools_7Samfile_mate(PyObject *__pyx_v_self, PyObject *__pyx_v_read); /*proto*/
8793 static char __pyx_doc_9csamtools_7Samfile_mate[] = "Samfile.mate(self, AlignedRead read)\nreturn the mate of :class:`AlignedRead` *read*.\n\n Throws a ValueError if read is unpaired or the mate\n is unmapped.\n\n .. note::\n Calling this method will change the file position.\n This might interfere with any iterators that have\n not re-opened the file.\n\n ";
8794 static PyObject *__pyx_pf_9csamtools_7Samfile_mate(PyObject *__pyx_v_self, PyObject *__pyx_v_read) {
8795 uint32_t __pyx_v_flag;
8796 __pyx_t_9csamtools_MateData __pyx_v_mate_data;
8798 struct __pyx_obj_9csamtools_AlignedRead *__pyx_v_dest = 0;
8799 PyObject *__pyx_r = NULL;
8801 PyObject *__pyx_t_2 = NULL;
8802 PyObject *__pyx_t_3 = NULL;
8803 __Pyx_TraceDeclarations
8804 __Pyx_RefNannySetupContext("mate");
8805 __Pyx_TraceCall("mate", __pyx_f[0], 782);
8806 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_read), __pyx_ptype_9csamtools_AlignedRead, 1, "read", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 783; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8808 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":795
8811 * cdef uint32_t flag = read._delegate.core.flag # <<<<<<<<<<<<<<
8813 * if flag & BAM_FPAIRED == 0:
8815 __pyx_v_flag = ((struct __pyx_obj_9csamtools_AlignedRead *)__pyx_v_read)->_delegate->core.flag;
8817 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":797
8818 * cdef uint32_t flag = read._delegate.core.flag
8820 * if flag & BAM_FPAIRED == 0: # <<<<<<<<<<<<<<
8821 * raise ValueError( "read %s: is unpaired" % (read.qname))
8822 * if flag & BAM_FMUNMAP != 0:
8824 __pyx_t_1 = ((__pyx_v_flag & 1) == 0);
8827 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":798
8829 * if flag & BAM_FPAIRED == 0:
8830 * raise ValueError( "read %s: is unpaired" % (read.qname)) # <<<<<<<<<<<<<<
8831 * if flag & BAM_FMUNMAP != 0:
8832 * raise ValueError( "mate %s: is unmapped" % (read.qname))
8834 __pyx_t_2 = PyObject_GetAttr(__pyx_v_read, __pyx_n_s__qname); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8835 __Pyx_GOTREF(__pyx_t_2);
8836 __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_36), __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8837 __Pyx_GOTREF(((PyObject *)__pyx_t_3));
8838 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8839 __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8840 __Pyx_GOTREF(__pyx_t_2);
8841 PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_3));
8842 __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
8844 __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8845 __Pyx_GOTREF(__pyx_t_3);
8846 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8847 __Pyx_Raise(__pyx_t_3, 0, 0);
8848 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8849 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8854 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":799
8855 * if flag & BAM_FPAIRED == 0:
8856 * raise ValueError( "read %s: is unpaired" % (read.qname))
8857 * if flag & BAM_FMUNMAP != 0: # <<<<<<<<<<<<<<
8858 * raise ValueError( "mate %s: is unmapped" % (read.qname))
8861 __pyx_t_1 = ((__pyx_v_flag & 8) != 0);
8864 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":800
8865 * raise ValueError( "read %s: is unpaired" % (read.qname))
8866 * if flag & BAM_FMUNMAP != 0:
8867 * raise ValueError( "mate %s: is unmapped" % (read.qname)) # <<<<<<<<<<<<<<
8869 * cdef MateData mate_data
8871 __pyx_t_3 = PyObject_GetAttr(__pyx_v_read, __pyx_n_s__qname); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8872 __Pyx_GOTREF(__pyx_t_3);
8873 __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_37), __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8874 __Pyx_GOTREF(((PyObject *)__pyx_t_2));
8875 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8876 __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8877 __Pyx_GOTREF(__pyx_t_3);
8878 PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_2));
8879 __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
8881 __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8882 __Pyx_GOTREF(__pyx_t_2);
8883 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8884 __Pyx_Raise(__pyx_t_2, 0, 0);
8885 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8886 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8891 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":804
8892 * cdef MateData mate_data
8894 * mate_data.name = <char *>bam1_qname(read._delegate) # <<<<<<<<<<<<<<
8895 * mate_data.mate = NULL
8896 * # xor flags to get the other mate
8898 __pyx_v_mate_data.name = bam1_qname(((struct __pyx_obj_9csamtools_AlignedRead *)__pyx_v_read)->_delegate);
8900 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":805
8902 * mate_data.name = <char *>bam1_qname(read._delegate)
8903 * mate_data.mate = NULL # <<<<<<<<<<<<<<
8904 * # xor flags to get the other mate
8905 * cdef int x = BAM_FREAD1 + BAM_FREAD2
8907 __pyx_v_mate_data.mate = NULL;
8909 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":807
8910 * mate_data.mate = NULL
8911 * # xor flags to get the other mate
8912 * cdef int x = BAM_FREAD1 + BAM_FREAD2 # <<<<<<<<<<<<<<
8913 * mate_data.flag = ( flag ^ x) & x
8918 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":808
8919 * # xor flags to get the other mate
8920 * cdef int x = BAM_FREAD1 + BAM_FREAD2
8921 * mate_data.flag = ( flag ^ x) & x # <<<<<<<<<<<<<<
8923 * bam_fetch(self.samfile.x.bam,
8925 __pyx_v_mate_data.flag = ((__pyx_v_flag ^ __pyx_v_x) & __pyx_v_x);
8927 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":816
8928 * read._delegate.core.mpos + 1,
8929 * <void*>&mate_data,
8930 * mate_callback ) # <<<<<<<<<<<<<<
8932 * if mate_data.mate == NULL:
8934 bam_fetch(((struct __pyx_obj_9csamtools_Samfile *)__pyx_v_self)->samfile->x.bam, ((struct __pyx_obj_9csamtools_Samfile *)__pyx_v_self)->index, ((struct __pyx_obj_9csamtools_AlignedRead *)__pyx_v_read)->_delegate->core.mtid, ((struct __pyx_obj_9csamtools_AlignedRead *)__pyx_v_read)->_delegate->core.mpos, (((struct __pyx_obj_9csamtools_AlignedRead *)__pyx_v_read)->_delegate->core.mpos + 1), ((void *)(&__pyx_v_mate_data)), __pyx_f_9csamtools_mate_callback);
8936 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":818
8939 * if mate_data.mate == NULL: # <<<<<<<<<<<<<<
8940 * raise ValueError( "mate not found" )
8943 __pyx_t_1 = (__pyx_v_mate_data.mate == NULL);
8946 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":819
8948 * if mate_data.mate == NULL:
8949 * raise ValueError( "mate not found" ) # <<<<<<<<<<<<<<
8951 * cdef AlignedRead dest = AlignedRead.__new__(AlignedRead)
8953 __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8954 __Pyx_GOTREF(__pyx_t_2);
8955 __Pyx_INCREF(((PyObject *)__pyx_kp_s_38));
8956 PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_38));
8957 __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_38));
8958 __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8959 __Pyx_GOTREF(__pyx_t_3);
8960 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8961 __Pyx_Raise(__pyx_t_3, 0, 0);
8962 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8963 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8968 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":821
8969 * raise ValueError( "mate not found" )
8971 * cdef AlignedRead dest = AlignedRead.__new__(AlignedRead) # <<<<<<<<<<<<<<
8972 * dest._delegate = mate_data.mate
8975 __pyx_t_3 = __Pyx_tp_new(((PyObject*)__pyx_ptype_9csamtools_AlignedRead)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8976 __Pyx_GOTREF(__pyx_t_3);
8977 if (!(likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_9csamtools_AlignedRead)))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8978 __pyx_v_dest = ((struct __pyx_obj_9csamtools_AlignedRead *)__pyx_t_3);
8981 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":822
8983 * cdef AlignedRead dest = AlignedRead.__new__(AlignedRead)
8984 * dest._delegate = mate_data.mate # <<<<<<<<<<<<<<
8988 __pyx_v_dest->_delegate = __pyx_v_mate_data.mate;
8990 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":823
8991 * cdef AlignedRead dest = AlignedRead.__new__(AlignedRead)
8992 * dest._delegate = mate_data.mate
8993 * return dest # <<<<<<<<<<<<<<
8997 __Pyx_XDECREF(__pyx_r);
8998 __Pyx_INCREF(((PyObject *)__pyx_v_dest));
8999 __pyx_r = ((PyObject *)__pyx_v_dest);
9002 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9005 __Pyx_XDECREF(__pyx_t_2);
9006 __Pyx_XDECREF(__pyx_t_3);
9007 __Pyx_AddTraceback("csamtools.Samfile.mate");
9010 __Pyx_XDECREF((PyObject *)__pyx_v_dest);
9011 __Pyx_XGIVEREF(__pyx_r);
9012 __Pyx_TraceReturn(__pyx_r);
9013 __Pyx_RefNannyFinishContext();
9017 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":825
9020 * def count( self, # <<<<<<<<<<<<<<
9025 static PyObject *__pyx_pf_9csamtools_7Samfile_count(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
9026 static char __pyx_doc_9csamtools_7Samfile_count[] = "Samfile.count(self, reference=None, start=None, end=None, region=None, until_eof=False)\n*(reference = None, start = None, end = None, region = None, callback = None, until_eof = False)*\n \n count reads :term:`region` using 0-based indexing. The region is specified by\n :term:`reference`, *start* and *end*. Alternatively, a samtools :term:`region` string can be supplied.\n\n Note that a :term:`TAM` file does not allow random access. If *region* or *reference* are given,\n an exception is raised.\n ";
9027 static PyObject *__pyx_pf_9csamtools_7Samfile_count(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
9028 PyObject *__pyx_v_reference = 0;
9029 PyObject *__pyx_v_start = 0;
9030 PyObject *__pyx_v_end = 0;
9031 PyObject *__pyx_v_region = 0;
9032 PyObject *__pyx_v_until_eof = 0;
9036 int __pyx_v_counter;
9037 PyObject *__pyx_r = NULL;
9038 PyObject *__pyx_t_1 = NULL;
9039 PyObject *__pyx_t_2 = NULL;
9042 PyObject *__pyx_t_5 = NULL;
9043 PyObject *__pyx_t_6 = NULL;
9044 PyObject *__pyx_t_7 = NULL;
9048 PyObject *__pyx_t_11 = NULL;
9051 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__reference,&__pyx_n_s__start,&__pyx_n_s__end,&__pyx_n_s__region,&__pyx_n_s__until_eof,0};
9052 __Pyx_TraceDeclarations
9053 __Pyx_RefNannySetupContext("count");
9054 __Pyx_TraceCall("count", __pyx_f[0], 825);
9055 if (unlikely(__pyx_kwds)) {
9056 Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
9057 PyObject* values[5] = {0,0,0,0,0};
9059 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":826
9062 * reference = None, # <<<<<<<<<<<<<<
9066 values[0] = ((PyObject *)Py_None);
9068 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":827
9071 * start = None, # <<<<<<<<<<<<<<
9075 values[1] = ((PyObject *)Py_None);
9077 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":828
9080 * end = None, # <<<<<<<<<<<<<<
9082 * until_eof = False ):
9084 values[2] = ((PyObject *)Py_None);
9086 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":829
9089 * region = None, # <<<<<<<<<<<<<<
9090 * until_eof = False ):
9091 * '''*(reference = None, start = None, end = None, region = None, callback = None, until_eof = False)*
9093 values[3] = ((PyObject *)Py_None);
9094 values[4] = __pyx_k_39;
9095 switch (PyTuple_GET_SIZE(__pyx_args)) {
9096 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
9097 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
9098 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
9099 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
9100 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9102 default: goto __pyx_L5_argtuple_error;
9104 switch (PyTuple_GET_SIZE(__pyx_args)) {
9107 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__reference);
9108 if (value) { values[0] = value; kw_args--; }
9112 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__start);
9113 if (value) { values[1] = value; kw_args--; }
9117 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__end);
9118 if (value) { values[2] = value; kw_args--; }
9122 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__region);
9123 if (value) { values[3] = value; kw_args--; }
9127 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__until_eof);
9128 if (value) { values[4] = value; kw_args--; }
9131 if (unlikely(kw_args > 0)) {
9132 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "count") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
9134 __pyx_v_reference = values[0];
9135 __pyx_v_start = values[1];
9136 __pyx_v_end = values[2];
9137 __pyx_v_region = values[3];
9138 __pyx_v_until_eof = values[4];
9141 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":826
9144 * reference = None, # <<<<<<<<<<<<<<
9148 __pyx_v_reference = ((PyObject *)Py_None);
9150 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":827
9153 * start = None, # <<<<<<<<<<<<<<
9157 __pyx_v_start = ((PyObject *)Py_None);
9159 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":828
9162 * end = None, # <<<<<<<<<<<<<<
9164 * until_eof = False ):
9166 __pyx_v_end = ((PyObject *)Py_None);
9168 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":829
9171 * region = None, # <<<<<<<<<<<<<<
9172 * until_eof = False ):
9173 * '''*(reference = None, start = None, end = None, region = None, callback = None, until_eof = False)*
9175 __pyx_v_region = ((PyObject *)Py_None);
9176 __pyx_v_until_eof = __pyx_k_39;
9177 switch (PyTuple_GET_SIZE(__pyx_args)) {
9178 case 5: __pyx_v_until_eof = PyTuple_GET_ITEM(__pyx_args, 4);
9179 case 4: __pyx_v_region = PyTuple_GET_ITEM(__pyx_args, 3);
9180 case 3: __pyx_v_end = PyTuple_GET_ITEM(__pyx_args, 2);
9181 case 2: __pyx_v_start = PyTuple_GET_ITEM(__pyx_args, 1);
9182 case 1: __pyx_v_reference = PyTuple_GET_ITEM(__pyx_args, 0);
9184 default: goto __pyx_L5_argtuple_error;
9187 goto __pyx_L4_argument_unpacking_done;
9188 __pyx_L5_argtuple_error:;
9189 __Pyx_RaiseArgtupleInvalid("count", 0, 0, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
9191 __Pyx_AddTraceback("csamtools.Samfile.count");
9192 __Pyx_RefNannyFinishContext();
9194 __pyx_L4_argument_unpacking_done:;
9195 __Pyx_INCREF(__pyx_v_region);
9197 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":843
9200 * if not self._isOpen(): # <<<<<<<<<<<<<<
9201 * raise ValueError( "I/O operation on closed file" )
9204 __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___isOpen); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9205 __Pyx_GOTREF(__pyx_t_1);
9206 __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 = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9207 __Pyx_GOTREF(__pyx_t_2);
9208 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9209 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9210 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9211 __pyx_t_4 = (!__pyx_t_3);
9214 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":844
9216 * if not self._isOpen():
9217 * raise ValueError( "I/O operation on closed file" ) # <<<<<<<<<<<<<<
9219 * region, rtid, rstart, rend = self._parseRegion( reference, start, end, region )
9221 __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9222 __Pyx_GOTREF(__pyx_t_2);
9223 __Pyx_INCREF(((PyObject *)__pyx_kp_s_5));
9224 PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_5));
9225 __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_5));
9226 __pyx_t_1 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9227 __Pyx_GOTREF(__pyx_t_1);
9228 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9229 __Pyx_Raise(__pyx_t_1, 0, 0);
9230 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9231 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9236 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":846
9237 * raise ValueError( "I/O operation on closed file" )
9239 * region, rtid, rstart, rend = self._parseRegion( reference, start, end, region ) # <<<<<<<<<<<<<<
9243 __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___parseRegion); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9244 __Pyx_GOTREF(__pyx_t_1);
9245 __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9246 __Pyx_GOTREF(__pyx_t_2);
9247 __Pyx_INCREF(__pyx_v_reference);
9248 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_reference);
9249 __Pyx_GIVEREF(__pyx_v_reference);
9250 __Pyx_INCREF(__pyx_v_start);
9251 PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_start);
9252 __Pyx_GIVEREF(__pyx_v_start);
9253 __Pyx_INCREF(__pyx_v_end);
9254 PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_end);
9255 __Pyx_GIVEREF(__pyx_v_end);
9256 __Pyx_INCREF(__pyx_v_region);
9257 PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_v_region);
9258 __Pyx_GIVEREF(__pyx_v_region);
9259 __pyx_t_5 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9260 __Pyx_GOTREF(__pyx_t_5);
9261 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9262 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9263 if (PyTuple_CheckExact(__pyx_t_5) && likely(PyTuple_GET_SIZE(__pyx_t_5) == 4)) {
9264 PyObject* tuple = __pyx_t_5;
9265 __pyx_t_2 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_2);
9266 __pyx_t_1 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_1);
9267 __pyx_t_8 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9268 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9269 __pyx_t_6 = PyTuple_GET_ITEM(tuple, 2); __Pyx_INCREF(__pyx_t_6);
9270 __pyx_t_9 = __Pyx_PyInt_AsInt(__pyx_t_6); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9271 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
9272 __pyx_t_7 = PyTuple_GET_ITEM(tuple, 3); __Pyx_INCREF(__pyx_t_7);
9273 __pyx_t_10 = __Pyx_PyInt_AsInt(__pyx_t_7); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9274 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
9275 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9276 __Pyx_DECREF(__pyx_v_region);
9277 __pyx_v_region = __pyx_t_2;
9279 __pyx_v_rtid = __pyx_t_8;
9280 __pyx_v_rstart = __pyx_t_9;
9281 __pyx_v_rend = __pyx_t_10;
9283 __pyx_t_11 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9284 __Pyx_GOTREF(__pyx_t_11);
9285 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9286 __pyx_t_2 = __Pyx_UnpackItem(__pyx_t_11, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9287 __Pyx_GOTREF(__pyx_t_2);
9288 __pyx_t_1 = __Pyx_UnpackItem(__pyx_t_11, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9289 __Pyx_GOTREF(__pyx_t_1);
9290 __pyx_t_10 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9291 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9292 __pyx_t_6 = __Pyx_UnpackItem(__pyx_t_11, 2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9293 __Pyx_GOTREF(__pyx_t_6);
9294 __pyx_t_9 = __Pyx_PyInt_AsInt(__pyx_t_6); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9295 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
9296 __pyx_t_7 = __Pyx_UnpackItem(__pyx_t_11, 3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9297 __Pyx_GOTREF(__pyx_t_7);
9298 __pyx_t_8 = __Pyx_PyInt_AsInt(__pyx_t_7); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9299 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
9300 if (__Pyx_EndUnpack(__pyx_t_11, 4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9301 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
9302 __Pyx_DECREF(__pyx_v_region);
9303 __pyx_v_region = __pyx_t_2;
9305 __pyx_v_rtid = __pyx_t_10;
9306 __pyx_v_rstart = __pyx_t_9;
9307 __pyx_v_rend = __pyx_t_8;
9310 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":849
9313 * counter = 0; # <<<<<<<<<<<<<<
9317 __pyx_v_counter = 0;
9319 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":851
9322 * if self.isbam: # <<<<<<<<<<<<<<
9323 * if not until_eof and not self._hasIndex() and not self.isremote:
9324 * raise ValueError( "fetch called on bamfile without index" )
9326 if (((struct __pyx_obj_9csamtools_Samfile *)__pyx_v_self)->isbam) {
9328 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":852
9331 * if not until_eof and not self._hasIndex() and not self.isremote: # <<<<<<<<<<<<<<
9332 * raise ValueError( "fetch called on bamfile without index" )
9335 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_until_eof); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 852; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9336 __pyx_t_3 = (!__pyx_t_4);
9338 __pyx_t_5 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___hasIndex); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 852; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9339 __Pyx_GOTREF(__pyx_t_5);
9340 __pyx_t_7 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 852; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9341 __Pyx_GOTREF(__pyx_t_7);
9342 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9343 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 852; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9344 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
9345 __pyx_t_12 = (!__pyx_t_4);
9347 __pyx_t_4 = (!((struct __pyx_obj_9csamtools_Samfile *)__pyx_v_self)->isremote);
9348 __pyx_t_13 = __pyx_t_4;
9350 __pyx_t_13 = __pyx_t_12;
9352 __pyx_t_12 = __pyx_t_13;
9354 __pyx_t_12 = __pyx_t_3;
9358 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":853
9360 * if not until_eof and not self._hasIndex() and not self.isremote:
9361 * raise ValueError( "fetch called on bamfile without index" ) # <<<<<<<<<<<<<<
9365 __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 853; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9366 __Pyx_GOTREF(__pyx_t_7);
9367 __Pyx_INCREF(((PyObject *)__pyx_kp_s_30));
9368 PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_kp_s_30));
9369 __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_30));
9370 __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_7, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 853; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9371 __Pyx_GOTREF(__pyx_t_5);
9372 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
9373 __Pyx_Raise(__pyx_t_5, 0, 0);
9374 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9375 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 853; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9380 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":855
9381 * raise ValueError( "fetch called on bamfile without index" )
9383 * if not region: # <<<<<<<<<<<<<<
9384 * raise ValueError( "counting functionality requires a region/reference" )
9385 * if not self._hasIndex(): raise ValueError( "no index available for fetch" )
9387 __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_v_region); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 855; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9388 __pyx_t_3 = (!__pyx_t_12);
9391 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":856
9394 * raise ValueError( "counting functionality requires a region/reference" ) # <<<<<<<<<<<<<<
9395 * if not self._hasIndex(): raise ValueError( "no index available for fetch" )
9396 * bam_fetch(self.samfile.x.bam,
9398 __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 856; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9399 __Pyx_GOTREF(__pyx_t_5);
9400 __Pyx_INCREF(((PyObject *)__pyx_kp_s_40));
9401 PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_kp_s_40));
9402 __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_40));
9403 __pyx_t_7 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 856; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9404 __Pyx_GOTREF(__pyx_t_7);
9405 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9406 __Pyx_Raise(__pyx_t_7, 0, 0);
9407 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
9408 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 856; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9413 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":857
9415 * raise ValueError( "counting functionality requires a region/reference" )
9416 * if not self._hasIndex(): raise ValueError( "no index available for fetch" ) # <<<<<<<<<<<<<<
9417 * bam_fetch(self.samfile.x.bam,
9420 __pyx_t_7 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___hasIndex); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 857; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9421 __Pyx_GOTREF(__pyx_t_7);
9422 __pyx_t_5 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 857; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9423 __Pyx_GOTREF(__pyx_t_5);
9424 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
9425 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 857; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9426 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9427 __pyx_t_12 = (!__pyx_t_3);
9429 __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 857; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9430 __Pyx_GOTREF(__pyx_t_5);
9431 __Pyx_INCREF(((PyObject *)__pyx_kp_s_32));
9432 PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_kp_s_32));
9433 __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_32));
9434 __pyx_t_7 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 857; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9435 __Pyx_GOTREF(__pyx_t_7);
9436 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9437 __Pyx_Raise(__pyx_t_7, 0, 0);
9438 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
9439 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 857; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9444 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":864
9447 * count_callback ) # <<<<<<<<<<<<<<
9451 bam_fetch(((struct __pyx_obj_9csamtools_Samfile *)__pyx_v_self)->samfile->x.bam, ((struct __pyx_obj_9csamtools_Samfile *)__pyx_v_self)->index, __pyx_v_rtid, __pyx_v_rstart, __pyx_v_rend, ((void *)(&__pyx_v_counter)), __pyx_f_9csamtools_count_callback);
9453 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":865
9456 * return counter # <<<<<<<<<<<<<<
9458 * raise ValueError ("count for a region is not available for sam files" )
9460 __Pyx_XDECREF(__pyx_r);
9461 __pyx_t_7 = PyInt_FromLong(__pyx_v_counter); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9462 __Pyx_GOTREF(__pyx_t_7);
9463 __pyx_r = __pyx_t_7;
9470 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":867
9473 * raise ValueError ("count for a region is not available for sam files" ) # <<<<<<<<<<<<<<
9477 __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9478 __Pyx_GOTREF(__pyx_t_7);
9479 __Pyx_INCREF(((PyObject *)__pyx_kp_s_41));
9480 PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_kp_s_41));
9481 __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_41));
9482 __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_7, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9483 __Pyx_GOTREF(__pyx_t_5);
9484 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
9485 __Pyx_Raise(__pyx_t_5, 0, 0);
9486 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9487 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9491 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9494 __Pyx_XDECREF(__pyx_t_1);
9495 __Pyx_XDECREF(__pyx_t_2);
9496 __Pyx_XDECREF(__pyx_t_5);
9497 __Pyx_XDECREF(__pyx_t_6);
9498 __Pyx_XDECREF(__pyx_t_7);
9499 __Pyx_XDECREF(__pyx_t_11);
9500 __Pyx_AddTraceback("csamtools.Samfile.count");
9503 __Pyx_DECREF(__pyx_v_region);
9504 __Pyx_XGIVEREF(__pyx_r);
9505 __Pyx_TraceReturn(__pyx_r);
9506 __Pyx_RefNannyFinishContext();
9510 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":869
9511 * raise ValueError ("count for a region is not available for sam files" )
9513 * def pileup( self, # <<<<<<<<<<<<<<
9518 static PyObject *__pyx_pf_9csamtools_7Samfile_pileup(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
9519 static char __pyx_doc_9csamtools_7Samfile_pileup[] = "Samfile.pileup(self, reference=None, start=None, end=None, region=None, callback=None, **kwargs)\n\n perform a :term:`pileup` within a :term:`region`. The region is specified by\n :term:`reference`, *start* and *end* (using 0-based indexing). \n Alternatively, a samtools *region* string can be supplied.\n\n Without *reference* or *region* all reads will be used for the pileup. The reads will be returned\n ordered by :term:`reference` sequence, which will not necessarily be the order within the file.\n\n The method returns an iterator of type :class:`pysam.IteratorColumn` unless\n a *callback is provided. If a *callback* is given, the callback will be executed \n for each column within the :term:`region`. \n\n Note that :term:`SAM` formatted files do not allow random access. \n In these files, if a *region* or *reference* are given an exception is raised.\n \n Optional *kwargs* to the iterator:\n\n stepper\n The stepper controlls how the iterator advances. \n Possible options for the stepper are \n \n ``all``\n use all reads for pileup.\n ``samtools``\n same filter and read processing as in :term:`csamtools` pileup\n\n fastafile\n A :class:`FastaFile` object\n\n mask\n Skip all reads with bits set in mask.\n\n\n .. note::\n\n *all* reads which overlap the region are returned. The first base returned will be the \n first base of the first read *not* necessarily the first base of the region used in the query.\n\n The maximum number of reads considered for pileup is *8000*. This limit is set by\n :term:`csamtools`.\n\n ";
9520 static PyObject *__pyx_pf_9csamtools_7Samfile_pileup(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
9521 PyObject *__pyx_v_reference = 0;
9522 PyObject *__pyx_v_start = 0;
9523 PyObject *__pyx_v_end = 0;
9524 PyObject *__pyx_v_region = 0;
9525 PyObject *__pyx_v_callback = 0;
9526 PyObject *__pyx_v_kwargs = 0;
9530 int __pyx_v_has_coord;
9531 bam_plbuf_t *__pyx_v_buf;
9532 PyObject *__pyx_r = NULL;
9533 PyObject *__pyx_t_1 = NULL;
9534 PyObject *__pyx_t_2 = NULL;
9537 PyObject *__pyx_t_5 = NULL;
9538 PyObject *__pyx_t_6 = NULL;
9539 PyObject *__pyx_t_7 = NULL;
9544 PyObject *__pyx_t_12 = NULL;
9545 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__reference,&__pyx_n_s__start,&__pyx_n_s__end,&__pyx_n_s__region,&__pyx_n_s__callback,0};
9546 __Pyx_TraceDeclarations
9547 __Pyx_RefNannySetupContext("pileup");
9548 __Pyx_TraceCall("pileup", __pyx_f[0], 869);
9549 __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL;
9550 __Pyx_GOTREF(__pyx_v_kwargs);
9551 if (unlikely(__pyx_kwds)) {
9552 Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
9553 PyObject* values[5] = {0,0,0,0,0};
9555 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":870
9558 * reference = None, # <<<<<<<<<<<<<<
9562 values[0] = ((PyObject *)Py_None);
9564 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":871
9567 * start = None, # <<<<<<<<<<<<<<
9571 values[1] = ((PyObject *)Py_None);
9573 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":872
9576 * end = None, # <<<<<<<<<<<<<<
9580 values[2] = ((PyObject *)Py_None);
9582 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":873
9585 * region = None, # <<<<<<<<<<<<<<
9589 values[3] = ((PyObject *)Py_None);
9591 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":874
9594 * callback = None, # <<<<<<<<<<<<<<
9598 values[4] = ((PyObject *)Py_None);
9599 switch (PyTuple_GET_SIZE(__pyx_args)) {
9600 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
9601 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
9602 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
9603 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
9604 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9606 default: goto __pyx_L5_argtuple_error;
9608 switch (PyTuple_GET_SIZE(__pyx_args)) {
9611 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__reference);
9612 if (value) { values[0] = value; kw_args--; }
9616 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__start);
9617 if (value) { values[1] = value; kw_args--; }
9621 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__end);
9622 if (value) { values[2] = value; kw_args--; }
9626 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__region);
9627 if (value) { values[3] = value; kw_args--; }
9631 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__callback);
9632 if (value) { values[4] = value; kw_args--; }
9635 if (unlikely(kw_args > 0)) {
9636 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, PyTuple_GET_SIZE(__pyx_args), "pileup") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 869; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
9638 __pyx_v_reference = values[0];
9639 __pyx_v_start = values[1];
9640 __pyx_v_end = values[2];
9641 __pyx_v_region = values[3];
9642 __pyx_v_callback = values[4];
9645 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":870
9648 * reference = None, # <<<<<<<<<<<<<<
9652 __pyx_v_reference = ((PyObject *)Py_None);
9654 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":871
9657 * start = None, # <<<<<<<<<<<<<<
9661 __pyx_v_start = ((PyObject *)Py_None);
9663 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":872
9666 * end = None, # <<<<<<<<<<<<<<
9670 __pyx_v_end = ((PyObject *)Py_None);
9672 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":873
9675 * region = None, # <<<<<<<<<<<<<<
9679 __pyx_v_region = ((PyObject *)Py_None);
9681 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":874
9684 * callback = None, # <<<<<<<<<<<<<<
9688 __pyx_v_callback = ((PyObject *)Py_None);
9689 switch (PyTuple_GET_SIZE(__pyx_args)) {
9690 case 5: __pyx_v_callback = PyTuple_GET_ITEM(__pyx_args, 4);
9691 case 4: __pyx_v_region = PyTuple_GET_ITEM(__pyx_args, 3);
9692 case 3: __pyx_v_end = PyTuple_GET_ITEM(__pyx_args, 2);
9693 case 2: __pyx_v_start = PyTuple_GET_ITEM(__pyx_args, 1);
9694 case 1: __pyx_v_reference = PyTuple_GET_ITEM(__pyx_args, 0);
9696 default: goto __pyx_L5_argtuple_error;
9699 goto __pyx_L4_argument_unpacking_done;
9700 __pyx_L5_argtuple_error:;
9701 __Pyx_RaiseArgtupleInvalid("pileup", 0, 0, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 869; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
9703 __Pyx_DECREF(__pyx_v_kwargs);
9704 __Pyx_AddTraceback("csamtools.Samfile.pileup");
9705 __Pyx_RefNannyFinishContext();
9707 __pyx_L4_argument_unpacking_done:;
9709 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":921
9710 * cdef bam_plbuf_t *buf
9712 * if not self._isOpen(): # <<<<<<<<<<<<<<
9713 * raise ValueError( "I/O operation on closed file" )
9716 __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___isOpen); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9717 __Pyx_GOTREF(__pyx_t_1);
9718 __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 = 921; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9719 __Pyx_GOTREF(__pyx_t_2);
9720 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9721 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9722 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9723 __pyx_t_4 = (!__pyx_t_3);
9726 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":922
9728 * if not self._isOpen():
9729 * raise ValueError( "I/O operation on closed file" ) # <<<<<<<<<<<<<<
9731 * has_coord, rtid, rstart, rend = self._parseRegion( reference, start, end, region )
9733 __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9734 __Pyx_GOTREF(__pyx_t_2);
9735 __Pyx_INCREF(((PyObject *)__pyx_kp_s_5));
9736 PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_5));
9737 __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_5));
9738 __pyx_t_1 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9739 __Pyx_GOTREF(__pyx_t_1);
9740 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9741 __Pyx_Raise(__pyx_t_1, 0, 0);
9742 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9743 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9748 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":924
9749 * raise ValueError( "I/O operation on closed file" )
9751 * has_coord, rtid, rstart, rend = self._parseRegion( reference, start, end, region ) # <<<<<<<<<<<<<<
9755 __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___parseRegion); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 924; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9756 __Pyx_GOTREF(__pyx_t_1);
9757 __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 924; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9758 __Pyx_GOTREF(__pyx_t_2);
9759 __Pyx_INCREF(__pyx_v_reference);
9760 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_reference);
9761 __Pyx_GIVEREF(__pyx_v_reference);
9762 __Pyx_INCREF(__pyx_v_start);
9763 PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_start);
9764 __Pyx_GIVEREF(__pyx_v_start);
9765 __Pyx_INCREF(__pyx_v_end);
9766 PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_end);
9767 __Pyx_GIVEREF(__pyx_v_end);
9768 __Pyx_INCREF(__pyx_v_region);
9769 PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_v_region);
9770 __Pyx_GIVEREF(__pyx_v_region);
9771 __pyx_t_5 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 924; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9772 __Pyx_GOTREF(__pyx_t_5);
9773 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9774 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9775 if (PyTuple_CheckExact(__pyx_t_5) && likely(PyTuple_GET_SIZE(__pyx_t_5) == 4)) {
9776 PyObject* tuple = __pyx_t_5;
9777 __pyx_t_2 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_2);
9778 __pyx_t_8 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 924; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9779 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9780 __pyx_t_1 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_1);
9781 __pyx_t_9 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 924; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9782 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9783 __pyx_t_6 = PyTuple_GET_ITEM(tuple, 2); __Pyx_INCREF(__pyx_t_6);
9784 __pyx_t_10 = __Pyx_PyInt_AsInt(__pyx_t_6); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 924; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9785 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
9786 __pyx_t_7 = PyTuple_GET_ITEM(tuple, 3); __Pyx_INCREF(__pyx_t_7);
9787 __pyx_t_11 = __Pyx_PyInt_AsInt(__pyx_t_7); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 924; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9788 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
9789 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9790 __pyx_v_has_coord = __pyx_t_8;
9791 __pyx_v_rtid = __pyx_t_9;
9792 __pyx_v_rstart = __pyx_t_10;
9793 __pyx_v_rend = __pyx_t_11;
9795 __pyx_t_12 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 924; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9796 __Pyx_GOTREF(__pyx_t_12);
9797 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9798 __pyx_t_2 = __Pyx_UnpackItem(__pyx_t_12, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 924; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9799 __Pyx_GOTREF(__pyx_t_2);
9800 __pyx_t_11 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 924; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9801 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9802 __pyx_t_1 = __Pyx_UnpackItem(__pyx_t_12, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 924; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9803 __Pyx_GOTREF(__pyx_t_1);
9804 __pyx_t_10 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 924; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9805 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9806 __pyx_t_6 = __Pyx_UnpackItem(__pyx_t_12, 2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 924; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9807 __Pyx_GOTREF(__pyx_t_6);
9808 __pyx_t_9 = __Pyx_PyInt_AsInt(__pyx_t_6); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 924; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9809 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
9810 __pyx_t_7 = __Pyx_UnpackItem(__pyx_t_12, 3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 924; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9811 __Pyx_GOTREF(__pyx_t_7);
9812 __pyx_t_8 = __Pyx_PyInt_AsInt(__pyx_t_7); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 924; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9813 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
9814 if (__Pyx_EndUnpack(__pyx_t_12, 4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 924; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9815 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
9816 __pyx_v_has_coord = __pyx_t_11;
9817 __pyx_v_rtid = __pyx_t_10;
9818 __pyx_v_rstart = __pyx_t_9;
9819 __pyx_v_rend = __pyx_t_8;
9822 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":926
9823 * has_coord, rtid, rstart, rend = self._parseRegion( reference, start, end, region )
9825 * if self.isbam: # <<<<<<<<<<<<<<
9826 * if not self._hasIndex(): raise ValueError( "no index available for pileup" )
9829 if (((struct __pyx_obj_9csamtools_Samfile *)__pyx_v_self)->isbam) {
9831 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":927
9834 * if not self._hasIndex(): raise ValueError( "no index available for pileup" ) # <<<<<<<<<<<<<<
9838 __pyx_t_5 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___hasIndex); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 927; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9839 __Pyx_GOTREF(__pyx_t_5);
9840 __pyx_t_7 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 927; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9841 __Pyx_GOTREF(__pyx_t_7);
9842 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9843 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 927; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9844 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
9845 __pyx_t_3 = (!__pyx_t_4);
9847 __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 927; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9848 __Pyx_GOTREF(__pyx_t_7);
9849 __Pyx_INCREF(((PyObject *)__pyx_kp_s_42));
9850 PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_kp_s_42));
9851 __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_42));
9852 __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_7, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 927; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9853 __Pyx_GOTREF(__pyx_t_5);
9854 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
9855 __Pyx_Raise(__pyx_t_5, 0, 0);
9856 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9857 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 927; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9862 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":929
9863 * if not self._hasIndex(): raise ValueError( "no index available for pileup" )
9865 * if callback: # <<<<<<<<<<<<<<
9866 * if not has_coord: raise ValueError( "callback functionality requires a region/reference" )
9869 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_callback); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 929; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9872 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":930
9875 * if not has_coord: raise ValueError( "callback functionality requires a region/reference" ) # <<<<<<<<<<<<<<
9877 * buf = bam_plbuf_init( <bam_pileup_f>pileup_callback, <void*>callback )
9879 __pyx_t_3 = (!__pyx_v_has_coord);
9881 __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 930; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9882 __Pyx_GOTREF(__pyx_t_5);
9883 __Pyx_INCREF(((PyObject *)__pyx_kp_s_31));
9884 PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_kp_s_31));
9885 __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_31));
9886 __pyx_t_7 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 930; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9887 __Pyx_GOTREF(__pyx_t_7);
9888 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9889 __Pyx_Raise(__pyx_t_7, 0, 0);
9890 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
9891 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 930; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9896 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":932
9897 * if not has_coord: raise ValueError( "callback functionality requires a region/reference" )
9899 * buf = bam_plbuf_init( <bam_pileup_f>pileup_callback, <void*>callback ) # <<<<<<<<<<<<<<
9900 * bam_fetch(self.samfile.x.bam,
9901 * self.index, rtid, rstart, rend,
9903 __pyx_v_buf = bam_plbuf_init(((bam_pileup_f)__pyx_f_9csamtools_pileup_callback), ((void *)__pyx_v_callback));
9905 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":935
9906 * bam_fetch(self.samfile.x.bam,
9907 * self.index, rtid, rstart, rend,
9908 * buf, pileup_fetch_callback ) # <<<<<<<<<<<<<<
9912 bam_fetch(((struct __pyx_obj_9csamtools_Samfile *)__pyx_v_self)->samfile->x.bam, ((struct __pyx_obj_9csamtools_Samfile *)__pyx_v_self)->index, __pyx_v_rtid, __pyx_v_rstart, __pyx_v_rend, __pyx_v_buf, __pyx_f_9csamtools_pileup_fetch_callback);
9914 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":938
9917 * bam_plbuf_push( NULL, buf) # <<<<<<<<<<<<<<
9918 * bam_plbuf_destroy(buf)
9921 bam_plbuf_push(NULL, __pyx_v_buf);
9923 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":939
9925 * bam_plbuf_push( NULL, buf)
9926 * bam_plbuf_destroy(buf) # <<<<<<<<<<<<<<
9930 bam_plbuf_destroy(__pyx_v_buf);
9935 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":941
9936 * bam_plbuf_destroy(buf)
9938 * if has_coord: # <<<<<<<<<<<<<<
9939 * return IteratorColumnRegion( self,
9942 if (__pyx_v_has_coord) {
9944 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":942
9947 * return IteratorColumnRegion( self, # <<<<<<<<<<<<<<
9951 __Pyx_XDECREF(__pyx_r);
9952 __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 942; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9953 __Pyx_GOTREF(__pyx_t_7);
9954 __Pyx_INCREF(__pyx_v_self);
9955 PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_self);
9956 __Pyx_GIVEREF(__pyx_v_self);
9957 __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 942; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9958 __Pyx_GOTREF(((PyObject *)__pyx_t_5));
9960 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":943
9962 * return IteratorColumnRegion( self,
9963 * tid = rtid, # <<<<<<<<<<<<<<
9967 __pyx_t_6 = PyInt_FromLong(__pyx_v_rtid); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 943; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9968 __Pyx_GOTREF(__pyx_t_6);
9969 if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__tid), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 942; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9970 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
9972 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":944
9973 * return IteratorColumnRegion( self,
9975 * start = rstart, # <<<<<<<<<<<<<<
9979 __pyx_t_6 = PyInt_FromLong(__pyx_v_rstart); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 944; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9980 __Pyx_GOTREF(__pyx_t_6);
9981 if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__start), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 942; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9982 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
9984 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":945
9987 * end = rend, # <<<<<<<<<<<<<<
9991 __pyx_t_6 = PyInt_FromLong(__pyx_v_rend); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 945; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9992 __Pyx_GOTREF(__pyx_t_6);
9993 if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__end), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 942; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9994 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
9996 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":946
9999 * **kwargs ) # <<<<<<<<<<<<<<
10001 * return IteratorColumnAllRefs(self, **kwargs )
10003 if (PyDict_Update(((PyObject *)__pyx_t_5), ((PyObject *)__pyx_v_kwargs)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 942; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10004 __pyx_t_6 = PyEval_CallObjectWithKeywords(((PyObject *)((PyObject*)__pyx_ptype_9csamtools_IteratorColumnRegion)), __pyx_t_7, ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 942; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10005 __Pyx_GOTREF(__pyx_t_6);
10006 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
10007 __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
10008 __pyx_r = __pyx_t_6;
10015 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":948
10018 * return IteratorColumnAllRefs(self, **kwargs ) # <<<<<<<<<<<<<<
10022 __Pyx_XDECREF(__pyx_r);
10023 __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10024 __Pyx_GOTREF(__pyx_t_6);
10025 __Pyx_INCREF(__pyx_v_self);
10026 PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_self);
10027 __Pyx_GIVEREF(__pyx_v_self);
10028 __pyx_t_5 = PyEval_CallObjectWithKeywords(((PyObject *)((PyObject*)__pyx_ptype_9csamtools_IteratorColumnAllRefs)), __pyx_t_6, ((PyObject *)__pyx_v_kwargs)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10029 __Pyx_GOTREF(__pyx_t_5);
10030 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10031 __pyx_r = __pyx_t_5;
10042 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":951
10045 * raise NotImplementedError( "pileup of samfiles not implemented yet" ) # <<<<<<<<<<<<<<
10047 * def close( self ):
10049 __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 951; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10050 __Pyx_GOTREF(__pyx_t_5);
10051 __Pyx_INCREF(((PyObject *)__pyx_kp_s_43));
10052 PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_kp_s_43));
10053 __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_43));
10054 __pyx_t_6 = PyObject_Call(__pyx_builtin_NotImplementedError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 951; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10055 __Pyx_GOTREF(__pyx_t_6);
10056 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10057 __Pyx_Raise(__pyx_t_6, 0, 0);
10058 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10059 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 951; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10063 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
10066 __Pyx_XDECREF(__pyx_t_1);
10067 __Pyx_XDECREF(__pyx_t_2);
10068 __Pyx_XDECREF(__pyx_t_5);
10069 __Pyx_XDECREF(__pyx_t_6);
10070 __Pyx_XDECREF(__pyx_t_7);
10071 __Pyx_XDECREF(__pyx_t_12);
10072 __Pyx_AddTraceback("csamtools.Samfile.pileup");
10075 __Pyx_DECREF(__pyx_v_kwargs);
10076 __Pyx_XGIVEREF(__pyx_r);
10077 __Pyx_TraceReturn(__pyx_r);
10078 __Pyx_RefNannyFinishContext();
10082 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":953
10083 * raise NotImplementedError( "pileup of samfiles not implemented yet" )
10085 * def close( self ): # <<<<<<<<<<<<<<
10087 * closes the :class:`pysam.Samfile`.'''
10090 static PyObject *__pyx_pf_9csamtools_7Samfile_close(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
10091 static char __pyx_doc_9csamtools_7Samfile_close[] = "Samfile.close(self)\n\n closes the :class:`pysam.Samfile`.";
10092 static PyObject *__pyx_pf_9csamtools_7Samfile_close(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10093 PyObject *__pyx_r = NULL;
10095 __Pyx_TraceDeclarations
10096 __Pyx_RefNannySetupContext("close");
10097 __Pyx_TraceCall("close", __pyx_f[0], 953);
10099 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":956
10101 * closes the :class:`pysam.Samfile`.'''
10102 * if self.samfile != NULL: # <<<<<<<<<<<<<<
10103 * samclose( self.samfile )
10104 * bam_index_destroy(self.index);
10106 __pyx_t_1 = (((struct __pyx_obj_9csamtools_Samfile *)__pyx_v_self)->samfile != NULL);
10109 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":957
10110 * closes the :class:`pysam.Samfile`.'''
10111 * if self.samfile != NULL:
10112 * samclose( self.samfile ) # <<<<<<<<<<<<<<
10113 * bam_index_destroy(self.index);
10114 * self.samfile = NULL
10116 samclose(((struct __pyx_obj_9csamtools_Samfile *)__pyx_v_self)->samfile);
10118 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":958
10119 * if self.samfile != NULL:
10120 * samclose( self.samfile )
10121 * bam_index_destroy(self.index); # <<<<<<<<<<<<<<
10122 * self.samfile = NULL
10125 bam_index_destroy(((struct __pyx_obj_9csamtools_Samfile *)__pyx_v_self)->index);
10127 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":959
10128 * samclose( self.samfile )
10129 * bam_index_destroy(self.index);
10130 * self.samfile = NULL # <<<<<<<<<<<<<<
10132 * def __dealloc__( self ):
10134 ((struct __pyx_obj_9csamtools_Samfile *)__pyx_v_self)->samfile = NULL;
10139 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
10140 __Pyx_XGIVEREF(__pyx_r);
10141 __Pyx_TraceReturn(__pyx_r);
10142 __Pyx_RefNannyFinishContext();
10146 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":961
10147 * self.samfile = NULL
10149 * def __dealloc__( self ): # <<<<<<<<<<<<<<
10150 * # remember: dealloc cannot call other methods
10151 * # note: no doc string
10154 static void __pyx_pf_9csamtools_7Samfile___dealloc__(PyObject *__pyx_v_self); /*proto*/
10155 static void __pyx_pf_9csamtools_7Samfile___dealloc__(PyObject *__pyx_v_self) {
10156 PyObject *__pyx_t_1 = NULL;
10157 PyObject *__pyx_t_2 = NULL;
10159 __Pyx_TraceDeclarations
10160 __Pyx_RefNannySetupContext("__dealloc__");
10161 __Pyx_TraceCall("__dealloc__", __pyx_f[0], 961);
10163 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":965
10164 * # note: no doc string
10165 * # note: __del__ is not called.
10166 * self.close() # <<<<<<<<<<<<<<
10167 * bam_destroy1(self.b)
10168 * if self._filename != NULL: free( self._filename )
10170 __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__close); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 965; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10171 __Pyx_GOTREF(__pyx_t_1);
10172 __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 = 965; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10173 __Pyx_GOTREF(__pyx_t_2);
10174 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10175 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10177 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":966
10178 * # note: __del__ is not called.
10180 * bam_destroy1(self.b) # <<<<<<<<<<<<<<
10181 * if self._filename != NULL: free( self._filename )
10184 bam_destroy1(((struct __pyx_obj_9csamtools_Samfile *)__pyx_v_self)->b);
10186 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":967
10188 * bam_destroy1(self.b)
10189 * if self._filename != NULL: free( self._filename ) # <<<<<<<<<<<<<<
10191 * cpdef int write( self, AlignedRead read ) except -1:
10193 __pyx_t_3 = (((struct __pyx_obj_9csamtools_Samfile *)__pyx_v_self)->_filename != NULL);
10195 free(((struct __pyx_obj_9csamtools_Samfile *)__pyx_v_self)->_filename);
10202 __Pyx_XDECREF(__pyx_t_1);
10203 __Pyx_XDECREF(__pyx_t_2);
10204 __Pyx_AddTraceback("csamtools.Samfile.__dealloc__");
10206 __Pyx_TraceReturn(Py_None);
10207 __Pyx_RefNannyFinishContext();
10210 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":969
10211 * if self._filename != NULL: free( self._filename )
10213 * cpdef int write( self, AlignedRead read ) except -1: # <<<<<<<<<<<<<<
10215 * write a single :class:`pysam.AlignedRead` to disk.
10218 static PyObject *__pyx_pf_9csamtools_7Samfile_write(PyObject *__pyx_v_self, PyObject *__pyx_v_read); /*proto*/
10219 static int __pyx_f_9csamtools_7Samfile_write(struct __pyx_obj_9csamtools_Samfile *__pyx_v_self, struct __pyx_obj_9csamtools_AlignedRead *__pyx_v_read, int __pyx_skip_dispatch) {
10221 PyObject *__pyx_t_1 = NULL;
10222 PyObject *__pyx_t_2 = NULL;
10223 PyObject *__pyx_t_3 = NULL;
10227 __Pyx_TraceDeclarations
10228 __Pyx_RefNannySetupContext("write");
10229 __Pyx_TraceCall("write", __pyx_f[0], 969);
10230 /* Check if called by wrapper */
10231 if (unlikely(__pyx_skip_dispatch)) ;
10232 /* Check if overriden in Python */
10233 else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
10234 __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__write); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 969; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10235 __Pyx_GOTREF(__pyx_t_1);
10236 if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_9csamtools_7Samfile_write)) {
10237 __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 969; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10238 __Pyx_GOTREF(__pyx_t_2);
10239 __Pyx_INCREF(((PyObject *)__pyx_v_read));
10240 PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_read));
10241 __Pyx_GIVEREF(((PyObject *)__pyx_v_read));
10242 __pyx_t_3 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 969; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10243 __Pyx_GOTREF(__pyx_t_3);
10244 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10245 __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 969; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10246 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10247 __pyx_r = __pyx_t_4;
10248 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10251 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10254 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":975
10255 * returns the number of bytes written.
10257 * if not self._isOpen(): # <<<<<<<<<<<<<<
10261 __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s___isOpen); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 975; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10262 __Pyx_GOTREF(__pyx_t_1);
10263 __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 = 975; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10264 __Pyx_GOTREF(__pyx_t_3);
10265 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10266 __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 975; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10267 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10268 __pyx_t_6 = (!__pyx_t_5);
10271 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":976
10273 * if not self._isOpen():
10274 * return 0 # <<<<<<<<<<<<<<
10276 * return samwrite( self.samfile, read._delegate )
10284 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":978
10287 * return samwrite( self.samfile, read._delegate ) # <<<<<<<<<<<<<<
10289 * def __enter__(self):
10291 __pyx_r = samwrite(__pyx_v_self->samfile, __pyx_v_read->_delegate);
10297 __Pyx_XDECREF(__pyx_t_1);
10298 __Pyx_XDECREF(__pyx_t_2);
10299 __Pyx_XDECREF(__pyx_t_3);
10300 __Pyx_WriteUnraisable("csamtools.Samfile.write");
10303 __Pyx_TraceReturn(Py_None);
10304 __Pyx_RefNannyFinishContext();
10308 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":969
10309 * if self._filename != NULL: free( self._filename )
10311 * cpdef int write( self, AlignedRead read ) except -1: # <<<<<<<<<<<<<<
10313 * write a single :class:`pysam.AlignedRead` to disk.
10316 static PyObject *__pyx_pf_9csamtools_7Samfile_write(PyObject *__pyx_v_self, PyObject *__pyx_v_read); /*proto*/
10317 static char __pyx_doc_9csamtools_7Samfile_write[] = "Samfile.write(self, AlignedRead read) -> int\n\n write a single :class:`pysam.AlignedRead` to disk.\n\n returns the number of bytes written.\n ";
10318 static PyObject *__pyx_pf_9csamtools_7Samfile_write(PyObject *__pyx_v_self, PyObject *__pyx_v_read) {
10319 PyObject *__pyx_r = NULL;
10320 PyObject *__pyx_t_1 = NULL;
10321 __Pyx_TraceDeclarations
10322 __Pyx_RefNannySetupContext("write");
10323 __Pyx_TraceCall("write", __pyx_f[0], 969);
10324 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_read), __pyx_ptype_9csamtools_AlignedRead, 1, "read", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 969; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10325 __Pyx_XDECREF(__pyx_r);
10326 __pyx_t_1 = PyInt_FromLong(((struct __pyx_vtabstruct_9csamtools_Samfile *)((struct __pyx_obj_9csamtools_Samfile *)__pyx_v_self)->__pyx_vtab)->write(((struct __pyx_obj_9csamtools_Samfile *)__pyx_v_self), ((struct __pyx_obj_9csamtools_AlignedRead *)__pyx_v_read), 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 969; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10327 __Pyx_GOTREF(__pyx_t_1);
10328 __pyx_r = __pyx_t_1;
10332 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
10335 __Pyx_XDECREF(__pyx_t_1);
10336 __Pyx_AddTraceback("csamtools.Samfile.write");
10339 __Pyx_XGIVEREF(__pyx_r);
10340 __Pyx_TraceReturn(__pyx_r);
10341 __Pyx_RefNannyFinishContext();
10345 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":980
10346 * return samwrite( self.samfile, read._delegate )
10348 * def __enter__(self): # <<<<<<<<<<<<<<
10353 static PyObject *__pyx_pf_9csamtools_7Samfile___enter__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
10354 static char __pyx_doc_9csamtools_7Samfile___enter__[] = "Samfile.__enter__(self)";
10355 static PyObject *__pyx_pf_9csamtools_7Samfile___enter__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10356 PyObject *__pyx_r = NULL;
10357 __Pyx_TraceDeclarations
10358 __Pyx_RefNannySetupContext("__enter__");
10359 __Pyx_TraceCall("__enter__", __pyx_f[0], 980);
10361 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":981
10363 * def __enter__(self):
10364 * return self # <<<<<<<<<<<<<<
10366 * def __exit__(self, exc_type, exc_value, traceback):
10368 __Pyx_XDECREF(__pyx_r);
10369 __Pyx_INCREF(__pyx_v_self);
10370 __pyx_r = __pyx_v_self;
10373 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
10375 __Pyx_XGIVEREF(__pyx_r);
10376 __Pyx_TraceReturn(__pyx_r);
10377 __Pyx_RefNannyFinishContext();
10381 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":983
10384 * def __exit__(self, exc_type, exc_value, traceback): # <<<<<<<<<<<<<<
10389 static PyObject *__pyx_pf_9csamtools_7Samfile___exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
10390 static char __pyx_doc_9csamtools_7Samfile___exit__[] = "Samfile.__exit__(self, exc_type, exc_value, traceback)";
10391 static PyObject *__pyx_pf_9csamtools_7Samfile___exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
10392 PyObject *__pyx_v_exc_type = 0;
10393 PyObject *__pyx_v_exc_value = 0;
10394 PyObject *__pyx_v_traceback = 0;
10395 PyObject *__pyx_r = NULL;
10396 PyObject *__pyx_t_1 = NULL;
10397 PyObject *__pyx_t_2 = NULL;
10398 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__exc_type,&__pyx_n_s__exc_value,&__pyx_n_s__traceback,0};
10399 __Pyx_TraceDeclarations
10400 __Pyx_RefNannySetupContext("__exit__");
10401 __Pyx_TraceCall("__exit__", __pyx_f[0], 983);
10402 if (unlikely(__pyx_kwds)) {
10403 Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
10404 PyObject* values[3] = {0,0,0};
10405 switch (PyTuple_GET_SIZE(__pyx_args)) {
10406 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
10407 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
10408 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10410 default: goto __pyx_L5_argtuple_error;
10412 switch (PyTuple_GET_SIZE(__pyx_args)) {
10414 values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__exc_type);
10415 if (likely(values[0])) kw_args--;
10416 else goto __pyx_L5_argtuple_error;
10418 values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__exc_value);
10419 if (likely(values[1])) kw_args--;
10421 __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 983; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
10424 values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__traceback);
10425 if (likely(values[2])) kw_args--;
10427 __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 983; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
10430 if (unlikely(kw_args > 0)) {
10431 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__exit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 983; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
10433 __pyx_v_exc_type = values[0];
10434 __pyx_v_exc_value = values[1];
10435 __pyx_v_traceback = values[2];
10436 } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
10437 goto __pyx_L5_argtuple_error;
10439 __pyx_v_exc_type = PyTuple_GET_ITEM(__pyx_args, 0);
10440 __pyx_v_exc_value = PyTuple_GET_ITEM(__pyx_args, 1);
10441 __pyx_v_traceback = PyTuple_GET_ITEM(__pyx_args, 2);
10443 goto __pyx_L4_argument_unpacking_done;
10444 __pyx_L5_argtuple_error:;
10445 __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 983; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
10447 __Pyx_AddTraceback("csamtools.Samfile.__exit__");
10448 __Pyx_RefNannyFinishContext();
10450 __pyx_L4_argument_unpacking_done:;
10452 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":984
10454 * def __exit__(self, exc_type, exc_value, traceback):
10455 * self.close() # <<<<<<<<<<<<<<
10459 __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__close); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 984; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10460 __Pyx_GOTREF(__pyx_t_1);
10461 __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 = 984; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10462 __Pyx_GOTREF(__pyx_t_2);
10463 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10464 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10466 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":985
10467 * def __exit__(self, exc_type, exc_value, traceback):
10469 * return False # <<<<<<<<<<<<<<
10471 * ###############################################################
10473 __Pyx_XDECREF(__pyx_r);
10474 __pyx_t_2 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 985; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10475 __Pyx_GOTREF(__pyx_t_2);
10476 __pyx_r = __pyx_t_2;
10480 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
10483 __Pyx_XDECREF(__pyx_t_1);
10484 __Pyx_XDECREF(__pyx_t_2);
10485 __Pyx_AddTraceback("csamtools.Samfile.__exit__");
10488 __Pyx_XGIVEREF(__pyx_r);
10489 __Pyx_TraceReturn(__pyx_r);
10490 __Pyx_RefNannyFinishContext();
10494 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":994
10495 * property filename:
10496 * '''number of :term:`filename` associated with this object.'''
10497 * def __get__(self): # <<<<<<<<<<<<<<
10498 * if not self._isOpen(): raise ValueError( "I/O operation on closed file" )
10499 * return self._filename
10502 static PyObject *__pyx_pf_9csamtools_7Samfile_8filename___get__(PyObject *__pyx_v_self); /*proto*/
10503 static PyObject *__pyx_pf_9csamtools_7Samfile_8filename___get__(PyObject *__pyx_v_self) {
10504 PyObject *__pyx_r = NULL;
10505 PyObject *__pyx_t_1 = NULL;
10506 PyObject *__pyx_t_2 = NULL;
10509 __Pyx_TraceDeclarations
10510 __Pyx_RefNannySetupContext("__get__");
10511 __Pyx_TraceCall("__get__", __pyx_f[0], 994);
10513 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":995
10514 * '''number of :term:`filename` associated with this object.'''
10515 * def __get__(self):
10516 * if not self._isOpen(): raise ValueError( "I/O operation on closed file" ) # <<<<<<<<<<<<<<
10517 * return self._filename
10520 __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___isOpen); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 995; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10521 __Pyx_GOTREF(__pyx_t_1);
10522 __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 = 995; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10523 __Pyx_GOTREF(__pyx_t_2);
10524 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10525 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 995; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10526 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10527 __pyx_t_4 = (!__pyx_t_3);
10529 __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 995; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10530 __Pyx_GOTREF(__pyx_t_2);
10531 __Pyx_INCREF(((PyObject *)__pyx_kp_s_5));
10532 PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_5));
10533 __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_5));
10534 __pyx_t_1 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 995; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10535 __Pyx_GOTREF(__pyx_t_1);
10536 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10537 __Pyx_Raise(__pyx_t_1, 0, 0);
10538 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10539 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 995; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10544 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":996
10545 * def __get__(self):
10546 * if not self._isOpen(): raise ValueError( "I/O operation on closed file" )
10547 * return self._filename # <<<<<<<<<<<<<<
10549 * property nreferences:
10551 __Pyx_XDECREF(__pyx_r);
10552 __pyx_t_1 = PyBytes_FromString(((struct __pyx_obj_9csamtools_Samfile *)__pyx_v_self)->_filename); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 996; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10553 __Pyx_GOTREF(((PyObject *)__pyx_t_1));
10554 __pyx_r = ((PyObject *)__pyx_t_1);
10558 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
10561 __Pyx_XDECREF(__pyx_t_1);
10562 __Pyx_XDECREF(__pyx_t_2);
10563 __Pyx_AddTraceback("csamtools.Samfile.filename.__get__");
10566 __Pyx_XGIVEREF(__pyx_r);
10567 __Pyx_TraceReturn(__pyx_r);
10568 __Pyx_RefNannyFinishContext();
10572 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1000
10573 * property nreferences:
10574 * '''number of :term:`reference` sequences in the file.'''
10575 * def __get__(self): # <<<<<<<<<<<<<<
10576 * if not self._isOpen(): raise ValueError( "I/O operation on closed file" )
10577 * return self.samfile.header.n_targets
10580 static PyObject *__pyx_pf_9csamtools_7Samfile_11nreferences___get__(PyObject *__pyx_v_self); /*proto*/
10581 static PyObject *__pyx_pf_9csamtools_7Samfile_11nreferences___get__(PyObject *__pyx_v_self) {
10582 PyObject *__pyx_r = NULL;
10583 PyObject *__pyx_t_1 = NULL;
10584 PyObject *__pyx_t_2 = NULL;
10587 __Pyx_TraceDeclarations
10588 __Pyx_RefNannySetupContext("__get__");
10589 __Pyx_TraceCall("__get__", __pyx_f[0], 1000);
10591 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1001
10592 * '''number of :term:`reference` sequences in the file.'''
10593 * def __get__(self):
10594 * if not self._isOpen(): raise ValueError( "I/O operation on closed file" ) # <<<<<<<<<<<<<<
10595 * return self.samfile.header.n_targets
10598 __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___isOpen); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1001; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10599 __Pyx_GOTREF(__pyx_t_1);
10600 __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 = 1001; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10601 __Pyx_GOTREF(__pyx_t_2);
10602 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10603 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1001; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10604 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10605 __pyx_t_4 = (!__pyx_t_3);
10607 __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1001; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10608 __Pyx_GOTREF(__pyx_t_2);
10609 __Pyx_INCREF(((PyObject *)__pyx_kp_s_5));
10610 PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_5));
10611 __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_5));
10612 __pyx_t_1 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1001; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10613 __Pyx_GOTREF(__pyx_t_1);
10614 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10615 __Pyx_Raise(__pyx_t_1, 0, 0);
10616 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10617 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1001; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10622 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1002
10623 * def __get__(self):
10624 * if not self._isOpen(): raise ValueError( "I/O operation on closed file" )
10625 * return self.samfile.header.n_targets # <<<<<<<<<<<<<<
10627 * property references:
10629 __Pyx_XDECREF(__pyx_r);
10630 __pyx_t_1 = __Pyx_PyInt_to_py_int32_t(((struct __pyx_obj_9csamtools_Samfile *)__pyx_v_self)->samfile->header->n_targets); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1002; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10631 __Pyx_GOTREF(__pyx_t_1);
10632 __pyx_r = __pyx_t_1;
10636 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
10639 __Pyx_XDECREF(__pyx_t_1);
10640 __Pyx_XDECREF(__pyx_t_2);
10641 __Pyx_AddTraceback("csamtools.Samfile.nreferences.__get__");
10644 __Pyx_XGIVEREF(__pyx_r);
10645 __Pyx_TraceReturn(__pyx_r);
10646 __Pyx_RefNannyFinishContext();
10650 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1006
10651 * property references:
10652 * """tuple with the names of :term:`reference` sequences."""
10653 * def __get__(self): # <<<<<<<<<<<<<<
10654 * if not self._isOpen(): raise ValueError( "I/O operation on closed file" )
10658 static PyObject *__pyx_pf_9csamtools_7Samfile_10references___get__(PyObject *__pyx_v_self); /*proto*/
10659 static PyObject *__pyx_pf_9csamtools_7Samfile_10references___get__(PyObject *__pyx_v_self) {
10660 PyObject *__pyx_v_t;
10662 PyObject *__pyx_r = NULL;
10663 PyObject *__pyx_t_1 = NULL;
10664 PyObject *__pyx_t_2 = NULL;
10669 __Pyx_TraceDeclarations
10670 __Pyx_RefNannySetupContext("__get__");
10671 __Pyx_TraceCall("__get__", __pyx_f[0], 1006);
10672 __pyx_v_t = ((PyObject *)Py_None); __Pyx_INCREF(Py_None);
10674 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1007
10675 * """tuple with the names of :term:`reference` sequences."""
10676 * def __get__(self):
10677 * if not self._isOpen(): raise ValueError( "I/O operation on closed file" ) # <<<<<<<<<<<<<<
10679 * for x from 0 <= x < self.samfile.header.n_targets:
10681 __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___isOpen); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1007; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10682 __Pyx_GOTREF(__pyx_t_1);
10683 __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 = 1007; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10684 __Pyx_GOTREF(__pyx_t_2);
10685 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10686 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1007; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10687 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10688 __pyx_t_4 = (!__pyx_t_3);
10690 __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1007; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10691 __Pyx_GOTREF(__pyx_t_2);
10692 __Pyx_INCREF(((PyObject *)__pyx_kp_s_5));
10693 PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_5));
10694 __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_5));
10695 __pyx_t_1 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1007; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10696 __Pyx_GOTREF(__pyx_t_1);
10697 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10698 __Pyx_Raise(__pyx_t_1, 0, 0);
10699 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10700 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1007; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10705 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1008
10706 * def __get__(self):
10707 * if not self._isOpen(): raise ValueError( "I/O operation on closed file" )
10708 * t = [] # <<<<<<<<<<<<<<
10709 * for x from 0 <= x < self.samfile.header.n_targets:
10710 * t.append( self.samfile.header.target_name[x] )
10712 __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1008; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10713 __Pyx_GOTREF(((PyObject *)__pyx_t_1));
10714 __Pyx_DECREF(((PyObject *)__pyx_v_t));
10715 __pyx_v_t = __pyx_t_1;
10718 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1009
10719 * if not self._isOpen(): raise ValueError( "I/O operation on closed file" )
10721 * for x from 0 <= x < self.samfile.header.n_targets: # <<<<<<<<<<<<<<
10722 * t.append( self.samfile.header.target_name[x] )
10725 __pyx_t_5 = ((struct __pyx_obj_9csamtools_Samfile *)__pyx_v_self)->samfile->header->n_targets;
10726 for (__pyx_v_x = 0; __pyx_v_x < __pyx_t_5; __pyx_v_x++) {
10728 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1010
10730 * for x from 0 <= x < self.samfile.header.n_targets:
10731 * t.append( self.samfile.header.target_name[x] ) # <<<<<<<<<<<<<<
10735 if (unlikely(__pyx_v_t == Py_None)) {
10736 PyErr_SetString(PyExc_AttributeError, "'NoneType' object has no attribute 'append'"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1010; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10738 __pyx_t_1 = PyBytes_FromString((((struct __pyx_obj_9csamtools_Samfile *)__pyx_v_self)->samfile->header->target_name[__pyx_v_x])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1010; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10739 __Pyx_GOTREF(((PyObject *)__pyx_t_1));
10740 __pyx_t_6 = PyList_Append(((PyObject *)__pyx_v_t), ((PyObject *)__pyx_t_1)); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1010; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10741 __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
10744 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1011
10745 * for x from 0 <= x < self.samfile.header.n_targets:
10746 * t.append( self.samfile.header.target_name[x] )
10747 * return tuple(t) # <<<<<<<<<<<<<<
10749 * property lengths:
10751 __Pyx_XDECREF(__pyx_r);
10752 if (unlikely(__pyx_v_t == Py_None)) {
10753 PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1011; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10755 __pyx_t_1 = ((PyObject *)PyList_AsTuple(__pyx_v_t)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1011; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10756 __Pyx_GOTREF(((PyObject *)__pyx_t_1));
10757 __pyx_r = ((PyObject *)__pyx_t_1);
10761 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
10764 __Pyx_XDECREF(__pyx_t_1);
10765 __Pyx_XDECREF(__pyx_t_2);
10766 __Pyx_AddTraceback("csamtools.Samfile.references.__get__");
10769 __Pyx_DECREF(__pyx_v_t);
10770 __Pyx_XGIVEREF(__pyx_r);
10771 __Pyx_TraceReturn(__pyx_r);
10772 __Pyx_RefNannyFinishContext();
10776 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1017
10777 * :attr:`pysam.Samfile.references`
10779 * def __get__(self): # <<<<<<<<<<<<<<
10780 * if not self._isOpen(): raise ValueError( "I/O operation on closed file" )
10784 static PyObject *__pyx_pf_9csamtools_7Samfile_7lengths___get__(PyObject *__pyx_v_self); /*proto*/
10785 static PyObject *__pyx_pf_9csamtools_7Samfile_7lengths___get__(PyObject *__pyx_v_self) {
10786 PyObject *__pyx_v_t;
10788 PyObject *__pyx_r = NULL;
10789 PyObject *__pyx_t_1 = NULL;
10790 PyObject *__pyx_t_2 = NULL;
10795 __Pyx_TraceDeclarations
10796 __Pyx_RefNannySetupContext("__get__");
10797 __Pyx_TraceCall("__get__", __pyx_f[0], 1017);
10798 __pyx_v_t = ((PyObject *)Py_None); __Pyx_INCREF(Py_None);
10800 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1018
10802 * def __get__(self):
10803 * if not self._isOpen(): raise ValueError( "I/O operation on closed file" ) # <<<<<<<<<<<<<<
10805 * for x from 0 <= x < self.samfile.header.n_targets:
10807 __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___isOpen); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1018; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10808 __Pyx_GOTREF(__pyx_t_1);
10809 __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 = 1018; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10810 __Pyx_GOTREF(__pyx_t_2);
10811 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10812 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1018; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10813 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10814 __pyx_t_4 = (!__pyx_t_3);
10816 __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1018; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10817 __Pyx_GOTREF(__pyx_t_2);
10818 __Pyx_INCREF(((PyObject *)__pyx_kp_s_5));
10819 PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_5));
10820 __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_5));
10821 __pyx_t_1 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1018; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10822 __Pyx_GOTREF(__pyx_t_1);
10823 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
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 = 1018; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10831 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1019
10832 * def __get__(self):
10833 * if not self._isOpen(): raise ValueError( "I/O operation on closed file" )
10834 * t = [] # <<<<<<<<<<<<<<
10835 * for x from 0 <= x < self.samfile.header.n_targets:
10836 * t.append( self.samfile.header.target_len[x] )
10838 __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10839 __Pyx_GOTREF(((PyObject *)__pyx_t_1));
10840 __Pyx_DECREF(((PyObject *)__pyx_v_t));
10841 __pyx_v_t = __pyx_t_1;
10844 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1020
10845 * if not self._isOpen(): raise ValueError( "I/O operation on closed file" )
10847 * for x from 0 <= x < self.samfile.header.n_targets: # <<<<<<<<<<<<<<
10848 * t.append( self.samfile.header.target_len[x] )
10851 __pyx_t_5 = ((struct __pyx_obj_9csamtools_Samfile *)__pyx_v_self)->samfile->header->n_targets;
10852 for (__pyx_v_x = 0; __pyx_v_x < __pyx_t_5; __pyx_v_x++) {
10854 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1021
10856 * for x from 0 <= x < self.samfile.header.n_targets:
10857 * t.append( self.samfile.header.target_len[x] ) # <<<<<<<<<<<<<<
10861 if (unlikely(__pyx_v_t == Py_None)) {
10862 PyErr_SetString(PyExc_AttributeError, "'NoneType' object has no attribute 'append'"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1021; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10864 __pyx_t_1 = __Pyx_PyInt_to_py_uint32_t((((struct __pyx_obj_9csamtools_Samfile *)__pyx_v_self)->samfile->header->target_len[__pyx_v_x])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1021; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10865 __Pyx_GOTREF(__pyx_t_1);
10866 __pyx_t_6 = PyList_Append(((PyObject *)__pyx_v_t), __pyx_t_1); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1021; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10867 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10870 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1022
10871 * for x from 0 <= x < self.samfile.header.n_targets:
10872 * t.append( self.samfile.header.target_len[x] )
10873 * return tuple(t) # <<<<<<<<<<<<<<
10877 __Pyx_XDECREF(__pyx_r);
10878 if (unlikely(__pyx_v_t == Py_None)) {
10879 PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1022; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10881 __pyx_t_1 = ((PyObject *)PyList_AsTuple(__pyx_v_t)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1022; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10882 __Pyx_GOTREF(((PyObject *)__pyx_t_1));
10883 __pyx_r = ((PyObject *)__pyx_t_1);
10887 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
10890 __Pyx_XDECREF(__pyx_t_1);
10891 __Pyx_XDECREF(__pyx_t_2);
10892 __Pyx_AddTraceback("csamtools.Samfile.lengths.__get__");
10895 __Pyx_DECREF(__pyx_v_t);
10896 __Pyx_XGIVEREF(__pyx_r);
10897 __Pyx_TraceReturn(__pyx_r);
10898 __Pyx_RefNannyFinishContext();
10902 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1026
10904 * '''full contents of the :term:`sam file` header as a string.'''
10905 * def __get__(self): # <<<<<<<<<<<<<<
10906 * if not self._isOpen(): raise ValueError( "I/O operation on closed file" )
10907 * return PyString_FromStringAndSize(self.samfile.header.text, self.samfile.header.l_text)
10910 static PyObject *__pyx_pf_9csamtools_7Samfile_4text___get__(PyObject *__pyx_v_self); /*proto*/
10911 static PyObject *__pyx_pf_9csamtools_7Samfile_4text___get__(PyObject *__pyx_v_self) {
10912 PyObject *__pyx_r = NULL;
10913 PyObject *__pyx_t_1 = NULL;
10914 PyObject *__pyx_t_2 = NULL;
10917 __Pyx_TraceDeclarations
10918 __Pyx_RefNannySetupContext("__get__");
10919 __Pyx_TraceCall("__get__", __pyx_f[0], 1026);
10921 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1027
10922 * '''full contents of the :term:`sam file` header as a string.'''
10923 * def __get__(self):
10924 * if not self._isOpen(): raise ValueError( "I/O operation on closed file" ) # <<<<<<<<<<<<<<
10925 * return PyString_FromStringAndSize(self.samfile.header.text, self.samfile.header.l_text)
10928 __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___isOpen); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1027; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10929 __Pyx_GOTREF(__pyx_t_1);
10930 __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 = 1027; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10931 __Pyx_GOTREF(__pyx_t_2);
10932 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10933 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1027; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10934 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10935 __pyx_t_4 = (!__pyx_t_3);
10937 __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1027; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10938 __Pyx_GOTREF(__pyx_t_2);
10939 __Pyx_INCREF(((PyObject *)__pyx_kp_s_5));
10940 PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_5));
10941 __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_5));
10942 __pyx_t_1 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1027; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10943 __Pyx_GOTREF(__pyx_t_1);
10944 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10945 __Pyx_Raise(__pyx_t_1, 0, 0);
10946 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10947 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1027; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10952 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1028
10953 * def __get__(self):
10954 * if not self._isOpen(): raise ValueError( "I/O operation on closed file" )
10955 * return PyString_FromStringAndSize(self.samfile.header.text, self.samfile.header.l_text) # <<<<<<<<<<<<<<
10959 __Pyx_XDECREF(__pyx_r);
10960 __pyx_t_1 = PyString_FromStringAndSize(((struct __pyx_obj_9csamtools_Samfile *)__pyx_v_self)->samfile->header->text, ((struct __pyx_obj_9csamtools_Samfile *)__pyx_v_self)->samfile->header->l_text); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1028; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10961 __Pyx_GOTREF(__pyx_t_1);
10962 __pyx_r = __pyx_t_1;
10966 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
10969 __Pyx_XDECREF(__pyx_t_1);
10970 __Pyx_XDECREF(__pyx_t_2);
10971 __Pyx_AddTraceback("csamtools.Samfile.text.__get__");
10974 __Pyx_XGIVEREF(__pyx_r);
10975 __Pyx_TraceReturn(__pyx_r);
10976 __Pyx_RefNannyFinishContext();
10980 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1034
10981 * a two-level dictionary.
10983 * def __get__(self): # <<<<<<<<<<<<<<
10984 * if not self._isOpen(): raise ValueError( "I/O operation on closed file" )
10988 static PyObject *__pyx_pf_9csamtools_7Samfile_6header___get__(PyObject *__pyx_v_self); /*proto*/
10989 static PyObject *__pyx_pf_9csamtools_7Samfile_6header___get__(PyObject *__pyx_v_self) {
10990 PyObject *__pyx_v_result;
10991 PyObject *__pyx_v_t;
10992 PyObject *__pyx_v_line;
10993 PyObject *__pyx_v_fields;
10994 PyObject *__pyx_v_record;
10995 PyObject *__pyx_v_x;
10996 PyObject *__pyx_v_field;
10997 PyObject *__pyx_v_key;
10998 PyObject *__pyx_v_value;
10999 PyObject *__pyx_r = NULL;
11000 PyObject *__pyx_t_1 = NULL;
11001 PyObject *__pyx_t_2 = NULL;
11004 Py_ssize_t __pyx_t_5;
11005 PyObject *__pyx_t_6 = NULL;
11006 PyObject *__pyx_t_7 = NULL;
11007 PyObject *__pyx_t_8 = NULL;
11008 Py_ssize_t __pyx_t_9;
11009 PyObject *__pyx_t_10 = NULL;
11010 __Pyx_TraceDeclarations
11011 __Pyx_RefNannySetupContext("__get__");
11012 __Pyx_TraceCall("__get__", __pyx_f[0], 1034);
11013 __pyx_v_result = ((PyObject *)Py_None); __Pyx_INCREF(Py_None);
11014 __pyx_v_t = Py_None; __Pyx_INCREF(Py_None);
11015 __pyx_v_line = Py_None; __Pyx_INCREF(Py_None);
11016 __pyx_v_fields = Py_None; __Pyx_INCREF(Py_None);
11017 __pyx_v_record = Py_None; __Pyx_INCREF(Py_None);
11018 __pyx_v_x = ((PyObject *)Py_None); __Pyx_INCREF(Py_None);
11019 __pyx_v_field = Py_None; __Pyx_INCREF(Py_None);
11020 __pyx_v_key = Py_None; __Pyx_INCREF(Py_None);
11021 __pyx_v_value = Py_None; __Pyx_INCREF(Py_None);
11023 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1035
11025 * def __get__(self):
11026 * if not self._isOpen(): raise ValueError( "I/O operation on closed file" ) # <<<<<<<<<<<<<<
11030 __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___isOpen); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1035; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11031 __Pyx_GOTREF(__pyx_t_1);
11032 __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 = 1035; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11033 __Pyx_GOTREF(__pyx_t_2);
11034 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11035 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1035; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11036 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11037 __pyx_t_4 = (!__pyx_t_3);
11039 __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1035; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11040 __Pyx_GOTREF(__pyx_t_2);
11041 __Pyx_INCREF(((PyObject *)__pyx_kp_s_5));
11042 PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_5));
11043 __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_5));
11044 __pyx_t_1 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1035; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11045 __Pyx_GOTREF(__pyx_t_1);
11046 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11047 __Pyx_Raise(__pyx_t_1, 0, 0);
11048 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11049 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1035; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11054 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1037
11055 * if not self._isOpen(): raise ValueError( "I/O operation on closed file" )
11057 * result = {} # <<<<<<<<<<<<<<
11059 * if self.samfile.header.text != NULL:
11061 __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1037; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11062 __Pyx_GOTREF(((PyObject *)__pyx_t_1));
11063 __Pyx_DECREF(((PyObject *)__pyx_v_result));
11064 __pyx_v_result = __pyx_t_1;
11067 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1039
11070 * if self.samfile.header.text != NULL: # <<<<<<<<<<<<<<
11071 * # convert to python string (note: call self.text to create 0-terminated string)
11074 __pyx_t_4 = (((struct __pyx_obj_9csamtools_Samfile *)__pyx_v_self)->samfile->header->text != NULL);
11077 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1041
11078 * if self.samfile.header.text != NULL:
11079 * # convert to python string (note: call self.text to create 0-terminated string)
11080 * t = self.text # <<<<<<<<<<<<<<
11081 * for line in t.split("\n"):
11082 * if not line.strip(): continue
11084 __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__text); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1041; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11085 __Pyx_GOTREF(__pyx_t_1);
11086 __Pyx_DECREF(__pyx_v_t);
11087 __pyx_v_t = __pyx_t_1;
11090 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1042
11091 * # convert to python string (note: call self.text to create 0-terminated string)
11093 * for line in t.split("\n"): # <<<<<<<<<<<<<<
11094 * if not line.strip(): continue
11095 * assert line.startswith("@"), "header line without '@': '%s'" % line
11097 __pyx_t_1 = PyObject_GetAttr(__pyx_v_t, __pyx_n_s__split); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1042; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11098 __Pyx_GOTREF(__pyx_t_1);
11099 __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1042; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11100 __Pyx_GOTREF(__pyx_t_2);
11101 __Pyx_INCREF(((PyObject *)__pyx_kp_s_2));
11102 PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_2));
11103 __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_2));
11104 __pyx_t_6 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1042; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11105 __Pyx_GOTREF(__pyx_t_6);
11106 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11107 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11108 if (PyList_CheckExact(__pyx_t_6) || PyTuple_CheckExact(__pyx_t_6)) {
11109 __pyx_t_5 = 0; __pyx_t_2 = __pyx_t_6; __Pyx_INCREF(__pyx_t_2);
11111 __pyx_t_5 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1042; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11112 __Pyx_GOTREF(__pyx_t_2);
11114 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11116 if (likely(PyList_CheckExact(__pyx_t_2))) {
11117 if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_2)) break;
11118 __pyx_t_6 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_6); __pyx_t_5++;
11119 } else if (likely(PyTuple_CheckExact(__pyx_t_2))) {
11120 if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
11121 __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_6); __pyx_t_5++;
11123 __pyx_t_6 = PyIter_Next(__pyx_t_2);
11125 if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1042; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11128 __Pyx_GOTREF(__pyx_t_6);
11130 __Pyx_DECREF(__pyx_v_line);
11131 __pyx_v_line = __pyx_t_6;
11134 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1043
11136 * for line in t.split("\n"):
11137 * if not line.strip(): continue # <<<<<<<<<<<<<<
11138 * assert line.startswith("@"), "header line without '@': '%s'" % line
11139 * fields = line[1:].split("\t")
11141 __pyx_t_6 = PyObject_GetAttr(__pyx_v_line, __pyx_n_s__strip); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1043; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11142 __Pyx_GOTREF(__pyx_t_6);
11143 __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 = 1043; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11144 __Pyx_GOTREF(__pyx_t_1);
11145 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11146 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1043; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11147 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11148 __pyx_t_3 = (!__pyx_t_4);
11150 goto __pyx_L7_continue;
11155 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1044
11156 * for line in t.split("\n"):
11157 * if not line.strip(): continue
11158 * assert line.startswith("@"), "header line without '@': '%s'" % line # <<<<<<<<<<<<<<
11159 * fields = line[1:].split("\t")
11160 * record = fields[0]
11162 #ifndef PYREX_WITHOUT_ASSERTIONS
11163 __pyx_t_1 = PyObject_GetAttr(__pyx_v_line, __pyx_n_s__startswith); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1044; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11164 __Pyx_GOTREF(__pyx_t_1);
11165 __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1044; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11166 __Pyx_GOTREF(__pyx_t_6);
11167 __Pyx_INCREF(((PyObject *)__pyx_kp_s_44));
11168 PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_kp_s_44));
11169 __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_44));
11170 __pyx_t_7 = PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1044; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11171 __Pyx_GOTREF(__pyx_t_7);
11172 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11173 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11174 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1044; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11175 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
11176 if (unlikely(!__pyx_t_3)) {
11177 __pyx_t_7 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_45), __pyx_v_line); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1044; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11178 __Pyx_GOTREF(((PyObject *)__pyx_t_7));
11179 PyErr_SetObject(PyExc_AssertionError, ((PyObject *)__pyx_t_7));
11180 __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
11181 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1044; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11185 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1045
11186 * if not line.strip(): continue
11187 * assert line.startswith("@"), "header line without '@': '%s'" % line
11188 * fields = line[1:].split("\t") # <<<<<<<<<<<<<<
11189 * record = fields[0]
11190 * assert record in VALID_HEADER_TYPES, "header line with invalid type '%s': '%s'" % (record, line)
11192 __pyx_t_7 = PySequence_GetSlice(__pyx_v_line, 1, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1045; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11193 __Pyx_GOTREF(__pyx_t_7);
11194 __pyx_t_6 = PyObject_GetAttr(__pyx_t_7, __pyx_n_s__split); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1045; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11195 __Pyx_GOTREF(__pyx_t_6);
11196 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
11197 __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1045; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11198 __Pyx_GOTREF(__pyx_t_7);
11199 __Pyx_INCREF(((PyObject *)__pyx_kp_s_1));
11200 PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_kp_s_1));
11201 __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_1));
11202 __pyx_t_1 = PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1045; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11203 __Pyx_GOTREF(__pyx_t_1);
11204 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11205 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
11206 __Pyx_DECREF(__pyx_v_fields);
11207 __pyx_v_fields = __pyx_t_1;
11210 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1046
11211 * assert line.startswith("@"), "header line without '@': '%s'" % line
11212 * fields = line[1:].split("\t")
11213 * record = fields[0] # <<<<<<<<<<<<<<
11214 * assert record in VALID_HEADER_TYPES, "header line with invalid type '%s': '%s'" % (record, line)
11217 __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_fields, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1046; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11218 __Pyx_GOTREF(__pyx_t_1);
11219 __Pyx_DECREF(__pyx_v_record);
11220 __pyx_v_record = __pyx_t_1;
11223 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1047
11224 * fields = line[1:].split("\t")
11225 * record = fields[0]
11226 * assert record in VALID_HEADER_TYPES, "header line with invalid type '%s': '%s'" % (record, line) # <<<<<<<<<<<<<<
11230 #ifndef PYREX_WITHOUT_ASSERTIONS
11231 __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__VALID_HEADER_TYPES); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1047; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11232 __Pyx_GOTREF(__pyx_t_1);
11233 __pyx_t_3 = ((PySequence_Contains(__pyx_t_1, __pyx_v_record))); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1047; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11234 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11235 if (unlikely(!__pyx_t_3)) {
11236 __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1047; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11237 __Pyx_GOTREF(__pyx_t_1);
11238 __Pyx_INCREF(__pyx_v_record);
11239 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_record);
11240 __Pyx_GIVEREF(__pyx_v_record);
11241 __Pyx_INCREF(__pyx_v_line);
11242 PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_line);
11243 __Pyx_GIVEREF(__pyx_v_line);
11244 __pyx_t_7 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_46), __pyx_t_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1047; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11245 __Pyx_GOTREF(((PyObject *)__pyx_t_7));
11246 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11247 PyErr_SetObject(PyExc_AssertionError, ((PyObject *)__pyx_t_7));
11248 __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
11249 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1047; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11253 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1050
11256 * if record == "CO": # <<<<<<<<<<<<<<
11257 * if record not in result: result[record] = []
11258 * result[record].append( "\t".join( fields[1:] ) )
11260 __pyx_t_7 = PyObject_RichCompare(__pyx_v_record, ((PyObject *)__pyx_n_s__CO), Py_EQ); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1050; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11261 __Pyx_GOTREF(__pyx_t_7);
11262 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1050; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11263 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
11266 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1051
11268 * if record == "CO":
11269 * if record not in result: result[record] = [] # <<<<<<<<<<<<<<
11270 * result[record].append( "\t".join( fields[1:] ) )
11273 if (unlikely(((PyObject *)__pyx_v_result) == Py_None)) {
11274 __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1051; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11276 __pyx_t_3 = (__Pyx_NegateNonNeg(PyDict_Contains(((PyObject *)__pyx_v_result), __pyx_v_record))); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1051; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11279 __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1051; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11280 __Pyx_GOTREF(((PyObject *)__pyx_t_7));
11281 if (PyDict_SetItem(((PyObject *)__pyx_v_result), __pyx_v_record, ((PyObject *)__pyx_t_7)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1051; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11282 __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
11287 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1052
11288 * if record == "CO":
11289 * if record not in result: result[record] = []
11290 * result[record].append( "\t".join( fields[1:] ) ) # <<<<<<<<<<<<<<
11294 __pyx_t_7 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_result), __pyx_v_record); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11295 __Pyx_GOTREF(__pyx_t_7);
11296 __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 = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11297 __Pyx_GOTREF(__pyx_t_1);
11298 __pyx_t_6 = PySequence_GetSlice(__pyx_v_fields, 1, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11299 __Pyx_GOTREF(__pyx_t_6);
11300 __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11301 __Pyx_GOTREF(__pyx_t_8);
11302 PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6);
11303 __Pyx_GIVEREF(__pyx_t_6);
11305 __pyx_t_6 = PyObject_Call(__pyx_t_1, __pyx_t_8, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11306 __Pyx_GOTREF(__pyx_t_6);
11307 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11308 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
11309 __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11310 __Pyx_GOTREF(__pyx_t_8);
11311 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
11312 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11313 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
11315 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1053
11316 * if record not in result: result[record] = []
11317 * result[record].append( "\t".join( fields[1:] ) )
11318 * continue # <<<<<<<<<<<<<<
11320 * # the following is clumsy as generators do not work?
11322 goto __pyx_L7_continue;
11327 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1056
11329 * # the following is clumsy as generators do not work?
11330 * x = {} # <<<<<<<<<<<<<<
11331 * for field in fields[1:]:
11332 * key, value = field.split(":",1)
11334 __pyx_t_8 = PyDict_New(); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1056; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11335 __Pyx_GOTREF(((PyObject *)__pyx_t_8));
11336 __Pyx_DECREF(((PyObject *)__pyx_v_x));
11337 __pyx_v_x = __pyx_t_8;
11340 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1057
11341 * # the following is clumsy as generators do not work?
11343 * for field in fields[1:]: # <<<<<<<<<<<<<<
11344 * key, value = field.split(":",1)
11345 * # uppercase keys must be valid
11347 __pyx_t_8 = PySequence_GetSlice(__pyx_v_fields, 1, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11348 __Pyx_GOTREF(__pyx_t_8);
11349 if (PyList_CheckExact(__pyx_t_8) || PyTuple_CheckExact(__pyx_t_8)) {
11350 __pyx_t_9 = 0; __pyx_t_6 = __pyx_t_8; __Pyx_INCREF(__pyx_t_6);
11352 __pyx_t_9 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11353 __Pyx_GOTREF(__pyx_t_6);
11355 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
11357 if (likely(PyList_CheckExact(__pyx_t_6))) {
11358 if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_6)) break;
11359 __pyx_t_8 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_9); __Pyx_INCREF(__pyx_t_8); __pyx_t_9++;
11360 } else if (likely(PyTuple_CheckExact(__pyx_t_6))) {
11361 if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
11362 __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_9); __Pyx_INCREF(__pyx_t_8); __pyx_t_9++;
11364 __pyx_t_8 = PyIter_Next(__pyx_t_6);
11366 if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11369 __Pyx_GOTREF(__pyx_t_8);
11371 __Pyx_DECREF(__pyx_v_field);
11372 __pyx_v_field = __pyx_t_8;
11375 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1058
11377 * for field in fields[1:]:
11378 * key, value = field.split(":",1) # <<<<<<<<<<<<<<
11379 * # uppercase keys must be valid
11380 * # lowercase are permitted for user fields
11382 __pyx_t_8 = PyObject_GetAttr(__pyx_v_field, __pyx_n_s__split); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1058; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11383 __Pyx_GOTREF(__pyx_t_8);
11384 __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1058; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11385 __Pyx_GOTREF(__pyx_t_7);
11386 __Pyx_INCREF(((PyObject *)__pyx_kp_s_47));
11387 PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_kp_s_47));
11388 __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_47));
11389 __Pyx_INCREF(__pyx_int_1);
11390 PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_int_1);
11391 __Pyx_GIVEREF(__pyx_int_1);
11392 __pyx_t_1 = PyObject_Call(__pyx_t_8, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1058; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11393 __Pyx_GOTREF(__pyx_t_1);
11394 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
11395 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
11396 if (PyTuple_CheckExact(__pyx_t_1) && likely(PyTuple_GET_SIZE(__pyx_t_1) == 2)) {
11397 PyObject* tuple = __pyx_t_1;
11398 __pyx_t_7 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_7);
11399 __pyx_t_8 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_8);
11400 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11401 __Pyx_DECREF(__pyx_v_key);
11402 __pyx_v_key = __pyx_t_7;
11404 __Pyx_DECREF(__pyx_v_value);
11405 __pyx_v_value = __pyx_t_8;
11408 __pyx_t_10 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1058; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11409 __Pyx_GOTREF(__pyx_t_10);
11410 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11411 __pyx_t_7 = __Pyx_UnpackItem(__pyx_t_10, 0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1058; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11412 __Pyx_GOTREF(__pyx_t_7);
11413 __pyx_t_8 = __Pyx_UnpackItem(__pyx_t_10, 1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1058; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11414 __Pyx_GOTREF(__pyx_t_8);
11415 if (__Pyx_EndUnpack(__pyx_t_10, 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1058; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11416 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
11417 __Pyx_DECREF(__pyx_v_key);
11418 __pyx_v_key = __pyx_t_7;
11420 __Pyx_DECREF(__pyx_v_value);
11421 __pyx_v_value = __pyx_t_8;
11425 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1061
11426 * # uppercase keys must be valid
11427 * # lowercase are permitted for user fields
11428 * if key in VALID_HEADER_FIELDS[record]: # <<<<<<<<<<<<<<
11429 * x[key] = VALID_HEADER_FIELDS[record][key](value)
11430 * elif not key.isupper():
11432 __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__VALID_HEADER_FIELDS); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1061; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11433 __Pyx_GOTREF(__pyx_t_1);
11434 __pyx_t_8 = PyObject_GetItem(__pyx_t_1, __pyx_v_record); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1061; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11435 __Pyx_GOTREF(__pyx_t_8);
11436 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11437 __pyx_t_3 = ((PySequence_Contains(__pyx_t_8, __pyx_v_key))); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1061; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11438 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
11441 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1062
11442 * # lowercase are permitted for user fields
11443 * if key in VALID_HEADER_FIELDS[record]:
11444 * x[key] = VALID_HEADER_FIELDS[record][key](value) # <<<<<<<<<<<<<<
11445 * elif not key.isupper():
11448 __pyx_t_8 = __Pyx_GetName(__pyx_m, __pyx_n_s__VALID_HEADER_FIELDS); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1062; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11449 __Pyx_GOTREF(__pyx_t_8);
11450 __pyx_t_1 = PyObject_GetItem(__pyx_t_8, __pyx_v_record); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1062; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11451 __Pyx_GOTREF(__pyx_t_1);
11452 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
11453 __pyx_t_8 = PyObject_GetItem(__pyx_t_1, __pyx_v_key); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1062; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11454 __Pyx_GOTREF(__pyx_t_8);
11455 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11456 __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1062; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11457 __Pyx_GOTREF(__pyx_t_1);
11458 __Pyx_INCREF(__pyx_v_value);
11459 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_value);
11460 __Pyx_GIVEREF(__pyx_v_value);
11461 __pyx_t_7 = PyObject_Call(__pyx_t_8, __pyx_t_1, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1062; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11462 __Pyx_GOTREF(__pyx_t_7);
11463 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
11464 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11465 if (PyDict_SetItem(((PyObject *)__pyx_v_x), __pyx_v_key, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1062; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11466 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
11470 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1063
11471 * if key in VALID_HEADER_FIELDS[record]:
11472 * x[key] = VALID_HEADER_FIELDS[record][key](value)
11473 * elif not key.isupper(): # <<<<<<<<<<<<<<
11477 __pyx_t_7 = PyObject_GetAttr(__pyx_v_key, __pyx_n_s__isupper); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1063; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11478 __Pyx_GOTREF(__pyx_t_7);
11479 __pyx_t_1 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1063; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11480 __Pyx_GOTREF(__pyx_t_1);
11481 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
11482 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1063; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11483 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11484 __pyx_t_4 = (!__pyx_t_3);
11487 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1064
11488 * x[key] = VALID_HEADER_FIELDS[record][key](value)
11489 * elif not key.isupper():
11490 * x[key] = value # <<<<<<<<<<<<<<
11492 * raise ValueError( "unknown field code '%s' in record '%s'" % (key, record) )
11494 if (PyDict_SetItem(((PyObject *)__pyx_v_x), __pyx_v_key, __pyx_v_value) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1064; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11499 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1066
11502 * raise ValueError( "unknown field code '%s' in record '%s'" % (key, record) ) # <<<<<<<<<<<<<<
11504 * if VALID_HEADER_TYPES[record] == dict:
11506 __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1066; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11507 __Pyx_GOTREF(__pyx_t_1);
11508 __Pyx_INCREF(__pyx_v_key);
11509 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_key);
11510 __Pyx_GIVEREF(__pyx_v_key);
11511 __Pyx_INCREF(__pyx_v_record);
11512 PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_record);
11513 __Pyx_GIVEREF(__pyx_v_record);
11514 __pyx_t_7 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_48), __pyx_t_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1066; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11515 __Pyx_GOTREF(((PyObject *)__pyx_t_7));
11516 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11517 __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1066; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11518 __Pyx_GOTREF(__pyx_t_1);
11519 PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_7));
11520 __Pyx_GIVEREF(((PyObject *)__pyx_t_7));
11522 __pyx_t_7 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1066; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11523 __Pyx_GOTREF(__pyx_t_7);
11524 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11525 __Pyx_Raise(__pyx_t_7, 0, 0);
11526 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
11527 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1066; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11531 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11533 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1068
11534 * raise ValueError( "unknown field code '%s' in record '%s'" % (key, record) )
11536 * if VALID_HEADER_TYPES[record] == dict: # <<<<<<<<<<<<<<
11537 * if record in result:
11538 * raise ValueError( "multiple '%s' lines are not permitted" % record )
11540 __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__VALID_HEADER_TYPES); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11541 __Pyx_GOTREF(__pyx_t_6);
11542 __pyx_t_7 = PyObject_GetItem(__pyx_t_6, __pyx_v_record); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11543 __Pyx_GOTREF(__pyx_t_7);
11544 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11545 __pyx_t_6 = PyObject_RichCompare(__pyx_t_7, ((PyObject *)((PyObject*)&PyDict_Type)), Py_EQ); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11546 __Pyx_GOTREF(__pyx_t_6);
11547 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
11548 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11549 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11552 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1069
11554 * if VALID_HEADER_TYPES[record] == dict:
11555 * if record in result: # <<<<<<<<<<<<<<
11556 * raise ValueError( "multiple '%s' lines are not permitted" % record )
11557 * result[record] = x
11559 if (unlikely(((PyObject *)__pyx_v_result) == Py_None)) {
11560 __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1069; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11562 __pyx_t_4 = ((PyDict_Contains(((PyObject *)__pyx_v_result), __pyx_v_record))); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1069; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11566 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1070
11567 * if VALID_HEADER_TYPES[record] == dict:
11568 * if record in result:
11569 * raise ValueError( "multiple '%s' lines are not permitted" % record ) # <<<<<<<<<<<<<<
11570 * result[record] = x
11571 * elif VALID_HEADER_TYPES[record] == list:
11573 __pyx_t_6 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_49), __pyx_v_record); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11574 __Pyx_GOTREF(((PyObject *)__pyx_t_6));
11575 __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11576 __Pyx_GOTREF(__pyx_t_7);
11577 PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_t_6));
11578 __Pyx_GIVEREF(((PyObject *)__pyx_t_6));
11580 __pyx_t_6 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11581 __Pyx_GOTREF(__pyx_t_6);
11582 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
11583 __Pyx_Raise(__pyx_t_6, 0, 0);
11584 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11585 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11590 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1071
11591 * if record in result:
11592 * raise ValueError( "multiple '%s' lines are not permitted" % record )
11593 * result[record] = x # <<<<<<<<<<<<<<
11594 * elif VALID_HEADER_TYPES[record] == list:
11595 * if record not in result: result[record] = []
11597 if (PyDict_SetItem(((PyObject *)__pyx_v_result), __pyx_v_record, ((PyObject *)__pyx_v_x)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11601 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1072
11602 * raise ValueError( "multiple '%s' lines are not permitted" % record )
11603 * result[record] = x
11604 * elif VALID_HEADER_TYPES[record] == list: # <<<<<<<<<<<<<<
11605 * if record not in result: result[record] = []
11606 * result[record].append( x )
11608 __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__VALID_HEADER_TYPES); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1072; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11609 __Pyx_GOTREF(__pyx_t_6);
11610 __pyx_t_7 = PyObject_GetItem(__pyx_t_6, __pyx_v_record); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1072; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11611 __Pyx_GOTREF(__pyx_t_7);
11612 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11613 __pyx_t_6 = PyObject_RichCompare(__pyx_t_7, ((PyObject *)((PyObject*)&PyList_Type)), Py_EQ); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1072; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11614 __Pyx_GOTREF(__pyx_t_6);
11615 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
11616 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1072; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11617 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11620 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1073
11621 * result[record] = x
11622 * elif VALID_HEADER_TYPES[record] == list:
11623 * if record not in result: result[record] = [] # <<<<<<<<<<<<<<
11624 * result[record].append( x )
11627 if (unlikely(((PyObject *)__pyx_v_result) == Py_None)) {
11628 __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1073; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11630 __pyx_t_4 = (__Pyx_NegateNonNeg(PyDict_Contains(((PyObject *)__pyx_v_result), __pyx_v_record))); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1073; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11633 __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1073; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11634 __Pyx_GOTREF(((PyObject *)__pyx_t_6));
11635 if (PyDict_SetItem(((PyObject *)__pyx_v_result), __pyx_v_record, ((PyObject *)__pyx_t_6)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1073; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11636 __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
11641 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1074
11642 * elif VALID_HEADER_TYPES[record] == list:
11643 * if record not in result: result[record] = []
11644 * result[record].append( x ) # <<<<<<<<<<<<<<
11648 __pyx_t_6 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_result), __pyx_v_record); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1074; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11649 __Pyx_GOTREF(__pyx_t_6);
11650 __pyx_t_7 = __Pyx_PyObject_Append(__pyx_t_6, ((PyObject *)__pyx_v_x)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1074; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11651 __Pyx_GOTREF(__pyx_t_7);
11652 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11653 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
11657 __pyx_L7_continue:;
11659 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11664 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1076
11665 * result[record].append( x )
11667 * return result # <<<<<<<<<<<<<<
11669 * def _buildLine( self, fields, record ):
11671 __Pyx_XDECREF(__pyx_r);
11672 __Pyx_INCREF(((PyObject *)__pyx_v_result));
11673 __pyx_r = ((PyObject *)__pyx_v_result);
11676 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11679 __Pyx_XDECREF(__pyx_t_1);
11680 __Pyx_XDECREF(__pyx_t_2);
11681 __Pyx_XDECREF(__pyx_t_6);
11682 __Pyx_XDECREF(__pyx_t_7);
11683 __Pyx_XDECREF(__pyx_t_8);
11684 __Pyx_XDECREF(__pyx_t_10);
11685 __Pyx_AddTraceback("csamtools.Samfile.header.__get__");
11688 __Pyx_DECREF(__pyx_v_result);
11689 __Pyx_DECREF(__pyx_v_t);
11690 __Pyx_DECREF(__pyx_v_line);
11691 __Pyx_DECREF(__pyx_v_fields);
11692 __Pyx_DECREF(__pyx_v_record);
11693 __Pyx_DECREF(__pyx_v_x);
11694 __Pyx_DECREF(__pyx_v_field);
11695 __Pyx_DECREF(__pyx_v_key);
11696 __Pyx_DECREF(__pyx_v_value);
11697 __Pyx_XGIVEREF(__pyx_r);
11698 __Pyx_TraceReturn(__pyx_r);
11699 __Pyx_RefNannyFinishContext();
11703 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1078
11706 * def _buildLine( self, fields, record ): # <<<<<<<<<<<<<<
11707 * '''build a header line from *fields* dictionary for *record*'''
11711 static PyObject *__pyx_pf_9csamtools_7Samfile__buildLine(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
11712 static char __pyx_doc_9csamtools_7Samfile__buildLine[] = "Samfile._buildLine(self, fields, record)\nbuild a header line from *fields* dictionary for *record*";
11713 static PyObject *__pyx_pf_9csamtools_7Samfile__buildLine(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
11714 PyObject *__pyx_v_fields = 0;
11715 PyObject *__pyx_v_record = 0;
11716 PyObject *__pyx_v_line;
11717 PyObject *__pyx_v_key;
11718 PyObject *__pyx_r = NULL;
11719 PyObject *__pyx_t_1 = NULL;
11720 PyObject *__pyx_t_2 = NULL;
11723 Py_ssize_t __pyx_t_5;
11724 PyObject *__pyx_t_6 = NULL;
11726 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__fields,&__pyx_n_s__record,0};
11727 __Pyx_TraceDeclarations
11728 __Pyx_RefNannySetupContext("_buildLine");
11729 __Pyx_TraceCall("_buildLine", __pyx_f[0], 1078);
11730 if (unlikely(__pyx_kwds)) {
11731 Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
11732 PyObject* values[2] = {0,0};
11733 switch (PyTuple_GET_SIZE(__pyx_args)) {
11734 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
11735 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
11737 default: goto __pyx_L5_argtuple_error;
11739 switch (PyTuple_GET_SIZE(__pyx_args)) {
11741 values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__fields);
11742 if (likely(values[0])) kw_args--;
11743 else goto __pyx_L5_argtuple_error;
11745 values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__record);
11746 if (likely(values[1])) kw_args--;
11748 __Pyx_RaiseArgtupleInvalid("_buildLine", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
11751 if (unlikely(kw_args > 0)) {
11752 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "_buildLine") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
11754 __pyx_v_fields = values[0];
11755 __pyx_v_record = values[1];
11756 } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
11757 goto __pyx_L5_argtuple_error;
11759 __pyx_v_fields = PyTuple_GET_ITEM(__pyx_args, 0);
11760 __pyx_v_record = PyTuple_GET_ITEM(__pyx_args, 1);
11762 goto __pyx_L4_argument_unpacking_done;
11763 __pyx_L5_argtuple_error:;
11764 __Pyx_RaiseArgtupleInvalid("_buildLine", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
11766 __Pyx_AddTraceback("csamtools.Samfile._buildLine");
11767 __Pyx_RefNannyFinishContext();
11769 __pyx_L4_argument_unpacking_done:;
11770 __pyx_v_line = ((PyObject *)Py_None); __Pyx_INCREF(Py_None);
11771 __pyx_v_key = Py_None; __Pyx_INCREF(Py_None);
11773 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1082
11775 * # TODO: add checking for field and sort order
11776 * line = ["@%s" % record ] # <<<<<<<<<<<<<<
11777 * if record == "CO":
11778 * line.append( fields )
11780 __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_50), __pyx_v_record); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1082; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11781 __Pyx_GOTREF(((PyObject *)__pyx_t_1));
11782 __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1082; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11783 __Pyx_GOTREF(((PyObject *)__pyx_t_2));
11784 PyList_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_1));
11785 __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
11787 __Pyx_DECREF(((PyObject *)__pyx_v_line));
11788 __pyx_v_line = __pyx_t_2;
11791 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1083
11792 * # TODO: add checking for field and sort order
11793 * line = ["@%s" % record ]
11794 * if record == "CO": # <<<<<<<<<<<<<<
11795 * line.append( fields )
11798 __pyx_t_2 = PyObject_RichCompare(__pyx_v_record, ((PyObject *)__pyx_n_s__CO), Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1083; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11799 __Pyx_GOTREF(__pyx_t_2);
11800 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1083; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11801 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11804 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1084
11805 * line = ["@%s" % record ]
11806 * if record == "CO":
11807 * line.append( fields ) # <<<<<<<<<<<<<<
11809 * # write fields of the specification
11811 if (unlikely(__pyx_v_line == Py_None)) {
11812 PyErr_SetString(PyExc_AttributeError, "'NoneType' object has no attribute 'append'"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1084; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11814 __pyx_t_4 = PyList_Append(((PyObject *)__pyx_v_line), __pyx_v_fields); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1084; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11819 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1087
11821 * # write fields of the specification
11822 * for key in VALID_HEADER_ORDER[record]: # <<<<<<<<<<<<<<
11823 * if key in fields:
11824 * line.append( "%s:%s" % (key, str(fields[key])))
11826 __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__VALID_HEADER_ORDER); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1087; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11827 __Pyx_GOTREF(__pyx_t_2);
11828 __pyx_t_1 = PyObject_GetItem(__pyx_t_2, __pyx_v_record); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1087; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11829 __Pyx_GOTREF(__pyx_t_1);
11830 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11831 if (PyList_CheckExact(__pyx_t_1) || PyTuple_CheckExact(__pyx_t_1)) {
11832 __pyx_t_5 = 0; __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2);
11834 __pyx_t_5 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1087; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11835 __Pyx_GOTREF(__pyx_t_2);
11837 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11839 if (likely(PyList_CheckExact(__pyx_t_2))) {
11840 if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_2)) break;
11841 __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++;
11842 } else if (likely(PyTuple_CheckExact(__pyx_t_2))) {
11843 if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
11844 __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++;
11846 __pyx_t_1 = PyIter_Next(__pyx_t_2);
11848 if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1087; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11851 __Pyx_GOTREF(__pyx_t_1);
11853 __Pyx_DECREF(__pyx_v_key);
11854 __pyx_v_key = __pyx_t_1;
11857 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1088
11858 * # write fields of the specification
11859 * for key in VALID_HEADER_ORDER[record]:
11860 * if key in fields: # <<<<<<<<<<<<<<
11861 * line.append( "%s:%s" % (key, str(fields[key])))
11862 * # write user fields
11864 __pyx_t_3 = ((PySequence_Contains(__pyx_v_fields, __pyx_v_key))); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1088; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11867 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1089
11868 * for key in VALID_HEADER_ORDER[record]:
11869 * if key in fields:
11870 * line.append( "%s:%s" % (key, str(fields[key]))) # <<<<<<<<<<<<<<
11871 * # write user fields
11872 * for key in fields:
11874 if (unlikely(__pyx_v_line == Py_None)) {
11875 PyErr_SetString(PyExc_AttributeError, "'NoneType' object has no attribute 'append'"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1089; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11877 __pyx_t_1 = PyObject_GetItem(__pyx_v_fields, __pyx_v_key); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1089; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11878 __Pyx_GOTREF(__pyx_t_1);
11879 __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1089; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11880 __Pyx_GOTREF(__pyx_t_6);
11881 PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1);
11882 __Pyx_GIVEREF(__pyx_t_1);
11884 __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)&PyString_Type)), __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1089; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11885 __Pyx_GOTREF(__pyx_t_1);
11886 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11887 __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1089; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11888 __Pyx_GOTREF(__pyx_t_6);
11889 __Pyx_INCREF(__pyx_v_key);
11890 PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_key);
11891 __Pyx_GIVEREF(__pyx_v_key);
11892 PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_1);
11893 __Pyx_GIVEREF(__pyx_t_1);
11895 __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_51), __pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1089; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11896 __Pyx_GOTREF(((PyObject *)__pyx_t_1));
11897 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11898 __pyx_t_4 = PyList_Append(((PyObject *)__pyx_v_line), ((PyObject *)__pyx_t_1)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1089; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11899 __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
11904 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11906 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1091
11907 * line.append( "%s:%s" % (key, str(fields[key])))
11908 * # write user fields
11909 * for key in fields: # <<<<<<<<<<<<<<
11910 * if not key.isupper():
11911 * line.append( "%s:%s" % (key, str(fields[key])))
11913 if (PyList_CheckExact(__pyx_v_fields) || PyTuple_CheckExact(__pyx_v_fields)) {
11914 __pyx_t_5 = 0; __pyx_t_2 = __pyx_v_fields; __Pyx_INCREF(__pyx_t_2);
11916 __pyx_t_5 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_fields); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1091; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11917 __Pyx_GOTREF(__pyx_t_2);
11920 if (likely(PyList_CheckExact(__pyx_t_2))) {
11921 if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_2)) break;
11922 __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++;
11923 } else if (likely(PyTuple_CheckExact(__pyx_t_2))) {
11924 if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
11925 __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++;
11927 __pyx_t_1 = PyIter_Next(__pyx_t_2);
11929 if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1091; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11932 __Pyx_GOTREF(__pyx_t_1);
11934 __Pyx_DECREF(__pyx_v_key);
11935 __pyx_v_key = __pyx_t_1;
11938 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1092
11939 * # write user fields
11940 * for key in fields:
11941 * if not key.isupper(): # <<<<<<<<<<<<<<
11942 * line.append( "%s:%s" % (key, str(fields[key])))
11945 __pyx_t_1 = PyObject_GetAttr(__pyx_v_key, __pyx_n_s__isupper); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1092; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11946 __Pyx_GOTREF(__pyx_t_1);
11947 __pyx_t_6 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1092; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11948 __Pyx_GOTREF(__pyx_t_6);
11949 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11950 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1092; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11951 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11952 __pyx_t_7 = (!__pyx_t_3);
11955 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1093
11956 * for key in fields:
11957 * if not key.isupper():
11958 * line.append( "%s:%s" % (key, str(fields[key]))) # <<<<<<<<<<<<<<
11960 * return "\t".join( line )
11962 if (unlikely(__pyx_v_line == Py_None)) {
11963 PyErr_SetString(PyExc_AttributeError, "'NoneType' object has no attribute 'append'"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1093; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11965 __pyx_t_6 = PyObject_GetItem(__pyx_v_fields, __pyx_v_key); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1093; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11966 __Pyx_GOTREF(__pyx_t_6);
11967 __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1093; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11968 __Pyx_GOTREF(__pyx_t_1);
11969 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6);
11970 __Pyx_GIVEREF(__pyx_t_6);
11972 __pyx_t_6 = PyObject_Call(((PyObject *)((PyObject*)&PyString_Type)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1093; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11973 __Pyx_GOTREF(__pyx_t_6);
11974 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11975 __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1093; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11976 __Pyx_GOTREF(__pyx_t_1);
11977 __Pyx_INCREF(__pyx_v_key);
11978 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_key);
11979 __Pyx_GIVEREF(__pyx_v_key);
11980 PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_6);
11981 __Pyx_GIVEREF(__pyx_t_6);
11983 __pyx_t_6 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_51), __pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1093; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11984 __Pyx_GOTREF(((PyObject *)__pyx_t_6));
11985 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11986 __pyx_t_4 = PyList_Append(((PyObject *)__pyx_v_line), ((PyObject *)__pyx_t_6)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1093; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11987 __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
11992 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11996 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1095
11997 * line.append( "%s:%s" % (key, str(fields[key])))
11999 * return "\t".join( line ) # <<<<<<<<<<<<<<
12001 * cdef bam_header_t * _buildHeader( self, new_header ):
12003 __Pyx_XDECREF(__pyx_r);
12004 __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_kp_s_1), __pyx_n_s__join); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1095; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12005 __Pyx_GOTREF(__pyx_t_2);
12006 __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1095; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12007 __Pyx_GOTREF(__pyx_t_6);
12008 __Pyx_INCREF(((PyObject *)__pyx_v_line));
12009 PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_line));
12010 __Pyx_GIVEREF(((PyObject *)__pyx_v_line));
12011 __pyx_t_1 = PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1095; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12012 __Pyx_GOTREF(__pyx_t_1);
12013 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12014 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12015 __pyx_r = __pyx_t_1;
12019 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12022 __Pyx_XDECREF(__pyx_t_1);
12023 __Pyx_XDECREF(__pyx_t_2);
12024 __Pyx_XDECREF(__pyx_t_6);
12025 __Pyx_AddTraceback("csamtools.Samfile._buildLine");
12028 __Pyx_DECREF(__pyx_v_line);
12029 __Pyx_DECREF(__pyx_v_key);
12030 __Pyx_XGIVEREF(__pyx_r);
12031 __Pyx_TraceReturn(__pyx_r);
12032 __Pyx_RefNannyFinishContext();
12036 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1097
12037 * return "\t".join( line )
12039 * cdef bam_header_t * _buildHeader( self, new_header ): # <<<<<<<<<<<<<<
12040 * '''return a new header built from a dictionary in *new_header*.
12044 static bam_header_t *__pyx_f_9csamtools_7Samfile__buildHeader(struct __pyx_obj_9csamtools_Samfile *__pyx_v_self, PyObject *__pyx_v_new_header) {
12045 PyObject *__pyx_v_lines;
12046 bam_header_t *__pyx_v_dest;
12047 PyObject *__pyx_v_record;
12048 PyObject *__pyx_v_ttype;
12049 PyObject *__pyx_v_data;
12050 PyObject *__pyx_v_fields;
12051 PyObject *__pyx_v_text;
12052 PyObject *__pyx_v_seqs;
12054 PyObject *__pyx_v_seqname;
12055 PyObject *__pyx_v_seqlen;
12056 bam_header_t *__pyx_r;
12057 PyObject *__pyx_t_1 = NULL;
12058 Py_ssize_t __pyx_t_2;
12059 PyObject *__pyx_t_3 = NULL;
12061 PyObject *__pyx_t_5 = NULL;
12062 PyObject *__pyx_t_6 = NULL;
12064 Py_ssize_t __pyx_t_8;
12065 PyObject *__pyx_t_9 = NULL;
12067 PyObject *__pyx_t_11 = NULL;
12068 int32_t __pyx_t_12;
12069 uint32_t __pyx_t_13;
12070 __Pyx_TraceDeclarations
12071 __Pyx_RefNannySetupContext("_buildHeader");
12072 __Pyx_TraceCall("_buildHeader", __pyx_f[0], 1097);
12073 __pyx_v_lines = ((PyObject *)Py_None); __Pyx_INCREF(Py_None);
12074 __pyx_v_record = Py_None; __Pyx_INCREF(Py_None);
12075 __pyx_v_ttype = Py_None; __Pyx_INCREF(Py_None);
12076 __pyx_v_data = Py_None; __Pyx_INCREF(Py_None);
12077 __pyx_v_fields = Py_None; __Pyx_INCREF(Py_None);
12078 __pyx_v_text = Py_None; __Pyx_INCREF(Py_None);
12079 __pyx_v_seqs = ((PyObject *)Py_None); __Pyx_INCREF(Py_None);
12080 __pyx_v_seqname = Py_None; __Pyx_INCREF(Py_None);
12081 __pyx_v_seqlen = Py_None; __Pyx_INCREF(Py_None);
12083 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1103
12086 * lines = [] # <<<<<<<<<<<<<<
12088 * # check if hash exists
12090 __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12091 __Pyx_GOTREF(((PyObject *)__pyx_t_1));
12092 __Pyx_DECREF(((PyObject *)__pyx_v_lines));
12093 __pyx_v_lines = __pyx_t_1;
12096 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1110
12097 * cdef bam_header_t * dest
12099 * dest = bam_header_init() # <<<<<<<<<<<<<<
12101 * for record in VALID_HEADERS:
12103 __pyx_v_dest = bam_header_init();
12105 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1112
12106 * dest = bam_header_init()
12108 * for record in VALID_HEADERS: # <<<<<<<<<<<<<<
12109 * if record in new_header:
12110 * ttype = VALID_HEADER_TYPES[record]
12112 __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__VALID_HEADERS); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12113 __Pyx_GOTREF(__pyx_t_1);
12114 if (PyList_CheckExact(__pyx_t_1) || PyTuple_CheckExact(__pyx_t_1)) {
12115 __pyx_t_2 = 0; __pyx_t_3 = __pyx_t_1; __Pyx_INCREF(__pyx_t_3);
12117 __pyx_t_2 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12118 __Pyx_GOTREF(__pyx_t_3);
12120 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12122 if (likely(PyList_CheckExact(__pyx_t_3))) {
12123 if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_3)) break;
12124 __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_1); __pyx_t_2++;
12125 } else if (likely(PyTuple_CheckExact(__pyx_t_3))) {
12126 if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
12127 __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_1); __pyx_t_2++;
12129 __pyx_t_1 = PyIter_Next(__pyx_t_3);
12131 if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12134 __Pyx_GOTREF(__pyx_t_1);
12136 __Pyx_DECREF(__pyx_v_record);
12137 __pyx_v_record = __pyx_t_1;
12140 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1113
12142 * for record in VALID_HEADERS:
12143 * if record in new_header: # <<<<<<<<<<<<<<
12144 * ttype = VALID_HEADER_TYPES[record]
12145 * data = new_header[record]
12147 __pyx_t_4 = ((PySequence_Contains(__pyx_v_new_header, __pyx_v_record))); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12150 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1114
12151 * for record in VALID_HEADERS:
12152 * if record in new_header:
12153 * ttype = VALID_HEADER_TYPES[record] # <<<<<<<<<<<<<<
12154 * data = new_header[record]
12155 * if type( data ) != type( ttype() ):
12157 __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__VALID_HEADER_TYPES); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12158 __Pyx_GOTREF(__pyx_t_1);
12159 __pyx_t_5 = PyObject_GetItem(__pyx_t_1, __pyx_v_record); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12160 __Pyx_GOTREF(__pyx_t_5);
12161 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12162 __Pyx_DECREF(__pyx_v_ttype);
12163 __pyx_v_ttype = __pyx_t_5;
12166 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1115
12167 * if record in new_header:
12168 * ttype = VALID_HEADER_TYPES[record]
12169 * data = new_header[record] # <<<<<<<<<<<<<<
12170 * if type( data ) != type( ttype() ):
12171 * raise ValueError( "invalid type for record %s: %s, expected %s" % (record, type(data), type(ttype()) ) )
12173 __pyx_t_5 = PyObject_GetItem(__pyx_v_new_header, __pyx_v_record); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12174 __Pyx_GOTREF(__pyx_t_5);
12175 __Pyx_DECREF(__pyx_v_data);
12176 __pyx_v_data = __pyx_t_5;
12179 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1116
12180 * ttype = VALID_HEADER_TYPES[record]
12181 * data = new_header[record]
12182 * if type( data ) != type( ttype() ): # <<<<<<<<<<<<<<
12183 * raise ValueError( "invalid type for record %s: %s, expected %s" % (record, type(data), type(ttype()) ) )
12184 * if type( data ) == types.DictType:
12186 __pyx_t_5 = PyObject_Call(__pyx_v_ttype, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12187 __Pyx_GOTREF(__pyx_t_5);
12188 __pyx_t_1 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_data)), ((PyObject *)Py_TYPE(__pyx_t_5)), Py_NE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12189 __Pyx_GOTREF(__pyx_t_1);
12190 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12191 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12192 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12195 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1117
12196 * data = new_header[record]
12197 * if type( data ) != type( ttype() ):
12198 * raise ValueError( "invalid type for record %s: %s, expected %s" % (record, type(data), type(ttype()) ) ) # <<<<<<<<<<<<<<
12199 * if type( data ) == types.DictType:
12200 * lines.append( self._buildLine( data, record ) )
12202 __pyx_t_1 = PyObject_Call(__pyx_v_ttype, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12203 __Pyx_GOTREF(__pyx_t_1);
12204 __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12205 __Pyx_GOTREF(__pyx_t_5);
12206 __Pyx_INCREF(__pyx_v_record);
12207 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_record);
12208 __Pyx_GIVEREF(__pyx_v_record);
12209 __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_data)));
12210 PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)Py_TYPE(__pyx_v_data)));
12211 __Pyx_GIVEREF(((PyObject *)Py_TYPE(__pyx_v_data)));
12212 __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_t_1)));
12213 PyTuple_SET_ITEM(__pyx_t_5, 2, ((PyObject *)Py_TYPE(__pyx_t_1)));
12214 __Pyx_GIVEREF(((PyObject *)Py_TYPE(__pyx_t_1)));
12215 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12216 __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_52), __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12217 __Pyx_GOTREF(((PyObject *)__pyx_t_1));
12218 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12219 __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12220 __Pyx_GOTREF(__pyx_t_5);
12221 PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_1));
12222 __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
12224 __pyx_t_1 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12225 __Pyx_GOTREF(__pyx_t_1);
12226 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12227 __Pyx_Raise(__pyx_t_1, 0, 0);
12228 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12229 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12234 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1118
12235 * if type( data ) != type( ttype() ):
12236 * raise ValueError( "invalid type for record %s: %s, expected %s" % (record, type(data), type(ttype()) ) )
12237 * if type( data ) == types.DictType: # <<<<<<<<<<<<<<
12238 * lines.append( self._buildLine( data, record ) )
12241 __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__types); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12242 __Pyx_GOTREF(__pyx_t_1);
12243 __pyx_t_5 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__DictType); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12244 __Pyx_GOTREF(__pyx_t_5);
12245 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12246 __pyx_t_1 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_data)), __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12247 __Pyx_GOTREF(__pyx_t_1);
12248 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12249 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12250 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12253 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1119
12254 * raise ValueError( "invalid type for record %s: %s, expected %s" % (record, type(data), type(ttype()) ) )
12255 * if type( data ) == types.DictType:
12256 * lines.append( self._buildLine( data, record ) ) # <<<<<<<<<<<<<<
12258 * for fields in new_header[record]:
12260 if (unlikely(__pyx_v_lines == Py_None)) {
12261 PyErr_SetString(PyExc_AttributeError, "'NoneType' object has no attribute 'append'"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12263 __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s___buildLine); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12264 __Pyx_GOTREF(__pyx_t_1);
12265 __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12266 __Pyx_GOTREF(__pyx_t_5);
12267 __Pyx_INCREF(__pyx_v_data);
12268 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_data);
12269 __Pyx_GIVEREF(__pyx_v_data);
12270 __Pyx_INCREF(__pyx_v_record);
12271 PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_record);
12272 __Pyx_GIVEREF(__pyx_v_record);
12273 __pyx_t_6 = PyObject_Call(__pyx_t_1, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12274 __Pyx_GOTREF(__pyx_t_6);
12275 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12276 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12277 __pyx_t_7 = PyList_Append(((PyObject *)__pyx_v_lines), __pyx_t_6); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12278 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12283 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1121
12284 * lines.append( self._buildLine( data, record ) )
12286 * for fields in new_header[record]: # <<<<<<<<<<<<<<
12287 * lines.append( self._buildLine( fields, record ) )
12290 __pyx_t_6 = PyObject_GetItem(__pyx_v_new_header, __pyx_v_record); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12291 __Pyx_GOTREF(__pyx_t_6);
12292 if (PyList_CheckExact(__pyx_t_6) || PyTuple_CheckExact(__pyx_t_6)) {
12293 __pyx_t_8 = 0; __pyx_t_5 = __pyx_t_6; __Pyx_INCREF(__pyx_t_5);
12295 __pyx_t_8 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12296 __Pyx_GOTREF(__pyx_t_5);
12298 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12300 if (likely(PyList_CheckExact(__pyx_t_5))) {
12301 if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_5)) break;
12302 __pyx_t_6 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_6); __pyx_t_8++;
12303 } else if (likely(PyTuple_CheckExact(__pyx_t_5))) {
12304 if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
12305 __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_6); __pyx_t_8++;
12307 __pyx_t_6 = PyIter_Next(__pyx_t_5);
12309 if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12312 __Pyx_GOTREF(__pyx_t_6);
12314 __Pyx_DECREF(__pyx_v_fields);
12315 __pyx_v_fields = __pyx_t_6;
12318 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1122
12320 * for fields in new_header[record]:
12321 * lines.append( self._buildLine( fields, record ) ) # <<<<<<<<<<<<<<
12323 * text = "\n".join(lines) + "\n"
12325 if (unlikely(__pyx_v_lines == Py_None)) {
12326 PyErr_SetString(PyExc_AttributeError, "'NoneType' object has no attribute 'append'"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12328 __pyx_t_6 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s___buildLine); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12329 __Pyx_GOTREF(__pyx_t_6);
12330 __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12331 __Pyx_GOTREF(__pyx_t_1);
12332 __Pyx_INCREF(__pyx_v_fields);
12333 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_fields);
12334 __Pyx_GIVEREF(__pyx_v_fields);
12335 __Pyx_INCREF(__pyx_v_record);
12336 PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_record);
12337 __Pyx_GIVEREF(__pyx_v_record);
12338 __pyx_t_9 = PyObject_Call(__pyx_t_6, __pyx_t_1, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12339 __Pyx_GOTREF(__pyx_t_9);
12340 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12341 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12342 __pyx_t_7 = PyList_Append(((PyObject *)__pyx_v_lines), __pyx_t_9); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12343 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
12345 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12352 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12354 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1124
12355 * lines.append( self._buildLine( fields, record ) )
12357 * text = "\n".join(lines) + "\n" # <<<<<<<<<<<<<<
12358 * if dest.text != NULL: free( dest.text )
12359 * dest.text = <char*>calloc( len(text), sizeof(char))
12361 __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 = 1124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12362 __Pyx_GOTREF(__pyx_t_3);
12363 __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12364 __Pyx_GOTREF(__pyx_t_5);
12365 __Pyx_INCREF(((PyObject *)__pyx_v_lines));
12366 PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_lines));
12367 __Pyx_GIVEREF(((PyObject *)__pyx_v_lines));
12368 __pyx_t_9 = PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12369 __Pyx_GOTREF(__pyx_t_9);
12370 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12371 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12372 __pyx_t_5 = PyNumber_Add(__pyx_t_9, ((PyObject *)__pyx_kp_s_2)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12373 __Pyx_GOTREF(__pyx_t_5);
12374 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
12375 __Pyx_DECREF(__pyx_v_text);
12376 __pyx_v_text = __pyx_t_5;
12379 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1125
12381 * text = "\n".join(lines) + "\n"
12382 * if dest.text != NULL: free( dest.text ) # <<<<<<<<<<<<<<
12383 * dest.text = <char*>calloc( len(text), sizeof(char))
12384 * dest.l_text = len(text)
12386 __pyx_t_4 = (__pyx_v_dest->text != NULL);
12388 free(__pyx_v_dest->text);
12393 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1126
12394 * text = "\n".join(lines) + "\n"
12395 * if dest.text != NULL: free( dest.text )
12396 * dest.text = <char*>calloc( len(text), sizeof(char)) # <<<<<<<<<<<<<<
12397 * dest.l_text = len(text)
12398 * strncpy( dest.text, text, dest.l_text )
12400 __pyx_t_2 = PyObject_Length(__pyx_v_text); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12401 __pyx_v_dest->text = ((char *)calloc(__pyx_t_2, (sizeof(char))));
12403 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1127
12404 * if dest.text != NULL: free( dest.text )
12405 * dest.text = <char*>calloc( len(text), sizeof(char))
12406 * dest.l_text = len(text) # <<<<<<<<<<<<<<
12407 * strncpy( dest.text, text, dest.l_text )
12410 __pyx_t_2 = PyObject_Length(__pyx_v_text); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12411 __pyx_v_dest->l_text = __pyx_t_2;
12413 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1128
12414 * dest.text = <char*>calloc( len(text), sizeof(char))
12415 * dest.l_text = len(text)
12416 * strncpy( dest.text, text, dest.l_text ) # <<<<<<<<<<<<<<
12418 * # collect targets
12420 __pyx_t_10 = PyBytes_AsString(__pyx_v_text); if (unlikely((!__pyx_t_10) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12421 strncpy(__pyx_v_dest->text, __pyx_t_10, __pyx_v_dest->l_text);
12423 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1131
12425 * # collect targets
12426 * if "SQ" in new_header: # <<<<<<<<<<<<<<
12428 * for fields in new_header["SQ"]:
12430 __pyx_t_4 = ((PySequence_Contains(__pyx_v_new_header, ((PyObject *)__pyx_n_s__SQ)))); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12433 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1132
12434 * # collect targets
12435 * if "SQ" in new_header:
12436 * seqs = [] # <<<<<<<<<<<<<<
12437 * for fields in new_header["SQ"]:
12440 __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12441 __Pyx_GOTREF(((PyObject *)__pyx_t_5));
12442 __Pyx_DECREF(((PyObject *)__pyx_v_seqs));
12443 __pyx_v_seqs = __pyx_t_5;
12446 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1133
12447 * if "SQ" in new_header:
12449 * for fields in new_header["SQ"]: # <<<<<<<<<<<<<<
12451 * seqs.append( (fields["SN"], fields["LN"] ) )
12453 __pyx_t_5 = PyObject_GetItem(__pyx_v_new_header, ((PyObject *)__pyx_n_s__SQ)); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12454 __Pyx_GOTREF(__pyx_t_5);
12455 if (PyList_CheckExact(__pyx_t_5) || PyTuple_CheckExact(__pyx_t_5)) {
12456 __pyx_t_2 = 0; __pyx_t_9 = __pyx_t_5; __Pyx_INCREF(__pyx_t_9);
12458 __pyx_t_2 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12459 __Pyx_GOTREF(__pyx_t_9);
12461 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12463 if (likely(PyList_CheckExact(__pyx_t_9))) {
12464 if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_9)) break;
12465 __pyx_t_5 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_2); __Pyx_INCREF(__pyx_t_5); __pyx_t_2++;
12466 } else if (likely(PyTuple_CheckExact(__pyx_t_9))) {
12467 if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_9)) break;
12468 __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_2); __Pyx_INCREF(__pyx_t_5); __pyx_t_2++;
12470 __pyx_t_5 = PyIter_Next(__pyx_t_9);
12472 if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12475 __Pyx_GOTREF(__pyx_t_5);
12477 __Pyx_DECREF(__pyx_v_fields);
12478 __pyx_v_fields = __pyx_t_5;
12481 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1134
12483 * for fields in new_header["SQ"]:
12484 * try: # <<<<<<<<<<<<<<
12485 * seqs.append( (fields["SN"], fields["LN"] ) )
12489 PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb;
12490 __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb);
12491 __Pyx_XGOTREF(__pyx_save_exc_type);
12492 __Pyx_XGOTREF(__pyx_save_exc_value);
12493 __Pyx_XGOTREF(__pyx_save_exc_tb);
12496 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1135
12497 * for fields in new_header["SQ"]:
12499 * seqs.append( (fields["SN"], fields["LN"] ) ) # <<<<<<<<<<<<<<
12501 * raise KeyError( "incomplete sequence information in '%s'" % str(fields))
12503 if (unlikely(__pyx_v_seqs == Py_None)) {
12504 PyErr_SetString(PyExc_AttributeError, "'NoneType' object has no attribute 'append'"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1135; __pyx_clineno = __LINE__; goto __pyx_L14_error;}
12506 __pyx_t_5 = PyObject_GetItem(__pyx_v_fields, ((PyObject *)__pyx_n_s__SN)); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1135; __pyx_clineno = __LINE__; goto __pyx_L14_error;}
12507 __Pyx_GOTREF(__pyx_t_5);
12508 __pyx_t_3 = PyObject_GetItem(__pyx_v_fields, ((PyObject *)__pyx_n_s__LN)); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1135; __pyx_clineno = __LINE__; goto __pyx_L14_error;}
12509 __Pyx_GOTREF(__pyx_t_3);
12510 __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1135; __pyx_clineno = __LINE__; goto __pyx_L14_error;}
12511 __Pyx_GOTREF(__pyx_t_1);
12512 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5);
12513 __Pyx_GIVEREF(__pyx_t_5);
12514 PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3);
12515 __Pyx_GIVEREF(__pyx_t_3);
12518 __pyx_t_7 = PyList_Append(((PyObject *)__pyx_v_seqs), __pyx_t_1); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1135; __pyx_clineno = __LINE__; goto __pyx_L14_error;}
12519 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12521 __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
12522 __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0;
12523 __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0;
12524 goto __pyx_L21_try_end;
12526 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
12527 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12528 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
12529 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
12531 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1136
12533 * seqs.append( (fields["SN"], fields["LN"] ) )
12534 * except KeyError: # <<<<<<<<<<<<<<
12535 * raise KeyError( "incomplete sequence information in '%s'" % str(fields))
12538 __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_KeyError);
12540 __Pyx_AddTraceback("csamtools.Samfile._buildHeader");
12541 if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_3, &__pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1136; __pyx_clineno = __LINE__; goto __pyx_L16_except_error;}
12542 __Pyx_GOTREF(__pyx_t_1);
12543 __Pyx_GOTREF(__pyx_t_3);
12544 __Pyx_GOTREF(__pyx_t_5);
12546 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1137
12547 * seqs.append( (fields["SN"], fields["LN"] ) )
12549 * raise KeyError( "incomplete sequence information in '%s'" % str(fields)) # <<<<<<<<<<<<<<
12551 * dest.n_targets = len(seqs)
12553 __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L16_except_error;}
12554 __Pyx_GOTREF(__pyx_t_6);
12555 __Pyx_INCREF(__pyx_v_fields);
12556 PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_fields);
12557 __Pyx_GIVEREF(__pyx_v_fields);
12558 __pyx_t_11 = PyObject_Call(((PyObject *)((PyObject*)&PyString_Type)), __pyx_t_6, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L16_except_error;}
12559 __Pyx_GOTREF(__pyx_t_11);
12560 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12561 __pyx_t_6 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_53), __pyx_t_11); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L16_except_error;}
12562 __Pyx_GOTREF(((PyObject *)__pyx_t_6));
12563 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
12564 __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L16_except_error;}
12565 __Pyx_GOTREF(__pyx_t_11);
12566 PyTuple_SET_ITEM(__pyx_t_11, 0, ((PyObject *)__pyx_t_6));
12567 __Pyx_GIVEREF(((PyObject *)__pyx_t_6));
12569 __pyx_t_6 = PyObject_Call(__pyx_builtin_KeyError, __pyx_t_11, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L16_except_error;}
12570 __Pyx_GOTREF(__pyx_t_6);
12571 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
12572 __Pyx_Raise(__pyx_t_6, 0, 0);
12573 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12574 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L16_except_error;}
12575 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12576 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12577 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12578 goto __pyx_L15_exception_handled;
12580 __pyx_L16_except_error:;
12581 __Pyx_XGIVEREF(__pyx_save_exc_type);
12582 __Pyx_XGIVEREF(__pyx_save_exc_value);
12583 __Pyx_XGIVEREF(__pyx_save_exc_tb);
12584 __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
12585 goto __pyx_L1_error;
12586 __pyx_L15_exception_handled:;
12587 __Pyx_XGIVEREF(__pyx_save_exc_type);
12588 __Pyx_XGIVEREF(__pyx_save_exc_value);
12589 __Pyx_XGIVEREF(__pyx_save_exc_tb);
12590 __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
12591 __pyx_L21_try_end:;
12594 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
12596 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1139
12597 * raise KeyError( "incomplete sequence information in '%s'" % str(fields))
12599 * dest.n_targets = len(seqs) # <<<<<<<<<<<<<<
12600 * dest.target_name = <char**>calloc( dest.n_targets, sizeof(char*) )
12601 * dest.target_len = <uint32_t*>calloc( dest.n_targets, sizeof(uint32_t) )
12603 if (unlikely(__pyx_v_seqs == Py_None)) {
12604 PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12606 __pyx_t_2 = PyList_GET_SIZE(((PyObject *)__pyx_v_seqs));
12607 __pyx_v_dest->n_targets = __pyx_t_2;
12609 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1140
12611 * dest.n_targets = len(seqs)
12612 * dest.target_name = <char**>calloc( dest.n_targets, sizeof(char*) ) # <<<<<<<<<<<<<<
12613 * dest.target_len = <uint32_t*>calloc( dest.n_targets, sizeof(uint32_t) )
12616 __pyx_v_dest->target_name = ((char **)calloc(__pyx_v_dest->n_targets, (sizeof(char *))));
12618 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1141
12619 * dest.n_targets = len(seqs)
12620 * dest.target_name = <char**>calloc( dest.n_targets, sizeof(char*) )
12621 * dest.target_len = <uint32_t*>calloc( dest.n_targets, sizeof(uint32_t) ) # <<<<<<<<<<<<<<
12623 * for x from 0 <= x < dest.n_targets:
12625 __pyx_v_dest->target_len = ((uint32_t *)calloc(__pyx_v_dest->n_targets, (sizeof(uint32_t))));
12627 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1143
12628 * dest.target_len = <uint32_t*>calloc( dest.n_targets, sizeof(uint32_t) )
12630 * for x from 0 <= x < dest.n_targets: # <<<<<<<<<<<<<<
12631 * seqname, seqlen = seqs[x]
12632 * dest.target_name[x] = <char*>calloc( len( seqname ) + 1, sizeof(char) )
12634 __pyx_t_12 = __pyx_v_dest->n_targets;
12635 for (__pyx_v_x = 0; __pyx_v_x < __pyx_t_12; __pyx_v_x++) {
12637 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1144
12639 * for x from 0 <= x < dest.n_targets:
12640 * seqname, seqlen = seqs[x] # <<<<<<<<<<<<<<
12641 * dest.target_name[x] = <char*>calloc( len( seqname ) + 1, sizeof(char) )
12642 * strncpy( dest.target_name[x], seqname, len(seqname) + 1 )
12644 __pyx_t_9 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_seqs), __pyx_v_x, sizeof(long), PyInt_FromLong); if (!__pyx_t_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12645 __Pyx_GOTREF(__pyx_t_9);
12646 if (PyTuple_CheckExact(__pyx_t_9) && likely(PyTuple_GET_SIZE(__pyx_t_9) == 2)) {
12647 PyObject* tuple = __pyx_t_9;
12648 __pyx_t_5 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_5);
12649 __pyx_t_3 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_3);
12650 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
12651 __Pyx_DECREF(__pyx_v_seqname);
12652 __pyx_v_seqname = __pyx_t_5;
12654 __Pyx_DECREF(__pyx_v_seqlen);
12655 __pyx_v_seqlen = __pyx_t_3;
12658 __pyx_t_1 = PyObject_GetIter(__pyx_t_9); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12659 __Pyx_GOTREF(__pyx_t_1);
12660 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
12661 __pyx_t_5 = __Pyx_UnpackItem(__pyx_t_1, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12662 __Pyx_GOTREF(__pyx_t_5);
12663 __pyx_t_3 = __Pyx_UnpackItem(__pyx_t_1, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12664 __Pyx_GOTREF(__pyx_t_3);
12665 if (__Pyx_EndUnpack(__pyx_t_1, 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12666 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12667 __Pyx_DECREF(__pyx_v_seqname);
12668 __pyx_v_seqname = __pyx_t_5;
12670 __Pyx_DECREF(__pyx_v_seqlen);
12671 __pyx_v_seqlen = __pyx_t_3;
12675 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1145
12676 * for x from 0 <= x < dest.n_targets:
12677 * seqname, seqlen = seqs[x]
12678 * dest.target_name[x] = <char*>calloc( len( seqname ) + 1, sizeof(char) ) # <<<<<<<<<<<<<<
12679 * strncpy( dest.target_name[x], seqname, len(seqname) + 1 )
12680 * dest.target_len[x] = seqlen
12682 __pyx_t_2 = PyObject_Length(__pyx_v_seqname); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12683 (__pyx_v_dest->target_name[__pyx_v_x]) = ((char *)calloc((__pyx_t_2 + 1), (sizeof(char))));
12685 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1146
12686 * seqname, seqlen = seqs[x]
12687 * dest.target_name[x] = <char*>calloc( len( seqname ) + 1, sizeof(char) )
12688 * strncpy( dest.target_name[x], seqname, len(seqname) + 1 ) # <<<<<<<<<<<<<<
12689 * dest.target_len[x] = seqlen
12692 __pyx_t_10 = PyBytes_AsString(__pyx_v_seqname); if (unlikely((!__pyx_t_10) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12693 __pyx_t_2 = PyObject_Length(__pyx_v_seqname); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12694 strncpy((__pyx_v_dest->target_name[__pyx_v_x]), __pyx_t_10, (__pyx_t_2 + 1));
12696 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1147
12697 * dest.target_name[x] = <char*>calloc( len( seqname ) + 1, sizeof(char) )
12698 * strncpy( dest.target_name[x], seqname, len(seqname) + 1 )
12699 * dest.target_len[x] = seqlen # <<<<<<<<<<<<<<
12703 __pyx_t_13 = __Pyx_PyInt_from_py_uint32_t(__pyx_v_seqlen); if (unlikely((__pyx_t_13 == (uint32_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12704 (__pyx_v_dest->target_len[__pyx_v_x]) = __pyx_t_13;
12710 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1149
12711 * dest.target_len[x] = seqlen
12713 * return dest # <<<<<<<<<<<<<<
12715 * ###############################################################
12717 __pyx_r = __pyx_v_dest;
12723 __Pyx_XDECREF(__pyx_t_1);
12724 __Pyx_XDECREF(__pyx_t_3);
12725 __Pyx_XDECREF(__pyx_t_5);
12726 __Pyx_XDECREF(__pyx_t_6);
12727 __Pyx_XDECREF(__pyx_t_9);
12728 __Pyx_XDECREF(__pyx_t_11);
12729 __Pyx_WriteUnraisable("csamtools.Samfile._buildHeader");
12732 __Pyx_DECREF(__pyx_v_lines);
12733 __Pyx_DECREF(__pyx_v_record);
12734 __Pyx_DECREF(__pyx_v_ttype);
12735 __Pyx_DECREF(__pyx_v_data);
12736 __Pyx_DECREF(__pyx_v_fields);
12737 __Pyx_DECREF(__pyx_v_text);
12738 __Pyx_DECREF(__pyx_v_seqs);
12739 __Pyx_DECREF(__pyx_v_seqname);
12740 __Pyx_DECREF(__pyx_v_seqlen);
12741 __Pyx_TraceReturn(Py_None);
12742 __Pyx_RefNannyFinishContext();
12746 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1159
12747 * ## Possible solutions: deprecate or open new file handle
12748 * ###############################################################
12749 * def __iter__(self): # <<<<<<<<<<<<<<
12750 * if not self._isOpen(): raise ValueError( "I/O operation on closed file" )
12754 static PyObject *__pyx_pf_9csamtools_7Samfile___iter__(PyObject *__pyx_v_self); /*proto*/
12755 static PyObject *__pyx_pf_9csamtools_7Samfile___iter__(PyObject *__pyx_v_self) {
12756 PyObject *__pyx_r = NULL;
12757 PyObject *__pyx_t_1 = NULL;
12758 PyObject *__pyx_t_2 = NULL;
12761 __Pyx_TraceDeclarations
12762 __Pyx_RefNannySetupContext("__iter__");
12763 __Pyx_TraceCall("__iter__", __pyx_f[0], 1159);
12765 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1160
12766 * ###############################################################
12767 * def __iter__(self):
12768 * if not self._isOpen(): raise ValueError( "I/O operation on closed file" ) # <<<<<<<<<<<<<<
12772 __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___isOpen); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12773 __Pyx_GOTREF(__pyx_t_1);
12774 __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 = 1160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12775 __Pyx_GOTREF(__pyx_t_2);
12776 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12777 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12778 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12779 __pyx_t_4 = (!__pyx_t_3);
12781 __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12782 __Pyx_GOTREF(__pyx_t_2);
12783 __Pyx_INCREF(((PyObject *)__pyx_kp_s_5));
12784 PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_5));
12785 __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_5));
12786 __pyx_t_1 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12787 __Pyx_GOTREF(__pyx_t_1);
12788 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12789 __Pyx_Raise(__pyx_t_1, 0, 0);
12790 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12791 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12796 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1161
12797 * def __iter__(self):
12798 * if not self._isOpen(): raise ValueError( "I/O operation on closed file" )
12799 * return self # <<<<<<<<<<<<<<
12801 * cdef bam1_t * getCurrent( self ):
12803 __Pyx_XDECREF(__pyx_r);
12804 __Pyx_INCREF(__pyx_v_self);
12805 __pyx_r = __pyx_v_self;
12808 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12811 __Pyx_XDECREF(__pyx_t_1);
12812 __Pyx_XDECREF(__pyx_t_2);
12813 __Pyx_AddTraceback("csamtools.Samfile.__iter__");
12816 __Pyx_XGIVEREF(__pyx_r);
12817 __Pyx_TraceReturn(__pyx_r);
12818 __Pyx_RefNannyFinishContext();
12822 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1163
12825 * cdef bam1_t * getCurrent( self ): # <<<<<<<<<<<<<<
12830 static bam1_t *__pyx_f_9csamtools_7Samfile_getCurrent(struct __pyx_obj_9csamtools_Samfile *__pyx_v_self) {
12832 __Pyx_TraceDeclarations
12833 __Pyx_RefNannySetupContext("getCurrent");
12834 __Pyx_TraceCall("getCurrent", __pyx_f[0], 1163);
12836 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1164
12838 * cdef bam1_t * getCurrent( self ):
12839 * return self.b # <<<<<<<<<<<<<<
12841 * cdef int cnext(self):
12843 __pyx_r = __pyx_v_self->b;
12848 __Pyx_TraceReturn(Py_None);
12849 __Pyx_RefNannyFinishContext();
12853 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1166
12856 * cdef int cnext(self): # <<<<<<<<<<<<<<
12858 * cversion of iterator. Used by :class:`pysam.Samfile.IteratorColumn`.
12861 static int __pyx_f_9csamtools_7Samfile_cnext(struct __pyx_obj_9csamtools_Samfile *__pyx_v_self) {
12863 __Pyx_TraceDeclarations
12864 __Pyx_RefNannySetupContext("cnext");
12865 __Pyx_TraceCall("cnext", __pyx_f[0], 1166);
12867 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1171
12870 * return samread(self.samfile, self.b) # <<<<<<<<<<<<<<
12872 * def __next__(self):
12874 __pyx_r = samread(__pyx_v_self->samfile, __pyx_v_self->b);
12879 __Pyx_TraceReturn(Py_None);
12880 __Pyx_RefNannyFinishContext();
12884 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1173
12885 * return samread(self.samfile, self.b)
12887 * def __next__(self): # <<<<<<<<<<<<<<
12889 * python version of next().
12892 static PyObject *__pyx_pf_9csamtools_7Samfile___next__(PyObject *__pyx_v_self); /*proto*/
12893 static char __pyx_doc_9csamtools_7Samfile___next__[] = "\n python version of next().\n ";
12894 struct wrapperbase __pyx_wrapperbase_9csamtools_7Samfile___next__;
12895 static PyObject *__pyx_pf_9csamtools_7Samfile___next__(PyObject *__pyx_v_self) {
12897 PyObject *__pyx_r = NULL;
12899 PyObject *__pyx_t_2 = NULL;
12900 __Pyx_TraceDeclarations
12901 __Pyx_RefNannySetupContext("__next__");
12902 __Pyx_TraceCall("__next__", __pyx_f[0], 1173);
12904 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1178
12907 * ret = samread(self.samfile, self.b) # <<<<<<<<<<<<<<
12909 * return makeAlignedRead( self.b )
12911 __pyx_v_ret = samread(((struct __pyx_obj_9csamtools_Samfile *)__pyx_v_self)->samfile, ((struct __pyx_obj_9csamtools_Samfile *)__pyx_v_self)->b);
12913 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1179
12915 * ret = samread(self.samfile, self.b)
12916 * if (ret > 0): # <<<<<<<<<<<<<<
12917 * return makeAlignedRead( self.b )
12920 __pyx_t_1 = (__pyx_v_ret > 0);
12923 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1180
12924 * ret = samread(self.samfile, self.b)
12926 * return makeAlignedRead( self.b ) # <<<<<<<<<<<<<<
12928 * raise StopIteration
12930 __Pyx_XDECREF(__pyx_r);
12931 __pyx_t_2 = __pyx_f_9csamtools_makeAlignedRead(((struct __pyx_obj_9csamtools_Samfile *)__pyx_v_self)->b); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12932 __Pyx_GOTREF(__pyx_t_2);
12933 __pyx_r = __pyx_t_2;
12940 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1182
12941 * return makeAlignedRead( self.b )
12943 * raise StopIteration # <<<<<<<<<<<<<<
12945 * ##-------------------------------------------------------------------
12947 __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0);
12948 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12952 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12955 __Pyx_XDECREF(__pyx_t_2);
12956 __Pyx_AddTraceback("csamtools.Samfile.__next__");
12959 __Pyx_XGIVEREF(__pyx_r);
12960 __Pyx_TraceReturn(__pyx_r);
12961 __Pyx_RefNannyFinishContext();
12965 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1234
12966 * cdef int owns_samfile
12968 * def __cinit__(self, Samfile samfile, int tid, int beg, int end, int reopen = True ): # <<<<<<<<<<<<<<
12970 * if not samfile._isOpen():
12973 static int __pyx_pf_9csamtools_17IteratorRowRegion___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
12974 static int __pyx_pf_9csamtools_17IteratorRowRegion___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
12975 struct __pyx_obj_9csamtools_Samfile *__pyx_v_samfile = 0;
12979 int __pyx_v_reopen;
12980 PyObject *__pyx_v_mode;
12981 PyObject *__pyx_v_store;
12983 PyObject *__pyx_t_1 = NULL;
12984 PyObject *__pyx_t_2 = NULL;
12988 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__samfile,&__pyx_n_s__tid,&__pyx_n_s__beg,&__pyx_n_s__end,&__pyx_n_s__reopen,0};
12989 __Pyx_TraceDeclarations
12990 __Pyx_RefNannySetupContext("__cinit__");
12991 __Pyx_TraceCall("__cinit__", __pyx_f[0], 1234);
12992 if (unlikely(__pyx_kwds)) {
12993 Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
12994 PyObject* values[5] = {0,0,0,0,0};
12995 switch (PyTuple_GET_SIZE(__pyx_args)) {
12996 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
12997 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
12998 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
12999 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
13000 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
13002 default: goto __pyx_L5_argtuple_error;
13004 switch (PyTuple_GET_SIZE(__pyx_args)) {
13006 values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__samfile);
13007 if (likely(values[0])) kw_args--;
13008 else goto __pyx_L5_argtuple_error;
13010 values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__tid);
13011 if (likely(values[1])) kw_args--;
13013 __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 4, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1234; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
13016 values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__beg);
13017 if (likely(values[2])) kw_args--;
13019 __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 4, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1234; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
13022 values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__end);
13023 if (likely(values[3])) kw_args--;
13025 __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 4, 5, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1234; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
13029 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__reopen);
13030 if (value) { values[4] = value; kw_args--; }
13033 if (unlikely(kw_args > 0)) {
13034 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1234; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
13036 __pyx_v_samfile = ((struct __pyx_obj_9csamtools_Samfile *)values[0]);
13037 __pyx_v_tid = __Pyx_PyInt_AsInt(values[1]); if (unlikely((__pyx_v_tid == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1234; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
13038 __pyx_v_beg = __Pyx_PyInt_AsInt(values[2]); if (unlikely((__pyx_v_beg == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1234; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
13039 __pyx_v_end = __Pyx_PyInt_AsInt(values[3]); if (unlikely((__pyx_v_end == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1234; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
13041 __pyx_v_reopen = __Pyx_PyInt_AsInt(values[4]); if (unlikely((__pyx_v_reopen == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1234; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
13043 __pyx_v_reopen = ((int)1);
13046 __pyx_v_reopen = ((int)1);
13047 switch (PyTuple_GET_SIZE(__pyx_args)) {
13049 __pyx_v_reopen = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 4)); if (unlikely((__pyx_v_reopen == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1234; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
13051 __pyx_v_end = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 3)); if (unlikely((__pyx_v_end == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1234; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
13052 __pyx_v_beg = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 2)); if (unlikely((__pyx_v_beg == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1234; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
13053 __pyx_v_tid = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely((__pyx_v_tid == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1234; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
13054 __pyx_v_samfile = ((struct __pyx_obj_9csamtools_Samfile *)PyTuple_GET_ITEM(__pyx_args, 0));
13056 default: goto __pyx_L5_argtuple_error;
13059 goto __pyx_L4_argument_unpacking_done;
13060 __pyx_L5_argtuple_error:;
13061 __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 4, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1234; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
13063 __Pyx_AddTraceback("csamtools.IteratorRowRegion.__cinit__");
13064 __Pyx_RefNannyFinishContext();
13066 __pyx_L4_argument_unpacking_done:;
13067 __pyx_v_mode = Py_None; __Pyx_INCREF(Py_None);
13068 __pyx_v_store = Py_None; __Pyx_INCREF(Py_None);
13069 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_samfile), __pyx_ptype_9csamtools_Samfile, 1, "samfile", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13071 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1236
13072 * def __cinit__(self, Samfile samfile, int tid, int beg, int end, int reopen = True ):
13074 * if not samfile._isOpen(): # <<<<<<<<<<<<<<
13075 * raise ValueError( "I/O operation on closed file" )
13078 __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_samfile), __pyx_n_s___isOpen); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13079 __Pyx_GOTREF(__pyx_t_1);
13080 __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 = 1236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13081 __Pyx_GOTREF(__pyx_t_2);
13082 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13083 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13084 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13085 __pyx_t_4 = (!__pyx_t_3);
13088 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1237
13090 * if not samfile._isOpen():
13091 * raise ValueError( "I/O operation on closed file" ) # <<<<<<<<<<<<<<
13093 * if not samfile._hasIndex():
13095 __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13096 __Pyx_GOTREF(__pyx_t_2);
13097 __Pyx_INCREF(((PyObject *)__pyx_kp_s_5));
13098 PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_5));
13099 __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_5));
13100 __pyx_t_1 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13101 __Pyx_GOTREF(__pyx_t_1);
13102 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13103 __Pyx_Raise(__pyx_t_1, 0, 0);
13104 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13105 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13110 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1239
13111 * raise ValueError( "I/O operation on closed file" )
13113 * if not samfile._hasIndex(): # <<<<<<<<<<<<<<
13114 * raise ValueError( "no index available for iteration" )
13117 __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_samfile), __pyx_n_s___hasIndex); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13118 __Pyx_GOTREF(__pyx_t_1);
13119 __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 = 1239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13120 __Pyx_GOTREF(__pyx_t_2);
13121 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13122 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13123 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13124 __pyx_t_3 = (!__pyx_t_4);
13127 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1240
13129 * if not samfile._hasIndex():
13130 * raise ValueError( "no index available for iteration" ) # <<<<<<<<<<<<<<
13132 * # makes sure that samfile stays alive as long as the
13134 __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1240; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13135 __Pyx_GOTREF(__pyx_t_2);
13136 __Pyx_INCREF(((PyObject *)__pyx_kp_s_54));
13137 PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_54));
13138 __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_54));
13139 __pyx_t_1 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1240; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13140 __Pyx_GOTREF(__pyx_t_1);
13141 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13142 __Pyx_Raise(__pyx_t_1, 0, 0);
13143 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13144 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1240; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13149 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1244
13150 * # makes sure that samfile stays alive as long as the
13151 * # iterator is alive
13152 * self.samfile = samfile # <<<<<<<<<<<<<<
13154 * if samfile.isbam: mode = "rb"
13156 __Pyx_INCREF(((PyObject *)__pyx_v_samfile));
13157 __Pyx_GIVEREF(((PyObject *)__pyx_v_samfile));
13158 __Pyx_GOTREF(((struct __pyx_obj_9csamtools_IteratorRowRegion *)__pyx_v_self)->samfile);
13159 __Pyx_DECREF(((PyObject *)((struct __pyx_obj_9csamtools_IteratorRowRegion *)__pyx_v_self)->samfile));
13160 ((struct __pyx_obj_9csamtools_IteratorRowRegion *)__pyx_v_self)->samfile = __pyx_v_samfile;
13162 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1246
13163 * self.samfile = samfile
13165 * if samfile.isbam: mode = "rb" # <<<<<<<<<<<<<<
13169 if (__pyx_v_samfile->isbam) {
13170 __Pyx_INCREF(((PyObject *)__pyx_n_s__rb));
13171 __Pyx_DECREF(__pyx_v_mode);
13172 __pyx_v_mode = ((PyObject *)__pyx_n_s__rb);
13177 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1247
13179 * if samfile.isbam: mode = "rb"
13180 * else: mode = "r" # <<<<<<<<<<<<<<
13182 * # reopen the file - note that this makes the iterator
13184 __Pyx_INCREF(((PyObject *)__pyx_n_s__r));
13185 __Pyx_DECREF(__pyx_v_mode);
13186 __pyx_v_mode = ((PyObject *)__pyx_n_s__r);
13190 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1251
13191 * # reopen the file - note that this makes the iterator
13192 * # slow and causes pileup to slow down significantly.
13193 * if reopen: # <<<<<<<<<<<<<<
13194 * store = StderrStore()
13195 * self.fp = samopen( samfile._filename, mode, NULL )
13197 if (__pyx_v_reopen) {
13199 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1252
13200 * # slow and causes pileup to slow down significantly.
13202 * store = StderrStore() # <<<<<<<<<<<<<<
13203 * self.fp = samopen( samfile._filename, mode, NULL )
13206 __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__StderrStore); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13207 __Pyx_GOTREF(__pyx_t_1);
13208 __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 = 1252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13209 __Pyx_GOTREF(__pyx_t_2);
13210 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13211 __Pyx_DECREF(__pyx_v_store);
13212 __pyx_v_store = __pyx_t_2;
13215 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1253
13217 * store = StderrStore()
13218 * self.fp = samopen( samfile._filename, mode, NULL ) # <<<<<<<<<<<<<<
13220 * assert self.fp != NULL
13222 __pyx_t_5 = PyBytes_AsString(__pyx_v_mode); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13223 ((struct __pyx_obj_9csamtools_IteratorRowRegion *)__pyx_v_self)->fp = samopen(__pyx_v_samfile->_filename, __pyx_t_5, NULL);
13225 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1254
13226 * store = StderrStore()
13227 * self.fp = samopen( samfile._filename, mode, NULL )
13228 * store.release() # <<<<<<<<<<<<<<
13229 * assert self.fp != NULL
13230 * self.owns_samfile = True
13232 __pyx_t_2 = PyObject_GetAttr(__pyx_v_store, __pyx_n_s__release); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13233 __Pyx_GOTREF(__pyx_t_2);
13234 __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 = 1254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13235 __Pyx_GOTREF(__pyx_t_1);
13236 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13237 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13239 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1255
13240 * self.fp = samopen( samfile._filename, mode, NULL )
13242 * assert self.fp != NULL # <<<<<<<<<<<<<<
13243 * self.owns_samfile = True
13246 #ifndef PYREX_WITHOUT_ASSERTIONS
13247 if (unlikely(!(((struct __pyx_obj_9csamtools_IteratorRowRegion *)__pyx_v_self)->fp != NULL))) {
13248 PyErr_SetNone(PyExc_AssertionError);
13249 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13253 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1256
13255 * assert self.fp != NULL
13256 * self.owns_samfile = True # <<<<<<<<<<<<<<
13258 * self.fp = self.samfile.samfile
13260 ((struct __pyx_obj_9csamtools_IteratorRowRegion *)__pyx_v_self)->owns_samfile = 1;
13265 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1258
13266 * self.owns_samfile = True
13268 * self.fp = self.samfile.samfile # <<<<<<<<<<<<<<
13269 * self.owns_samfile = False
13272 ((struct __pyx_obj_9csamtools_IteratorRowRegion *)__pyx_v_self)->fp = ((struct __pyx_obj_9csamtools_IteratorRowRegion *)__pyx_v_self)->samfile->samfile;
13274 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1259
13276 * self.fp = self.samfile.samfile
13277 * self.owns_samfile = False # <<<<<<<<<<<<<<
13281 ((struct __pyx_obj_9csamtools_IteratorRowRegion *)__pyx_v_self)->owns_samfile = 0;
13285 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1261
13286 * self.owns_samfile = False
13288 * self.retval = 0 # <<<<<<<<<<<<<<
13290 * self.iter = bam_iter_query(self.samfile.index,
13292 ((struct __pyx_obj_9csamtools_IteratorRowRegion *)__pyx_v_self)->retval = 0;
13294 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1263
13297 * self.iter = bam_iter_query(self.samfile.index, # <<<<<<<<<<<<<<
13301 ((struct __pyx_obj_9csamtools_IteratorRowRegion *)__pyx_v_self)->iter = bam_iter_query(((struct __pyx_obj_9csamtools_IteratorRowRegion *)__pyx_v_self)->samfile->index, __pyx_v_tid, __pyx_v_beg, __pyx_v_end);
13303 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1267
13306 * self.b = bam_init1() # <<<<<<<<<<<<<<
13308 * def __iter__(self):
13310 ((struct __pyx_obj_9csamtools_IteratorRowRegion *)__pyx_v_self)->b = bam_init1();
13315 __Pyx_XDECREF(__pyx_t_1);
13316 __Pyx_XDECREF(__pyx_t_2);
13317 __Pyx_AddTraceback("csamtools.IteratorRowRegion.__cinit__");
13320 __Pyx_DECREF(__pyx_v_mode);
13321 __Pyx_DECREF(__pyx_v_store);
13322 __Pyx_TraceReturn(Py_None);
13323 __Pyx_RefNannyFinishContext();
13327 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1269
13328 * self.b = bam_init1()
13330 * def __iter__(self): # <<<<<<<<<<<<<<
13335 static PyObject *__pyx_pf_9csamtools_17IteratorRowRegion___iter__(PyObject *__pyx_v_self); /*proto*/
13336 static PyObject *__pyx_pf_9csamtools_17IteratorRowRegion___iter__(PyObject *__pyx_v_self) {
13337 PyObject *__pyx_r = NULL;
13338 __Pyx_TraceDeclarations
13339 __Pyx_RefNannySetupContext("__iter__");
13340 __Pyx_TraceCall("__iter__", __pyx_f[0], 1269);
13342 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1270
13344 * def __iter__(self):
13345 * return self # <<<<<<<<<<<<<<
13347 * cdef bam1_t * getCurrent( self ):
13349 __Pyx_XDECREF(__pyx_r);
13350 __Pyx_INCREF(__pyx_v_self);
13351 __pyx_r = __pyx_v_self;
13354 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
13356 __Pyx_XGIVEREF(__pyx_r);
13357 __Pyx_TraceReturn(__pyx_r);
13358 __Pyx_RefNannyFinishContext();
13362 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1272
13365 * cdef bam1_t * getCurrent( self ): # <<<<<<<<<<<<<<
13370 static bam1_t *__pyx_f_9csamtools_17IteratorRowRegion_getCurrent(struct __pyx_obj_9csamtools_IteratorRowRegion *__pyx_v_self) {
13372 __Pyx_TraceDeclarations
13373 __Pyx_RefNannySetupContext("getCurrent");
13374 __Pyx_TraceCall("getCurrent", __pyx_f[0], 1272);
13376 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1273
13378 * cdef bam1_t * getCurrent( self ):
13379 * return self.b # <<<<<<<<<<<<<<
13381 * cdef int cnext(self):
13383 __pyx_r = __pyx_v_self->b;
13388 __Pyx_TraceReturn(Py_None);
13389 __Pyx_RefNannyFinishContext();
13393 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1275
13396 * cdef int cnext(self): # <<<<<<<<<<<<<<
13397 * '''cversion of iterator. Used by IteratorColumn'''
13398 * self.retval = bam_iter_read( self.fp.x.bam,
13401 static int __pyx_f_9csamtools_17IteratorRowRegion_cnext(struct __pyx_obj_9csamtools_IteratorRowRegion *__pyx_v_self) {
13403 __Pyx_TraceDeclarations
13404 __Pyx_RefNannySetupContext("cnext");
13405 __Pyx_TraceCall("cnext", __pyx_f[0], 1275);
13407 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1277
13408 * cdef int cnext(self):
13409 * '''cversion of iterator. Used by IteratorColumn'''
13410 * self.retval = bam_iter_read( self.fp.x.bam, # <<<<<<<<<<<<<<
13414 __pyx_v_self->retval = bam_iter_read(__pyx_v_self->fp->x.bam, __pyx_v_self->iter, __pyx_v_self->b);
13417 __Pyx_TraceReturn(Py_None);
13418 __Pyx_RefNannyFinishContext();
13422 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1281
13425 * def __next__(self): # <<<<<<<<<<<<<<
13426 * """python version of next().
13430 static PyObject *__pyx_pf_9csamtools_17IteratorRowRegion___next__(PyObject *__pyx_v_self); /*proto*/
13431 static char __pyx_doc_9csamtools_17IteratorRowRegion___next__[] = "python version of next().\n ";
13432 struct wrapperbase __pyx_wrapperbase_9csamtools_17IteratorRowRegion___next__;
13433 static PyObject *__pyx_pf_9csamtools_17IteratorRowRegion___next__(PyObject *__pyx_v_self) {
13434 PyObject *__pyx_r = NULL;
13436 PyObject *__pyx_t_2 = NULL;
13437 __Pyx_TraceDeclarations
13438 __Pyx_RefNannySetupContext("__next__");
13439 __Pyx_TraceCall("__next__", __pyx_f[0], 1281);
13441 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1284
13442 * """python version of next().
13444 * self.cnext() # <<<<<<<<<<<<<<
13445 * if self.retval < 0: raise StopIteration
13446 * return makeAlignedRead( self.b )
13448 ((struct __pyx_vtabstruct_9csamtools_IteratorRowRegion *)((struct __pyx_obj_9csamtools_IteratorRowRegion *)__pyx_v_self)->__pyx_vtab)->cnext(((struct __pyx_obj_9csamtools_IteratorRowRegion *)__pyx_v_self));
13450 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1285
13453 * if self.retval < 0: raise StopIteration # <<<<<<<<<<<<<<
13454 * return makeAlignedRead( self.b )
13457 __pyx_t_1 = (((struct __pyx_obj_9csamtools_IteratorRowRegion *)__pyx_v_self)->retval < 0);
13459 __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0);
13460 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1285; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13465 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1286
13467 * if self.retval < 0: raise StopIteration
13468 * return makeAlignedRead( self.b ) # <<<<<<<<<<<<<<
13470 * def __dealloc__(self):
13472 __Pyx_XDECREF(__pyx_r);
13473 __pyx_t_2 = __pyx_f_9csamtools_makeAlignedRead(((struct __pyx_obj_9csamtools_IteratorRowRegion *)__pyx_v_self)->b); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1286; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13474 __Pyx_GOTREF(__pyx_t_2);
13475 __pyx_r = __pyx_t_2;
13479 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
13482 __Pyx_XDECREF(__pyx_t_2);
13483 __Pyx_AddTraceback("csamtools.IteratorRowRegion.__next__");
13486 __Pyx_XGIVEREF(__pyx_r);
13487 __Pyx_TraceReturn(__pyx_r);
13488 __Pyx_RefNannyFinishContext();
13492 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1288
13493 * return makeAlignedRead( self.b )
13495 * def __dealloc__(self): # <<<<<<<<<<<<<<
13496 * bam_destroy1(self.b)
13497 * if self.owns_samfile: samclose( self.fp )
13500 static void __pyx_pf_9csamtools_17IteratorRowRegion___dealloc__(PyObject *__pyx_v_self); /*proto*/
13501 static void __pyx_pf_9csamtools_17IteratorRowRegion___dealloc__(PyObject *__pyx_v_self) {
13502 __Pyx_TraceDeclarations
13503 __Pyx_RefNannySetupContext("__dealloc__");
13504 __Pyx_TraceCall("__dealloc__", __pyx_f[0], 1288);
13506 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1289
13508 * def __dealloc__(self):
13509 * bam_destroy1(self.b) # <<<<<<<<<<<<<<
13510 * if self.owns_samfile: samclose( self.fp )
13513 bam_destroy1(((struct __pyx_obj_9csamtools_IteratorRowRegion *)__pyx_v_self)->b);
13515 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1290
13516 * def __dealloc__(self):
13517 * bam_destroy1(self.b)
13518 * if self.owns_samfile: samclose( self.fp ) # <<<<<<<<<<<<<<
13520 * cdef class IteratorRowAll(IteratorRow):
13522 if (((struct __pyx_obj_9csamtools_IteratorRowRegion *)__pyx_v_self)->owns_samfile) {
13523 samclose(((struct __pyx_obj_9csamtools_IteratorRowRegion *)__pyx_v_self)->fp);
13528 __Pyx_TraceReturn(Py_None);
13529 __Pyx_RefNannyFinishContext();
13532 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1307
13533 * cdef int owns_samfile
13535 * def __cinit__(self, Samfile samfile, int reopen = True ): # <<<<<<<<<<<<<<
13537 * if not samfile._isOpen():
13540 static int __pyx_pf_9csamtools_14IteratorRowAll___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
13541 static int __pyx_pf_9csamtools_14IteratorRowAll___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
13542 struct __pyx_obj_9csamtools_Samfile *__pyx_v_samfile = 0;
13543 int __pyx_v_reopen;
13544 PyObject *__pyx_v_mode;
13545 PyObject *__pyx_v_store;
13547 PyObject *__pyx_t_1 = NULL;
13548 PyObject *__pyx_t_2 = NULL;
13552 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__samfile,&__pyx_n_s__reopen,0};
13553 __Pyx_TraceDeclarations
13554 __Pyx_RefNannySetupContext("__cinit__");
13555 __Pyx_TraceCall("__cinit__", __pyx_f[0], 1307);
13556 if (unlikely(__pyx_kwds)) {
13557 Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
13558 PyObject* values[2] = {0,0};
13559 switch (PyTuple_GET_SIZE(__pyx_args)) {
13560 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
13561 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
13563 default: goto __pyx_L5_argtuple_error;
13565 switch (PyTuple_GET_SIZE(__pyx_args)) {
13567 values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__samfile);
13568 if (likely(values[0])) kw_args--;
13569 else goto __pyx_L5_argtuple_error;
13572 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__reopen);
13573 if (value) { values[1] = value; kw_args--; }
13576 if (unlikely(kw_args > 0)) {
13577 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1307; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
13579 __pyx_v_samfile = ((struct __pyx_obj_9csamtools_Samfile *)values[0]);
13581 __pyx_v_reopen = __Pyx_PyInt_AsInt(values[1]); if (unlikely((__pyx_v_reopen == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1307; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
13583 __pyx_v_reopen = ((int)1);
13586 __pyx_v_reopen = ((int)1);
13587 switch (PyTuple_GET_SIZE(__pyx_args)) {
13588 case 2: __pyx_v_reopen = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely((__pyx_v_reopen == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1307; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
13589 case 1: __pyx_v_samfile = ((struct __pyx_obj_9csamtools_Samfile *)PyTuple_GET_ITEM(__pyx_args, 0));
13591 default: goto __pyx_L5_argtuple_error;
13594 goto __pyx_L4_argument_unpacking_done;
13595 __pyx_L5_argtuple_error:;
13596 __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1307; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
13598 __Pyx_AddTraceback("csamtools.IteratorRowAll.__cinit__");
13599 __Pyx_RefNannyFinishContext();
13601 __pyx_L4_argument_unpacking_done:;
13602 __pyx_v_mode = Py_None; __Pyx_INCREF(Py_None);
13603 __pyx_v_store = Py_None; __Pyx_INCREF(Py_None);
13604 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_samfile), __pyx_ptype_9csamtools_Samfile, 1, "samfile", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1307; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13606 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1309
13607 * def __cinit__(self, Samfile samfile, int reopen = True ):
13609 * if not samfile._isOpen(): # <<<<<<<<<<<<<<
13610 * raise ValueError( "I/O operation on closed file" )
13613 __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_samfile), __pyx_n_s___isOpen); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1309; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13614 __Pyx_GOTREF(__pyx_t_1);
13615 __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 = 1309; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13616 __Pyx_GOTREF(__pyx_t_2);
13617 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13618 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1309; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13619 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13620 __pyx_t_4 = (!__pyx_t_3);
13623 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1310
13625 * if not samfile._isOpen():
13626 * raise ValueError( "I/O operation on closed file" ) # <<<<<<<<<<<<<<
13628 * if samfile.isbam: mode = "rb"
13630 __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13631 __Pyx_GOTREF(__pyx_t_2);
13632 __Pyx_INCREF(((PyObject *)__pyx_kp_s_5));
13633 PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_5));
13634 __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_5));
13635 __pyx_t_1 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13636 __Pyx_GOTREF(__pyx_t_1);
13637 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13638 __Pyx_Raise(__pyx_t_1, 0, 0);
13639 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13640 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13645 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1312
13646 * raise ValueError( "I/O operation on closed file" )
13648 * if samfile.isbam: mode = "rb" # <<<<<<<<<<<<<<
13652 if (__pyx_v_samfile->isbam) {
13653 __Pyx_INCREF(((PyObject *)__pyx_n_s__rb));
13654 __Pyx_DECREF(__pyx_v_mode);
13655 __pyx_v_mode = ((PyObject *)__pyx_n_s__rb);
13660 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1313
13662 * if samfile.isbam: mode = "rb"
13663 * else: mode = "r" # <<<<<<<<<<<<<<
13665 * # reopen the file to avoid iterator conflict
13667 __Pyx_INCREF(((PyObject *)__pyx_n_s__r));
13668 __Pyx_DECREF(__pyx_v_mode);
13669 __pyx_v_mode = ((PyObject *)__pyx_n_s__r);
13673 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1316
13675 * # reopen the file to avoid iterator conflict
13676 * if reopen: # <<<<<<<<<<<<<<
13677 * store = StderrStore()
13678 * self.fp = samopen( samfile._filename, mode, NULL )
13680 if (__pyx_v_reopen) {
13682 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1317
13683 * # reopen the file to avoid iterator conflict
13685 * store = StderrStore() # <<<<<<<<<<<<<<
13686 * self.fp = samopen( samfile._filename, mode, NULL )
13689 __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__StderrStore); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13690 __Pyx_GOTREF(__pyx_t_1);
13691 __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 = 1317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13692 __Pyx_GOTREF(__pyx_t_2);
13693 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13694 __Pyx_DECREF(__pyx_v_store);
13695 __pyx_v_store = __pyx_t_2;
13698 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1318
13700 * store = StderrStore()
13701 * self.fp = samopen( samfile._filename, mode, NULL ) # <<<<<<<<<<<<<<
13703 * assert self.fp != NULL
13705 __pyx_t_5 = PyBytes_AsString(__pyx_v_mode); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13706 ((struct __pyx_obj_9csamtools_IteratorRowAll *)__pyx_v_self)->fp = samopen(__pyx_v_samfile->_filename, __pyx_t_5, NULL);
13708 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1319
13709 * store = StderrStore()
13710 * self.fp = samopen( samfile._filename, mode, NULL )
13711 * store.release() # <<<<<<<<<<<<<<
13712 * assert self.fp != NULL
13713 * self.owns_samfile = True
13715 __pyx_t_2 = PyObject_GetAttr(__pyx_v_store, __pyx_n_s__release); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13716 __Pyx_GOTREF(__pyx_t_2);
13717 __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 = 1319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13718 __Pyx_GOTREF(__pyx_t_1);
13719 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13720 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13722 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1320
13723 * self.fp = samopen( samfile._filename, mode, NULL )
13725 * assert self.fp != NULL # <<<<<<<<<<<<<<
13726 * self.owns_samfile = True
13729 #ifndef PYREX_WITHOUT_ASSERTIONS
13730 if (unlikely(!(((struct __pyx_obj_9csamtools_IteratorRowAll *)__pyx_v_self)->fp != NULL))) {
13731 PyErr_SetNone(PyExc_AssertionError);
13732 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1320; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13736 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1321
13738 * assert self.fp != NULL
13739 * self.owns_samfile = True # <<<<<<<<<<<<<<
13741 * self.fp = samfile.samfile
13743 ((struct __pyx_obj_9csamtools_IteratorRowAll *)__pyx_v_self)->owns_samfile = 1;
13748 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1323
13749 * self.owns_samfile = True
13751 * self.fp = samfile.samfile # <<<<<<<<<<<<<<
13752 * self.owns_samfile = False
13755 ((struct __pyx_obj_9csamtools_IteratorRowAll *)__pyx_v_self)->fp = __pyx_v_samfile->samfile;
13757 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1324
13759 * self.fp = samfile.samfile
13760 * self.owns_samfile = False # <<<<<<<<<<<<<<
13762 * # allocate memory for alignment
13764 ((struct __pyx_obj_9csamtools_IteratorRowAll *)__pyx_v_self)->owns_samfile = 0;
13768 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1327
13770 * # allocate memory for alignment
13771 * self.b = <bam1_t*>calloc(1, sizeof(bam1_t)) # <<<<<<<<<<<<<<
13773 * def __iter__(self):
13775 ((struct __pyx_obj_9csamtools_IteratorRowAll *)__pyx_v_self)->b = ((bam1_t *)calloc(1, (sizeof(bam1_t))));
13780 __Pyx_XDECREF(__pyx_t_1);
13781 __Pyx_XDECREF(__pyx_t_2);
13782 __Pyx_AddTraceback("csamtools.IteratorRowAll.__cinit__");
13785 __Pyx_DECREF(__pyx_v_mode);
13786 __Pyx_DECREF(__pyx_v_store);
13787 __Pyx_TraceReturn(Py_None);
13788 __Pyx_RefNannyFinishContext();
13792 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1329
13793 * self.b = <bam1_t*>calloc(1, sizeof(bam1_t))
13795 * def __iter__(self): # <<<<<<<<<<<<<<
13800 static PyObject *__pyx_pf_9csamtools_14IteratorRowAll___iter__(PyObject *__pyx_v_self); /*proto*/
13801 static PyObject *__pyx_pf_9csamtools_14IteratorRowAll___iter__(PyObject *__pyx_v_self) {
13802 PyObject *__pyx_r = NULL;
13803 __Pyx_TraceDeclarations
13804 __Pyx_RefNannySetupContext("__iter__");
13805 __Pyx_TraceCall("__iter__", __pyx_f[0], 1329);
13807 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1330
13809 * def __iter__(self):
13810 * return self # <<<<<<<<<<<<<<
13812 * cdef bam1_t * getCurrent( self ):
13814 __Pyx_XDECREF(__pyx_r);
13815 __Pyx_INCREF(__pyx_v_self);
13816 __pyx_r = __pyx_v_self;
13819 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
13821 __Pyx_XGIVEREF(__pyx_r);
13822 __Pyx_TraceReturn(__pyx_r);
13823 __Pyx_RefNannyFinishContext();
13827 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1332
13830 * cdef bam1_t * getCurrent( self ): # <<<<<<<<<<<<<<
13835 static bam1_t *__pyx_f_9csamtools_14IteratorRowAll_getCurrent(struct __pyx_obj_9csamtools_IteratorRowAll *__pyx_v_self) {
13837 __Pyx_TraceDeclarations
13838 __Pyx_RefNannySetupContext("getCurrent");
13839 __Pyx_TraceCall("getCurrent", __pyx_f[0], 1332);
13841 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1333
13843 * cdef bam1_t * getCurrent( self ):
13844 * return self.b # <<<<<<<<<<<<<<
13846 * cdef int cnext(self):
13848 __pyx_r = __pyx_v_self->b;
13853 __Pyx_TraceReturn(Py_None);
13854 __Pyx_RefNannyFinishContext();
13858 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1335
13861 * cdef int cnext(self): # <<<<<<<<<<<<<<
13862 * '''cversion of iterator. Used by IteratorColumn'''
13866 static int __pyx_f_9csamtools_14IteratorRowAll_cnext(struct __pyx_obj_9csamtools_IteratorRowAll *__pyx_v_self) {
13868 __Pyx_TraceDeclarations
13869 __Pyx_RefNannySetupContext("cnext");
13870 __Pyx_TraceCall("cnext", __pyx_f[0], 1335);
13872 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1338
13873 * '''cversion of iterator. Used by IteratorColumn'''
13875 * return samread(self.fp, self.b) # <<<<<<<<<<<<<<
13877 * def __next__(self):
13879 __pyx_r = samread(__pyx_v_self->fp, __pyx_v_self->b);
13884 __Pyx_TraceReturn(Py_None);
13885 __Pyx_RefNannyFinishContext();
13889 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1340
13890 * return samread(self.fp, self.b)
13892 * def __next__(self): # <<<<<<<<<<<<<<
13893 * """python version of next().
13897 static PyObject *__pyx_pf_9csamtools_14IteratorRowAll___next__(PyObject *__pyx_v_self); /*proto*/
13898 static char __pyx_doc_9csamtools_14IteratorRowAll___next__[] = "python version of next().\n\n pyrex uses this non-standard name instead of next()\n ";
13899 struct wrapperbase __pyx_wrapperbase_9csamtools_14IteratorRowAll___next__;
13900 static PyObject *__pyx_pf_9csamtools_14IteratorRowAll___next__(PyObject *__pyx_v_self) {
13902 PyObject *__pyx_r = NULL;
13904 PyObject *__pyx_t_2 = NULL;
13905 __Pyx_TraceDeclarations
13906 __Pyx_RefNannySetupContext("__next__");
13907 __Pyx_TraceCall("__next__", __pyx_f[0], 1340);
13909 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1346
13912 * ret = samread(self.fp, self.b) # <<<<<<<<<<<<<<
13914 * return makeAlignedRead( self.b )
13916 __pyx_v_ret = samread(((struct __pyx_obj_9csamtools_IteratorRowAll *)__pyx_v_self)->fp, ((struct __pyx_obj_9csamtools_IteratorRowAll *)__pyx_v_self)->b);
13918 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1347
13920 * ret = samread(self.fp, self.b)
13921 * if (ret > 0): # <<<<<<<<<<<<<<
13922 * return makeAlignedRead( self.b )
13925 __pyx_t_1 = (__pyx_v_ret > 0);
13928 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1348
13929 * ret = samread(self.fp, self.b)
13931 * return makeAlignedRead( self.b ) # <<<<<<<<<<<<<<
13933 * raise StopIteration
13935 __Pyx_XDECREF(__pyx_r);
13936 __pyx_t_2 = __pyx_f_9csamtools_makeAlignedRead(((struct __pyx_obj_9csamtools_IteratorRowAll *)__pyx_v_self)->b); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13937 __Pyx_GOTREF(__pyx_t_2);
13938 __pyx_r = __pyx_t_2;
13945 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1350
13946 * return makeAlignedRead( self.b )
13948 * raise StopIteration # <<<<<<<<<<<<<<
13950 * def __dealloc__(self):
13952 __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0);
13953 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13957 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
13960 __Pyx_XDECREF(__pyx_t_2);
13961 __Pyx_AddTraceback("csamtools.IteratorRowAll.__next__");
13964 __Pyx_XGIVEREF(__pyx_r);
13965 __Pyx_TraceReturn(__pyx_r);
13966 __Pyx_RefNannyFinishContext();
13970 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1352
13971 * raise StopIteration
13973 * def __dealloc__(self): # <<<<<<<<<<<<<<
13974 * bam_destroy1(self.b)
13975 * if self.owns_samfile: samclose( self.fp )
13978 static void __pyx_pf_9csamtools_14IteratorRowAll___dealloc__(PyObject *__pyx_v_self); /*proto*/
13979 static void __pyx_pf_9csamtools_14IteratorRowAll___dealloc__(PyObject *__pyx_v_self) {
13980 __Pyx_TraceDeclarations
13981 __Pyx_RefNannySetupContext("__dealloc__");
13982 __Pyx_TraceCall("__dealloc__", __pyx_f[0], 1352);
13984 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1353
13986 * def __dealloc__(self):
13987 * bam_destroy1(self.b) # <<<<<<<<<<<<<<
13988 * if self.owns_samfile: samclose( self.fp )
13991 bam_destroy1(((struct __pyx_obj_9csamtools_IteratorRowAll *)__pyx_v_self)->b);
13993 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1354
13994 * def __dealloc__(self):
13995 * bam_destroy1(self.b)
13996 * if self.owns_samfile: samclose( self.fp ) # <<<<<<<<<<<<<<
13998 * cdef class IteratorRowAllRefs(IteratorRow):
14000 if (((struct __pyx_obj_9csamtools_IteratorRowAll *)__pyx_v_self)->owns_samfile) {
14001 samclose(((struct __pyx_obj_9csamtools_IteratorRowAll *)__pyx_v_self)->fp);
14006 __Pyx_TraceReturn(Py_None);
14007 __Pyx_RefNannyFinishContext();
14010 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1363
14011 * cdef IteratorRowRegion rowiter
14013 * def __cinit__(self, Samfile samfile): # <<<<<<<<<<<<<<
14014 * assert samfile._isOpen()
14015 * if not samfile._hasIndex(): raise ValueError("no index available for fetch")
14018 static int __pyx_pf_9csamtools_18IteratorRowAllRefs___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
14019 static int __pyx_pf_9csamtools_18IteratorRowAllRefs___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
14020 struct __pyx_obj_9csamtools_Samfile *__pyx_v_samfile = 0;
14022 PyObject *__pyx_t_1 = NULL;
14023 PyObject *__pyx_t_2 = NULL;
14026 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__samfile,0};
14027 __Pyx_TraceDeclarations
14028 __Pyx_RefNannySetupContext("__cinit__");
14029 __Pyx_TraceCall("__cinit__", __pyx_f[0], 1363);
14030 if (unlikely(__pyx_kwds)) {
14031 Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
14032 PyObject* values[1] = {0};
14033 switch (PyTuple_GET_SIZE(__pyx_args)) {
14034 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
14036 default: goto __pyx_L5_argtuple_error;
14038 switch (PyTuple_GET_SIZE(__pyx_args)) {
14040 values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__samfile);
14041 if (likely(values[0])) kw_args--;
14042 else goto __pyx_L5_argtuple_error;
14044 if (unlikely(kw_args > 0)) {
14045 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1363; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
14047 __pyx_v_samfile = ((struct __pyx_obj_9csamtools_Samfile *)values[0]);
14048 } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
14049 goto __pyx_L5_argtuple_error;
14051 __pyx_v_samfile = ((struct __pyx_obj_9csamtools_Samfile *)PyTuple_GET_ITEM(__pyx_args, 0));
14053 goto __pyx_L4_argument_unpacking_done;
14054 __pyx_L5_argtuple_error:;
14055 __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1363; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
14057 __Pyx_AddTraceback("csamtools.IteratorRowAllRefs.__cinit__");
14058 __Pyx_RefNannyFinishContext();
14060 __pyx_L4_argument_unpacking_done:;
14061 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_samfile), __pyx_ptype_9csamtools_Samfile, 1, "samfile", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14063 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1364
14065 * def __cinit__(self, Samfile samfile):
14066 * assert samfile._isOpen() # <<<<<<<<<<<<<<
14067 * if not samfile._hasIndex(): raise ValueError("no index available for fetch")
14068 * self.samfile = samfile
14070 #ifndef PYREX_WITHOUT_ASSERTIONS
14071 __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_samfile), __pyx_n_s___isOpen); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14072 __Pyx_GOTREF(__pyx_t_1);
14073 __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 = 1364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14074 __Pyx_GOTREF(__pyx_t_2);
14075 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14076 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14077 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14078 if (unlikely(!__pyx_t_3)) {
14079 PyErr_SetNone(PyExc_AssertionError);
14080 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14084 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1365
14085 * def __cinit__(self, Samfile samfile):
14086 * assert samfile._isOpen()
14087 * if not samfile._hasIndex(): raise ValueError("no index available for fetch") # <<<<<<<<<<<<<<
14088 * self.samfile = samfile
14091 __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_samfile), __pyx_n_s___hasIndex); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14092 __Pyx_GOTREF(__pyx_t_2);
14093 __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 = 1365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14094 __Pyx_GOTREF(__pyx_t_1);
14095 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14096 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14097 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14098 __pyx_t_4 = (!__pyx_t_3);
14100 __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14101 __Pyx_GOTREF(__pyx_t_1);
14102 __Pyx_INCREF(((PyObject *)__pyx_kp_s_32));
14103 PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_kp_s_32));
14104 __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_32));
14105 __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14106 __Pyx_GOTREF(__pyx_t_2);
14107 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14108 __Pyx_Raise(__pyx_t_2, 0, 0);
14109 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14110 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14115 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1366
14116 * assert samfile._isOpen()
14117 * if not samfile._hasIndex(): raise ValueError("no index available for fetch")
14118 * self.samfile = samfile # <<<<<<<<<<<<<<
14122 __Pyx_INCREF(((PyObject *)__pyx_v_samfile));
14123 __Pyx_GIVEREF(((PyObject *)__pyx_v_samfile));
14124 __Pyx_GOTREF(((struct __pyx_obj_9csamtools_IteratorRowAllRefs *)__pyx_v_self)->samfile);
14125 __Pyx_DECREF(((PyObject *)((struct __pyx_obj_9csamtools_IteratorRowAllRefs *)__pyx_v_self)->samfile));
14126 ((struct __pyx_obj_9csamtools_IteratorRowAllRefs *)__pyx_v_self)->samfile = __pyx_v_samfile;
14128 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1367
14129 * if not samfile._hasIndex(): raise ValueError("no index available for fetch")
14130 * self.samfile = samfile
14131 * self.tid = -1 # <<<<<<<<<<<<<<
14133 * def nextiter(self):
14135 ((struct __pyx_obj_9csamtools_IteratorRowAllRefs *)__pyx_v_self)->tid = -1;
14140 __Pyx_XDECREF(__pyx_t_1);
14141 __Pyx_XDECREF(__pyx_t_2);
14142 __Pyx_AddTraceback("csamtools.IteratorRowAllRefs.__cinit__");
14145 __Pyx_TraceReturn(Py_None);
14146 __Pyx_RefNannyFinishContext();
14150 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1369
14153 * def nextiter(self): # <<<<<<<<<<<<<<
14154 * self.rowiter = IteratorRowRegion(self.samfile, self.tid, 0, 1<<29)
14158 static PyObject *__pyx_pf_9csamtools_18IteratorRowAllRefs_nextiter(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
14159 static char __pyx_doc_9csamtools_18IteratorRowAllRefs_nextiter[] = "IteratorRowAllRefs.nextiter(self)";
14160 static PyObject *__pyx_pf_9csamtools_18IteratorRowAllRefs_nextiter(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
14161 PyObject *__pyx_r = NULL;
14162 PyObject *__pyx_t_1 = NULL;
14163 PyObject *__pyx_t_2 = NULL;
14164 __Pyx_TraceDeclarations
14165 __Pyx_RefNannySetupContext("nextiter");
14166 __Pyx_TraceCall("nextiter", __pyx_f[0], 1369);
14168 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1370
14170 * def nextiter(self):
14171 * self.rowiter = IteratorRowRegion(self.samfile, self.tid, 0, 1<<29) # <<<<<<<<<<<<<<
14173 * def __iter__(self):
14175 __pyx_t_1 = PyInt_FromLong(((struct __pyx_obj_9csamtools_IteratorRowAllRefs *)__pyx_v_self)->tid); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14176 __Pyx_GOTREF(__pyx_t_1);
14177 __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14178 __Pyx_GOTREF(__pyx_t_2);
14179 __Pyx_INCREF(((PyObject *)((struct __pyx_obj_9csamtools_IteratorRowAllRefs *)__pyx_v_self)->samfile));
14180 PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)((struct __pyx_obj_9csamtools_IteratorRowAllRefs *)__pyx_v_self)->samfile));
14181 __Pyx_GIVEREF(((PyObject *)((struct __pyx_obj_9csamtools_IteratorRowAllRefs *)__pyx_v_self)->samfile));
14182 PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
14183 __Pyx_GIVEREF(__pyx_t_1);
14184 __Pyx_INCREF(__pyx_int_0);
14185 PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_int_0);
14186 __Pyx_GIVEREF(__pyx_int_0);
14187 __Pyx_INCREF(__pyx_int_536870912);
14188 PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_int_536870912);
14189 __Pyx_GIVEREF(__pyx_int_536870912);
14191 __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_9csamtools_IteratorRowRegion)), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14192 __Pyx_GOTREF(__pyx_t_1);
14193 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14194 __Pyx_GIVEREF(__pyx_t_1);
14195 __Pyx_GOTREF(((struct __pyx_obj_9csamtools_IteratorRowAllRefs *)__pyx_v_self)->rowiter);
14196 __Pyx_DECREF(((PyObject *)((struct __pyx_obj_9csamtools_IteratorRowAllRefs *)__pyx_v_self)->rowiter));
14197 ((struct __pyx_obj_9csamtools_IteratorRowAllRefs *)__pyx_v_self)->rowiter = ((struct __pyx_obj_9csamtools_IteratorRowRegion *)__pyx_t_1);
14200 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
14203 __Pyx_XDECREF(__pyx_t_1);
14204 __Pyx_XDECREF(__pyx_t_2);
14205 __Pyx_AddTraceback("csamtools.IteratorRowAllRefs.nextiter");
14208 __Pyx_XGIVEREF(__pyx_r);
14209 __Pyx_TraceReturn(__pyx_r);
14210 __Pyx_RefNannyFinishContext();
14214 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1372
14215 * self.rowiter = IteratorRowRegion(self.samfile, self.tid, 0, 1<<29)
14217 * def __iter__(self): # <<<<<<<<<<<<<<
14222 static PyObject *__pyx_pf_9csamtools_18IteratorRowAllRefs___iter__(PyObject *__pyx_v_self); /*proto*/
14223 static PyObject *__pyx_pf_9csamtools_18IteratorRowAllRefs___iter__(PyObject *__pyx_v_self) {
14224 PyObject *__pyx_r = NULL;
14225 __Pyx_TraceDeclarations
14226 __Pyx_RefNannySetupContext("__iter__");
14227 __Pyx_TraceCall("__iter__", __pyx_f[0], 1372);
14229 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1373
14231 * def __iter__(self):
14232 * return self # <<<<<<<<<<<<<<
14234 * def __next__(self):
14236 __Pyx_XDECREF(__pyx_r);
14237 __Pyx_INCREF(__pyx_v_self);
14238 __pyx_r = __pyx_v_self;
14241 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
14243 __Pyx_XGIVEREF(__pyx_r);
14244 __Pyx_TraceReturn(__pyx_r);
14245 __Pyx_RefNannyFinishContext();
14249 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1375
14252 * def __next__(self): # <<<<<<<<<<<<<<
14253 * """python version of next().
14257 static PyObject *__pyx_pf_9csamtools_18IteratorRowAllRefs___next__(PyObject *__pyx_v_self); /*proto*/
14258 static char __pyx_doc_9csamtools_18IteratorRowAllRefs___next__[] = "python version of next().\n\n pyrex uses this non-standard name instead of next()\n ";
14259 struct wrapperbase __pyx_wrapperbase_9csamtools_18IteratorRowAllRefs___next__;
14260 static PyObject *__pyx_pf_9csamtools_18IteratorRowAllRefs___next__(PyObject *__pyx_v_self) {
14261 PyObject *__pyx_r = NULL;
14263 PyObject *__pyx_t_2 = NULL;
14265 PyObject *__pyx_t_4 = NULL;
14266 PyObject *__pyx_t_5 = NULL;
14267 __Pyx_TraceDeclarations
14268 __Pyx_RefNannySetupContext("__next__");
14269 __Pyx_TraceCall("__next__", __pyx_f[0], 1375);
14271 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1381
14273 * # Create an initial iterator
14274 * if self.tid==-1: # <<<<<<<<<<<<<<
14275 * if not self.samfile.nreferences:
14276 * raise StopIteration
14278 __pyx_t_1 = (((struct __pyx_obj_9csamtools_IteratorRowAllRefs *)__pyx_v_self)->tid == -1);
14281 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1382
14282 * # Create an initial iterator
14284 * if not self.samfile.nreferences: # <<<<<<<<<<<<<<
14285 * raise StopIteration
14288 __pyx_t_2 = PyObject_GetAttr(((PyObject *)((struct __pyx_obj_9csamtools_IteratorRowAllRefs *)__pyx_v_self)->samfile), __pyx_n_s__nreferences); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1382; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14289 __Pyx_GOTREF(__pyx_t_2);
14290 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1382; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14291 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14292 __pyx_t_3 = (!__pyx_t_1);
14295 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1383
14297 * if not self.samfile.nreferences:
14298 * raise StopIteration # <<<<<<<<<<<<<<
14302 __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0);
14303 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14308 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1384
14309 * if not self.samfile.nreferences:
14310 * raise StopIteration
14311 * self.tid = 0 # <<<<<<<<<<<<<<
14315 ((struct __pyx_obj_9csamtools_IteratorRowAllRefs *)__pyx_v_self)->tid = 0;
14317 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1385
14318 * raise StopIteration
14320 * self.nextiter() # <<<<<<<<<<<<<<
14324 __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__nextiter); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1385; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14325 __Pyx_GOTREF(__pyx_t_2);
14326 __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1385; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14327 __Pyx_GOTREF(__pyx_t_4);
14328 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14329 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
14334 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1387
14337 * while 1: # <<<<<<<<<<<<<<
14338 * self.rowiter.cnext()
14344 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1388
14347 * self.rowiter.cnext() # <<<<<<<<<<<<<<
14349 * # If current iterator is not exhausted, return aligned read
14351 ((struct __pyx_vtabstruct_9csamtools_IteratorRowRegion *)((struct __pyx_obj_9csamtools_IteratorRowAllRefs *)__pyx_v_self)->rowiter->__pyx_vtab)->cnext(((struct __pyx_obj_9csamtools_IteratorRowAllRefs *)__pyx_v_self)->rowiter);
14353 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1391
14355 * # If current iterator is not exhausted, return aligned read
14356 * if self.rowiter.retval>0: # <<<<<<<<<<<<<<
14357 * return makeAlignedRead(self.rowiter.b)
14360 __pyx_t_3 = (((struct __pyx_obj_9csamtools_IteratorRowAllRefs *)__pyx_v_self)->rowiter->retval > 0);
14363 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1392
14364 * # If current iterator is not exhausted, return aligned read
14365 * if self.rowiter.retval>0:
14366 * return makeAlignedRead(self.rowiter.b) # <<<<<<<<<<<<<<
14370 __Pyx_XDECREF(__pyx_r);
14371 __pyx_t_4 = __pyx_f_9csamtools_makeAlignedRead(((struct __pyx_obj_9csamtools_IteratorRowAllRefs *)__pyx_v_self)->rowiter->b); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14372 __Pyx_GOTREF(__pyx_t_4);
14373 __pyx_r = __pyx_t_4;
14380 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1394
14381 * return makeAlignedRead(self.rowiter.b)
14383 * self.tid += 1 # <<<<<<<<<<<<<<
14385 * # Otherwise, proceed to next reference or stop
14387 ((struct __pyx_obj_9csamtools_IteratorRowAllRefs *)__pyx_v_self)->tid += 1;
14389 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1397
14391 * # Otherwise, proceed to next reference or stop
14392 * if self.tid<self.samfile.nreferences: # <<<<<<<<<<<<<<
14396 __pyx_t_4 = PyInt_FromLong(((struct __pyx_obj_9csamtools_IteratorRowAllRefs *)__pyx_v_self)->tid); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14397 __Pyx_GOTREF(__pyx_t_4);
14398 __pyx_t_2 = PyObject_GetAttr(((PyObject *)((struct __pyx_obj_9csamtools_IteratorRowAllRefs *)__pyx_v_self)->samfile), __pyx_n_s__nreferences); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14399 __Pyx_GOTREF(__pyx_t_2);
14400 __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_t_2, Py_LT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14401 __Pyx_GOTREF(__pyx_t_5);
14402 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
14403 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14404 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14405 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14408 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1398
14409 * # Otherwise, proceed to next reference or stop
14410 * if self.tid<self.samfile.nreferences:
14411 * self.nextiter() # <<<<<<<<<<<<<<
14413 * raise StopIteration
14415 __pyx_t_5 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__nextiter); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14416 __Pyx_GOTREF(__pyx_t_5);
14417 __pyx_t_2 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14418 __Pyx_GOTREF(__pyx_t_2);
14419 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14420 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14425 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1400
14428 * raise StopIteration # <<<<<<<<<<<<<<
14430 * cdef class IteratorRowSelection(IteratorRow):
14432 __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0);
14433 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1400; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14438 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
14441 __Pyx_XDECREF(__pyx_t_2);
14442 __Pyx_XDECREF(__pyx_t_4);
14443 __Pyx_XDECREF(__pyx_t_5);
14444 __Pyx_AddTraceback("csamtools.IteratorRowAllRefs.__next__");
14447 __Pyx_XGIVEREF(__pyx_r);
14448 __Pyx_TraceReturn(__pyx_r);
14449 __Pyx_RefNannyFinishContext();
14453 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1415
14454 * cdef int owns_samfile
14456 * def __cinit__(self, Samfile samfile, positions, int reopen = True ): # <<<<<<<<<<<<<<
14458 * if not samfile._isOpen():
14461 static int __pyx_pf_9csamtools_20IteratorRowSelection___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
14462 static int __pyx_pf_9csamtools_20IteratorRowSelection___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
14463 struct __pyx_obj_9csamtools_Samfile *__pyx_v_samfile = 0;
14464 PyObject *__pyx_v_positions = 0;
14465 int __pyx_v_reopen;
14466 PyObject *__pyx_v_mode;
14467 PyObject *__pyx_v_store;
14469 PyObject *__pyx_t_1 = NULL;
14470 PyObject *__pyx_t_2 = NULL;
14474 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__samfile,&__pyx_n_s__positions,&__pyx_n_s__reopen,0};
14475 __Pyx_TraceDeclarations
14476 __Pyx_RefNannySetupContext("__cinit__");
14477 __Pyx_TraceCall("__cinit__", __pyx_f[0], 1415);
14478 if (unlikely(__pyx_kwds)) {
14479 Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
14480 PyObject* values[3] = {0,0,0};
14481 switch (PyTuple_GET_SIZE(__pyx_args)) {
14482 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
14483 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
14484 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
14486 default: goto __pyx_L5_argtuple_error;
14488 switch (PyTuple_GET_SIZE(__pyx_args)) {
14490 values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__samfile);
14491 if (likely(values[0])) kw_args--;
14492 else goto __pyx_L5_argtuple_error;
14494 values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__positions);
14495 if (likely(values[1])) kw_args--;
14497 __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1415; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
14501 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__reopen);
14502 if (value) { values[2] = value; kw_args--; }
14505 if (unlikely(kw_args > 0)) {
14506 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1415; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
14508 __pyx_v_samfile = ((struct __pyx_obj_9csamtools_Samfile *)values[0]);
14509 __pyx_v_positions = values[1];
14511 __pyx_v_reopen = __Pyx_PyInt_AsInt(values[2]); if (unlikely((__pyx_v_reopen == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1415; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
14513 __pyx_v_reopen = ((int)1);
14516 __pyx_v_reopen = ((int)1);
14517 switch (PyTuple_GET_SIZE(__pyx_args)) {
14519 __pyx_v_reopen = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 2)); if (unlikely((__pyx_v_reopen == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1415; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
14521 __pyx_v_positions = PyTuple_GET_ITEM(__pyx_args, 1);
14522 __pyx_v_samfile = ((struct __pyx_obj_9csamtools_Samfile *)PyTuple_GET_ITEM(__pyx_args, 0));
14524 default: goto __pyx_L5_argtuple_error;
14527 goto __pyx_L4_argument_unpacking_done;
14528 __pyx_L5_argtuple_error:;
14529 __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1415; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
14531 __Pyx_AddTraceback("csamtools.IteratorRowSelection.__cinit__");
14532 __Pyx_RefNannyFinishContext();
14534 __pyx_L4_argument_unpacking_done:;
14535 __pyx_v_mode = Py_None; __Pyx_INCREF(Py_None);
14536 __pyx_v_store = Py_None; __Pyx_INCREF(Py_None);
14537 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_samfile), __pyx_ptype_9csamtools_Samfile, 1, "samfile", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1415; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14539 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1417
14540 * def __cinit__(self, Samfile samfile, positions, int reopen = True ):
14542 * if not samfile._isOpen(): # <<<<<<<<<<<<<<
14543 * raise ValueError( "I/O operation on closed file" )
14546 __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_samfile), __pyx_n_s___isOpen); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14547 __Pyx_GOTREF(__pyx_t_1);
14548 __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 = 1417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14549 __Pyx_GOTREF(__pyx_t_2);
14550 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14551 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14552 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14553 __pyx_t_4 = (!__pyx_t_3);
14556 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1418
14558 * if not samfile._isOpen():
14559 * raise ValueError( "I/O operation on closed file" ) # <<<<<<<<<<<<<<
14561 * if not samfile._isOpen():
14563 __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14564 __Pyx_GOTREF(__pyx_t_2);
14565 __Pyx_INCREF(((PyObject *)__pyx_kp_s_5));
14566 PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_5));
14567 __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_5));
14568 __pyx_t_1 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14569 __Pyx_GOTREF(__pyx_t_1);
14570 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14571 __Pyx_Raise(__pyx_t_1, 0, 0);
14572 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14573 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14578 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1420
14579 * raise ValueError( "I/O operation on closed file" )
14581 * if not samfile._isOpen(): # <<<<<<<<<<<<<<
14582 * raise ValueError( "I/O operation on closed file" )
14585 __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_samfile), __pyx_n_s___isOpen); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1420; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14586 __Pyx_GOTREF(__pyx_t_1);
14587 __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 = 1420; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14588 __Pyx_GOTREF(__pyx_t_2);
14589 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14590 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1420; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14591 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14592 __pyx_t_3 = (!__pyx_t_4);
14595 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1421
14597 * if not samfile._isOpen():
14598 * raise ValueError( "I/O operation on closed file" ) # <<<<<<<<<<<<<<
14600 * assert samfile.isbam, "can only use this iterator on bam files"
14602 __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14603 __Pyx_GOTREF(__pyx_t_2);
14604 __Pyx_INCREF(((PyObject *)__pyx_kp_s_5));
14605 PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_5));
14606 __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_5));
14607 __pyx_t_1 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14608 __Pyx_GOTREF(__pyx_t_1);
14609 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14610 __Pyx_Raise(__pyx_t_1, 0, 0);
14611 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14612 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14617 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1423
14618 * raise ValueError( "I/O operation on closed file" )
14620 * assert samfile.isbam, "can only use this iterator on bam files" # <<<<<<<<<<<<<<
14624 #ifndef PYREX_WITHOUT_ASSERTIONS
14625 if (unlikely(!__pyx_v_samfile->isbam)) {
14626 PyErr_SetObject(PyExc_AssertionError, ((PyObject *)__pyx_kp_s_55));
14627 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14631 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1424
14633 * assert samfile.isbam, "can only use this iterator on bam files"
14634 * mode = "rb" # <<<<<<<<<<<<<<
14636 * # reopen the file to avoid iterator conflict
14638 __Pyx_INCREF(((PyObject *)__pyx_n_s__rb));
14639 __Pyx_DECREF(__pyx_v_mode);
14640 __pyx_v_mode = ((PyObject *)__pyx_n_s__rb);
14642 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1427
14644 * # reopen the file to avoid iterator conflict
14645 * if reopen: # <<<<<<<<<<<<<<
14646 * store = StderrStore()
14647 * self.fp = samopen( samfile._filename, mode, NULL )
14649 if (__pyx_v_reopen) {
14651 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1428
14652 * # reopen the file to avoid iterator conflict
14654 * store = StderrStore() # <<<<<<<<<<<<<<
14655 * self.fp = samopen( samfile._filename, mode, NULL )
14658 __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__StderrStore); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14659 __Pyx_GOTREF(__pyx_t_1);
14660 __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 = 1428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14661 __Pyx_GOTREF(__pyx_t_2);
14662 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14663 __Pyx_DECREF(__pyx_v_store);
14664 __pyx_v_store = __pyx_t_2;
14667 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1429
14669 * store = StderrStore()
14670 * self.fp = samopen( samfile._filename, mode, NULL ) # <<<<<<<<<<<<<<
14672 * assert self.fp != NULL
14674 __pyx_t_5 = PyBytes_AsString(__pyx_v_mode); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14675 ((struct __pyx_obj_9csamtools_IteratorRowSelection *)__pyx_v_self)->fp = samopen(__pyx_v_samfile->_filename, __pyx_t_5, NULL);
14677 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1430
14678 * store = StderrStore()
14679 * self.fp = samopen( samfile._filename, mode, NULL )
14680 * store.release() # <<<<<<<<<<<<<<
14681 * assert self.fp != NULL
14682 * self.owns_samfile = True
14684 __pyx_t_2 = PyObject_GetAttr(__pyx_v_store, __pyx_n_s__release); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1430; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14685 __Pyx_GOTREF(__pyx_t_2);
14686 __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 = 1430; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14687 __Pyx_GOTREF(__pyx_t_1);
14688 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14689 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14691 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1431
14692 * self.fp = samopen( samfile._filename, mode, NULL )
14694 * assert self.fp != NULL # <<<<<<<<<<<<<<
14695 * self.owns_samfile = True
14698 #ifndef PYREX_WITHOUT_ASSERTIONS
14699 if (unlikely(!(((struct __pyx_obj_9csamtools_IteratorRowSelection *)__pyx_v_self)->fp != NULL))) {
14700 PyErr_SetNone(PyExc_AssertionError);
14701 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14705 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1432
14707 * assert self.fp != NULL
14708 * self.owns_samfile = True # <<<<<<<<<<<<<<
14710 * self.fp = samfile.samfile
14712 ((struct __pyx_obj_9csamtools_IteratorRowSelection *)__pyx_v_self)->owns_samfile = 1;
14717 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1434
14718 * self.owns_samfile = True
14720 * self.fp = samfile.samfile # <<<<<<<<<<<<<<
14721 * self.owns_samfile = False
14724 ((struct __pyx_obj_9csamtools_IteratorRowSelection *)__pyx_v_self)->fp = __pyx_v_samfile->samfile;
14726 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1435
14728 * self.fp = samfile.samfile
14729 * self.owns_samfile = False # <<<<<<<<<<<<<<
14731 * # allocate memory for alignment
14733 ((struct __pyx_obj_9csamtools_IteratorRowSelection *)__pyx_v_self)->owns_samfile = 0;
14737 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1438
14739 * # allocate memory for alignment
14740 * self.b = <bam1_t*>calloc(1, sizeof(bam1_t)) # <<<<<<<<<<<<<<
14742 * self.positions = positions
14744 ((struct __pyx_obj_9csamtools_IteratorRowSelection *)__pyx_v_self)->b = ((bam1_t *)calloc(1, (sizeof(bam1_t))));
14746 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1440
14747 * self.b = <bam1_t*>calloc(1, sizeof(bam1_t))
14749 * self.positions = positions # <<<<<<<<<<<<<<
14750 * self.current_pos = 0
14753 __Pyx_INCREF(__pyx_v_positions);
14754 __Pyx_GIVEREF(__pyx_v_positions);
14755 __Pyx_GOTREF(((struct __pyx_obj_9csamtools_IteratorRowSelection *)__pyx_v_self)->positions);
14756 __Pyx_DECREF(((struct __pyx_obj_9csamtools_IteratorRowSelection *)__pyx_v_self)->positions);
14757 ((struct __pyx_obj_9csamtools_IteratorRowSelection *)__pyx_v_self)->positions = __pyx_v_positions;
14759 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1441
14761 * self.positions = positions
14762 * self.current_pos = 0 # <<<<<<<<<<<<<<
14764 * def __iter__(self):
14766 ((struct __pyx_obj_9csamtools_IteratorRowSelection *)__pyx_v_self)->current_pos = 0;
14771 __Pyx_XDECREF(__pyx_t_1);
14772 __Pyx_XDECREF(__pyx_t_2);
14773 __Pyx_AddTraceback("csamtools.IteratorRowSelection.__cinit__");
14776 __Pyx_DECREF(__pyx_v_mode);
14777 __Pyx_DECREF(__pyx_v_store);
14778 __Pyx_TraceReturn(Py_None);
14779 __Pyx_RefNannyFinishContext();
14783 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1443
14784 * self.current_pos = 0
14786 * def __iter__(self): # <<<<<<<<<<<<<<
14791 static PyObject *__pyx_pf_9csamtools_20IteratorRowSelection___iter__(PyObject *__pyx_v_self); /*proto*/
14792 static PyObject *__pyx_pf_9csamtools_20IteratorRowSelection___iter__(PyObject *__pyx_v_self) {
14793 PyObject *__pyx_r = NULL;
14794 __Pyx_TraceDeclarations
14795 __Pyx_RefNannySetupContext("__iter__");
14796 __Pyx_TraceCall("__iter__", __pyx_f[0], 1443);
14798 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1444
14800 * def __iter__(self):
14801 * return self # <<<<<<<<<<<<<<
14803 * cdef bam1_t * getCurrent( self ):
14805 __Pyx_XDECREF(__pyx_r);
14806 __Pyx_INCREF(__pyx_v_self);
14807 __pyx_r = __pyx_v_self;
14810 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
14812 __Pyx_XGIVEREF(__pyx_r);
14813 __Pyx_TraceReturn(__pyx_r);
14814 __Pyx_RefNannyFinishContext();
14818 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1446
14821 * cdef bam1_t * getCurrent( self ): # <<<<<<<<<<<<<<
14826 static bam1_t *__pyx_f_9csamtools_20IteratorRowSelection_getCurrent(struct __pyx_obj_9csamtools_IteratorRowSelection *__pyx_v_self) {
14828 __Pyx_TraceDeclarations
14829 __Pyx_RefNannySetupContext("getCurrent");
14830 __Pyx_TraceCall("getCurrent", __pyx_f[0], 1446);
14832 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1447
14834 * cdef bam1_t * getCurrent( self ):
14835 * return self.b # <<<<<<<<<<<<<<
14837 * cdef int cnext(self):
14839 __pyx_r = __pyx_v_self->b;
14844 __Pyx_TraceReturn(Py_None);
14845 __Pyx_RefNannyFinishContext();
14849 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1449
14852 * cdef int cnext(self): # <<<<<<<<<<<<<<
14853 * '''cversion of iterator'''
14857 static int __pyx_f_9csamtools_20IteratorRowSelection_cnext(struct __pyx_obj_9csamtools_IteratorRowSelection *__pyx_v_self) {
14859 Py_ssize_t __pyx_t_1;
14861 PyObject *__pyx_t_3 = NULL;
14862 uint64_t __pyx_t_4;
14863 __Pyx_TraceDeclarations
14864 __Pyx_RefNannySetupContext("cnext");
14865 __Pyx_TraceCall("cnext", __pyx_f[0], 1449);
14867 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1453
14869 * # end iteration if out of positions
14870 * if self.current_pos >= len(self.positions): return -1 # <<<<<<<<<<<<<<
14872 * bam_seek( self.fp.x.bam, self.positions[self.current_pos], 0 )
14874 __pyx_t_1 = PyObject_Length(__pyx_v_self->positions); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14875 __pyx_t_2 = (__pyx_v_self->current_pos >= __pyx_t_1);
14883 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1455
14884 * if self.current_pos >= len(self.positions): return -1
14886 * bam_seek( self.fp.x.bam, self.positions[self.current_pos], 0 ) # <<<<<<<<<<<<<<
14887 * self.current_pos += 1
14888 * return samread(self.fp, self.b)
14890 __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_self->positions, __pyx_v_self->current_pos, sizeof(int), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1455; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14891 __Pyx_GOTREF(__pyx_t_3);
14892 __pyx_t_4 = __Pyx_PyInt_from_py_uint64_t(__pyx_t_3); if (unlikely((__pyx_t_4 == (uint64_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1455; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14893 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14894 bam_seek(__pyx_v_self->fp->x.bam, __pyx_t_4, 0);
14896 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1456
14898 * bam_seek( self.fp.x.bam, self.positions[self.current_pos], 0 )
14899 * self.current_pos += 1 # <<<<<<<<<<<<<<
14900 * return samread(self.fp, self.b)
14903 __pyx_v_self->current_pos += 1;
14905 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1457
14906 * bam_seek( self.fp.x.bam, self.positions[self.current_pos], 0 )
14907 * self.current_pos += 1
14908 * return samread(self.fp, self.b) # <<<<<<<<<<<<<<
14910 * def __next__(self):
14912 __pyx_r = samread(__pyx_v_self->fp, __pyx_v_self->b);
14918 __Pyx_XDECREF(__pyx_t_3);
14919 __Pyx_WriteUnraisable("csamtools.IteratorRowSelection.cnext");
14922 __Pyx_TraceReturn(Py_None);
14923 __Pyx_RefNannyFinishContext();
14927 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1459
14928 * return samread(self.fp, self.b)
14930 * def __next__(self): # <<<<<<<<<<<<<<
14931 * """python version of next().
14935 static PyObject *__pyx_pf_9csamtools_20IteratorRowSelection___next__(PyObject *__pyx_v_self); /*proto*/
14936 static char __pyx_doc_9csamtools_20IteratorRowSelection___next__[] = "python version of next().\n\n pyrex uses this non-standard name instead of next()\n ";
14937 struct wrapperbase __pyx_wrapperbase_9csamtools_20IteratorRowSelection___next__;
14938 static PyObject *__pyx_pf_9csamtools_20IteratorRowSelection___next__(PyObject *__pyx_v_self) {
14940 PyObject *__pyx_r = NULL;
14942 PyObject *__pyx_t_2 = NULL;
14943 __Pyx_TraceDeclarations
14944 __Pyx_RefNannySetupContext("__next__");
14945 __Pyx_TraceCall("__next__", __pyx_f[0], 1459);
14947 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1465
14950 * cdef int ret = self.cnext() # <<<<<<<<<<<<<<
14952 * return makeAlignedRead( self.b )
14954 __pyx_v_ret = ((struct __pyx_vtabstruct_9csamtools_IteratorRowSelection *)((struct __pyx_obj_9csamtools_IteratorRowSelection *)__pyx_v_self)->__pyx_vtab)->cnext(((struct __pyx_obj_9csamtools_IteratorRowSelection *)__pyx_v_self));
14956 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1466
14958 * cdef int ret = self.cnext()
14959 * if (ret > 0): # <<<<<<<<<<<<<<
14960 * return makeAlignedRead( self.b )
14963 __pyx_t_1 = (__pyx_v_ret > 0);
14966 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1467
14967 * cdef int ret = self.cnext()
14969 * return makeAlignedRead( self.b ) # <<<<<<<<<<<<<<
14971 * raise StopIteration
14973 __Pyx_XDECREF(__pyx_r);
14974 __pyx_t_2 = __pyx_f_9csamtools_makeAlignedRead(((struct __pyx_obj_9csamtools_IteratorRowSelection *)__pyx_v_self)->b); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14975 __Pyx_GOTREF(__pyx_t_2);
14976 __pyx_r = __pyx_t_2;
14983 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1469
14984 * return makeAlignedRead( self.b )
14986 * raise StopIteration # <<<<<<<<<<<<<<
14988 * def __dealloc__(self):
14990 __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0);
14991 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14995 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
14998 __Pyx_XDECREF(__pyx_t_2);
14999 __Pyx_AddTraceback("csamtools.IteratorRowSelection.__next__");
15002 __Pyx_XGIVEREF(__pyx_r);
15003 __Pyx_TraceReturn(__pyx_r);
15004 __Pyx_RefNannyFinishContext();
15008 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1471
15009 * raise StopIteration
15011 * def __dealloc__(self): # <<<<<<<<<<<<<<
15012 * bam_destroy1(self.b)
15013 * if self.owns_samfile: samclose( self.fp )
15016 static void __pyx_pf_9csamtools_20IteratorRowSelection___dealloc__(PyObject *__pyx_v_self); /*proto*/
15017 static void __pyx_pf_9csamtools_20IteratorRowSelection___dealloc__(PyObject *__pyx_v_self) {
15018 __Pyx_TraceDeclarations
15019 __Pyx_RefNannySetupContext("__dealloc__");
15020 __Pyx_TraceCall("__dealloc__", __pyx_f[0], 1471);
15022 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1472
15024 * def __dealloc__(self):
15025 * bam_destroy1(self.b) # <<<<<<<<<<<<<<
15026 * if self.owns_samfile: samclose( self.fp )
15029 bam_destroy1(((struct __pyx_obj_9csamtools_IteratorRowSelection *)__pyx_v_self)->b);
15031 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1473
15032 * def __dealloc__(self):
15033 * bam_destroy1(self.b)
15034 * if self.owns_samfile: samclose( self.fp ) # <<<<<<<<<<<<<<
15036 * ##-------------------------------------------------------------------
15038 if (((struct __pyx_obj_9csamtools_IteratorRowSelection *)__pyx_v_self)->owns_samfile) {
15039 samclose(((struct __pyx_obj_9csamtools_IteratorRowSelection *)__pyx_v_self)->fp);
15044 __Pyx_TraceReturn(Py_None);
15045 __Pyx_RefNannyFinishContext();
15048 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1486
15051 * cdef int __advance_all( void * data, bam1_t * b ): # <<<<<<<<<<<<<<
15052 * '''advance without any read filtering.
15056 static int __pyx_f_9csamtools___advance_all(void *__pyx_v_data, bam1_t *__pyx_v_b) {
15057 __pyx_t_9csamtools___iterdata *__pyx_v_d;
15059 __Pyx_TraceDeclarations
15060 __Pyx_RefNannySetupContext("__advance_all");
15061 __Pyx_TraceCall("__advance_all", __pyx_f[0], 1486);
15063 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1490
15065 * cdef __iterdata * d
15066 * d = <__iterdata*>data # <<<<<<<<<<<<<<
15067 * return bam_iter_read( d.samfile.x.bam, d.iter, b )
15070 __pyx_v_d = ((__pyx_t_9csamtools___iterdata *)__pyx_v_data);
15072 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1491
15073 * cdef __iterdata * d
15074 * d = <__iterdata*>data
15075 * return bam_iter_read( d.samfile.x.bam, d.iter, b ) # <<<<<<<<<<<<<<
15077 * cdef int __advance_snpcalls( void * data, bam1_t * b ):
15079 __pyx_r = bam_iter_read(__pyx_v_d->samfile->x.bam, __pyx_v_d->iter, __pyx_v_b);
15084 __Pyx_TraceReturn(Py_None);
15085 __Pyx_RefNannyFinishContext();
15089 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1493
15090 * return bam_iter_read( d.samfile.x.bam, d.iter, b )
15092 * cdef int __advance_snpcalls( void * data, bam1_t * b ): # <<<<<<<<<<<<<<
15093 * '''advance using same filter and read processing as in
15094 * the samtools pileup.
15097 static int __pyx_f_9csamtools___advance_snpcalls(void *__pyx_v_data, bam1_t *__pyx_v_b) {
15098 __pyx_t_9csamtools___iterdata *__pyx_v_d;
15102 int __pyx_v_is_cns;
15103 int __pyx_v_is_nobaq;
15104 int __pyx_v_capQ_thres;
15109 PyObject *__pyx_t_4 = NULL;
15110 PyObject *__pyx_t_5 = NULL;
15111 PyObject *__pyx_t_6 = NULL;
15113 __Pyx_TraceDeclarations
15114 __Pyx_RefNannySetupContext("__advance_snpcalls");
15115 __Pyx_TraceCall("__advance_snpcalls", __pyx_f[0], 1493);
15117 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1498
15119 * cdef __iterdata * d
15120 * d = <__iterdata*>data # <<<<<<<<<<<<<<
15122 * cdef int ret = bam_iter_read( d.samfile.x.bam, d.iter, b )
15124 __pyx_v_d = ((__pyx_t_9csamtools___iterdata *)__pyx_v_data);
15126 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1500
15127 * d = <__iterdata*>data
15129 * cdef int ret = bam_iter_read( d.samfile.x.bam, d.iter, b ) # <<<<<<<<<<<<<<
15130 * cdef int skip = 0
15133 __pyx_v_ret = bam_iter_read(__pyx_v_d->samfile->x.bam, __pyx_v_d->iter, __pyx_v_b);
15135 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1501
15137 * cdef int ret = bam_iter_read( d.samfile.x.bam, d.iter, b )
15138 * cdef int skip = 0 # <<<<<<<<<<<<<<
15140 * cdef int is_cns = 1
15144 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1503
15145 * cdef int skip = 0
15147 * cdef int is_cns = 1 # <<<<<<<<<<<<<<
15148 * cdef int is_nobaq = 0
15149 * cdef int capQ_thres = 0
15151 __pyx_v_is_cns = 1;
15153 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1504
15155 * cdef int is_cns = 1
15156 * cdef int is_nobaq = 0 # <<<<<<<<<<<<<<
15157 * cdef int capQ_thres = 0
15160 __pyx_v_is_nobaq = 0;
15162 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1505
15163 * cdef int is_cns = 1
15164 * cdef int is_nobaq = 0
15165 * cdef int capQ_thres = 0 # <<<<<<<<<<<<<<
15167 * # reload sequence
15169 __pyx_v_capQ_thres = 0;
15171 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1508
15173 * # reload sequence
15174 * if d.fastafile != NULL and b.core.tid != d.tid: # <<<<<<<<<<<<<<
15175 * if d.seq != NULL: free(d.seq)
15176 * d.tid = b.core.tid
15178 __pyx_t_1 = (__pyx_v_d->fastafile != NULL);
15180 __pyx_t_2 = (__pyx_v_b->core.tid != __pyx_v_d->tid);
15181 __pyx_t_3 = __pyx_t_2;
15183 __pyx_t_3 = __pyx_t_1;
15187 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1509
15188 * # reload sequence
15189 * if d.fastafile != NULL and b.core.tid != d.tid:
15190 * if d.seq != NULL: free(d.seq) # <<<<<<<<<<<<<<
15191 * d.tid = b.core.tid
15192 * d.seq = faidx_fetch_seq(d.fastafile,
15194 __pyx_t_3 = (__pyx_v_d->seq != NULL);
15196 free(__pyx_v_d->seq);
15201 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1510
15202 * if d.fastafile != NULL and b.core.tid != d.tid:
15203 * if d.seq != NULL: free(d.seq)
15204 * d.tid = b.core.tid # <<<<<<<<<<<<<<
15205 * d.seq = faidx_fetch_seq(d.fastafile,
15206 * d.samfile.header.target_name[d.tid],
15208 __pyx_v_d->tid = __pyx_v_b->core.tid;
15210 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1511
15211 * if d.seq != NULL: free(d.seq)
15212 * d.tid = b.core.tid
15213 * d.seq = faidx_fetch_seq(d.fastafile, # <<<<<<<<<<<<<<
15214 * d.samfile.header.target_name[d.tid],
15217 __pyx_v_d->seq = faidx_fetch_seq(__pyx_v_d->fastafile, (__pyx_v_d->samfile->header->target_name[__pyx_v_d->tid]), 0, __pyx_v_9csamtools_max_pos, (&__pyx_v_d->seq_len));
15219 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1515
15222 * if d.seq == NULL: # <<<<<<<<<<<<<<
15223 * raise ValueError( "reference sequence for '%s' (tid=%i) not found" % \
15224 * (d.samfile.header.target_name[d.tid],
15226 __pyx_t_3 = (__pyx_v_d->seq == NULL);
15229 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1517
15230 * if d.seq == NULL:
15231 * raise ValueError( "reference sequence for '%s' (tid=%i) not found" % \
15232 * (d.samfile.header.target_name[d.tid], # <<<<<<<<<<<<<<
15236 __pyx_t_4 = PyBytes_FromString((__pyx_v_d->samfile->header->target_name[__pyx_v_d->tid])); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1517; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15237 __Pyx_GOTREF(((PyObject *)__pyx_t_4));
15239 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1518
15240 * raise ValueError( "reference sequence for '%s' (tid=%i) not found" % \
15241 * (d.samfile.header.target_name[d.tid],
15242 * d.tid)) # <<<<<<<<<<<<<<
15246 __pyx_t_5 = PyInt_FromLong(__pyx_v_d->tid); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1518; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15247 __Pyx_GOTREF(__pyx_t_5);
15248 __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1517; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15249 __Pyx_GOTREF(__pyx_t_6);
15250 PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_t_4));
15251 __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
15252 PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5);
15253 __Pyx_GIVEREF(__pyx_t_5);
15256 __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_56), __pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15257 __Pyx_GOTREF(((PyObject *)__pyx_t_5));
15258 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
15259 __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15260 __Pyx_GOTREF(__pyx_t_6);
15261 PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_t_5));
15262 __Pyx_GIVEREF(((PyObject *)__pyx_t_5));
15264 __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15265 __Pyx_GOTREF(__pyx_t_5);
15266 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
15267 __Pyx_Raise(__pyx_t_5, 0, 0);
15268 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
15269 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15277 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1521
15280 * while ret >= 0: # <<<<<<<<<<<<<<
15285 __pyx_t_3 = (__pyx_v_ret >= 0);
15286 if (!__pyx_t_3) break;
15288 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1523
15291 * skip = 0 # <<<<<<<<<<<<<<
15293 * # realign read - changes base qualities
15297 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1526
15299 * # realign read - changes base qualities
15300 * if d.seq != NULL and is_cns and not is_nobaq: bam_prob_realn( b, d.seq ) # <<<<<<<<<<<<<<
15302 * if d.seq != NULL and capQ_thres > 10:
15304 __pyx_t_3 = (__pyx_v_d->seq != NULL);
15306 if (__pyx_v_is_cns) {
15307 __pyx_t_1 = (!__pyx_v_is_nobaq);
15308 __pyx_t_2 = __pyx_t_1;
15310 __pyx_t_2 = __pyx_v_is_cns;
15312 __pyx_t_1 = __pyx_t_2;
15314 __pyx_t_1 = __pyx_t_3;
15317 bam_prob_realn(__pyx_v_b, __pyx_v_d->seq);
15322 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1528
15323 * if d.seq != NULL and is_cns and not is_nobaq: bam_prob_realn( b, d.seq )
15325 * if d.seq != NULL and capQ_thres > 10: # <<<<<<<<<<<<<<
15326 * q = bam_cap_mapQ(b, d.seq, capQ_thres)
15327 * if q < 0: skip = 1
15329 __pyx_t_1 = (__pyx_v_d->seq != NULL);
15331 __pyx_t_3 = (__pyx_v_capQ_thres > 10);
15332 __pyx_t_2 = __pyx_t_3;
15334 __pyx_t_2 = __pyx_t_1;
15338 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1529
15340 * if d.seq != NULL and capQ_thres > 10:
15341 * q = bam_cap_mapQ(b, d.seq, capQ_thres) # <<<<<<<<<<<<<<
15342 * if q < 0: skip = 1
15343 * elif b.core.qual > q: b.core.qual = q
15345 __pyx_v_q = bam_cap_mapQ(__pyx_v_b, __pyx_v_d->seq, __pyx_v_capQ_thres);
15347 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1530
15348 * if d.seq != NULL and capQ_thres > 10:
15349 * q = bam_cap_mapQ(b, d.seq, capQ_thres)
15350 * if q < 0: skip = 1 # <<<<<<<<<<<<<<
15351 * elif b.core.qual > q: b.core.qual = q
15352 * if b.core.flag & BAM_FUNMAP: skip = 1
15354 __pyx_t_2 = (__pyx_v_q < 0);
15360 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1531
15361 * q = bam_cap_mapQ(b, d.seq, capQ_thres)
15362 * if q < 0: skip = 1
15363 * elif b.core.qual > q: b.core.qual = q # <<<<<<<<<<<<<<
15364 * if b.core.flag & BAM_FUNMAP: skip = 1
15365 * elif b.core.flag & 1 and not b.core.flag & 2: skip = 1
15367 __pyx_t_2 = (__pyx_v_b->core.qual > __pyx_v_q);
15369 __pyx_v_b->core.qual = __pyx_v_q;
15377 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1532
15378 * if q < 0: skip = 1
15379 * elif b.core.qual > q: b.core.qual = q
15380 * if b.core.flag & BAM_FUNMAP: skip = 1 # <<<<<<<<<<<<<<
15381 * elif b.core.flag & 1 and not b.core.flag & 2: skip = 1
15384 __pyx_t_7 = (__pyx_v_b->core.flag & 4);
15390 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1533
15391 * elif b.core.qual > q: b.core.qual = q
15392 * if b.core.flag & BAM_FUNMAP: skip = 1
15393 * elif b.core.flag & 1 and not b.core.flag & 2: skip = 1 # <<<<<<<<<<<<<<
15395 * if not skip: break
15397 if ((__pyx_v_b->core.flag & 1)) {
15398 __pyx_t_2 = (!(__pyx_v_b->core.flag & 2));
15399 __pyx_t_1 = __pyx_t_2;
15401 __pyx_t_1 = (__pyx_v_b->core.flag & 1);
15409 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1535
15410 * elif b.core.flag & 1 and not b.core.flag & 2: skip = 1
15412 * if not skip: break # <<<<<<<<<<<<<<
15413 * # additional filters
15416 __pyx_t_1 = (!__pyx_v_skip);
15418 goto __pyx_L7_break;
15423 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1538
15424 * # additional filters
15426 * ret = bam_iter_read( d.samfile.x.bam, d.iter, b ) # <<<<<<<<<<<<<<
15430 __pyx_v_ret = bam_iter_read(__pyx_v_d->samfile->x.bam, __pyx_v_d->iter, __pyx_v_b);
15434 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1540
15435 * ret = bam_iter_read( d.samfile.x.bam, d.iter, b )
15437 * return ret # <<<<<<<<<<<<<<
15439 * cdef class IteratorColumn:
15441 __pyx_r = __pyx_v_ret;
15447 __Pyx_XDECREF(__pyx_t_4);
15448 __Pyx_XDECREF(__pyx_t_5);
15449 __Pyx_XDECREF(__pyx_t_6);
15450 __Pyx_WriteUnraisable("csamtools.__advance_snpcalls");
15453 __Pyx_TraceReturn(Py_None);
15454 __Pyx_RefNannyFinishContext();
15458 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1599
15461 * def __cinit__( self, Samfile samfile, **kwargs ): # <<<<<<<<<<<<<<
15462 * self.samfile = samfile
15463 * self.mask = kwargs.get("mask", BAM_DEF_MASK )
15466 static int __pyx_pf_9csamtools_14IteratorColumn___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
15467 static int __pyx_pf_9csamtools_14IteratorColumn___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
15468 struct __pyx_obj_9csamtools_Samfile *__pyx_v_samfile = 0;
15469 PyObject *__pyx_v_kwargs = 0;
15471 PyObject *__pyx_t_1 = NULL;
15472 PyObject *__pyx_t_2 = NULL;
15474 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__samfile,0};
15475 __Pyx_TraceDeclarations
15476 __Pyx_RefNannySetupContext("__cinit__");
15477 __Pyx_TraceCall("__cinit__", __pyx_f[0], 1599);
15478 __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return -1;
15479 __Pyx_GOTREF(__pyx_v_kwargs);
15480 if (unlikely(__pyx_kwds)) {
15481 Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
15482 PyObject* values[1] = {0};
15483 switch (PyTuple_GET_SIZE(__pyx_args)) {
15484 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
15486 default: goto __pyx_L5_argtuple_error;
15488 switch (PyTuple_GET_SIZE(__pyx_args)) {
15490 values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__samfile);
15491 if (likely(values[0])) kw_args--;
15492 else goto __pyx_L5_argtuple_error;
15494 if (unlikely(kw_args > 0)) {
15495 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, PyTuple_GET_SIZE(__pyx_args), "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1599; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
15497 __pyx_v_samfile = ((struct __pyx_obj_9csamtools_Samfile *)values[0]);
15498 } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
15499 goto __pyx_L5_argtuple_error;
15501 __pyx_v_samfile = ((struct __pyx_obj_9csamtools_Samfile *)PyTuple_GET_ITEM(__pyx_args, 0));
15503 goto __pyx_L4_argument_unpacking_done;
15504 __pyx_L5_argtuple_error:;
15505 __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1599; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
15507 __Pyx_DECREF(__pyx_v_kwargs);
15508 __Pyx_AddTraceback("csamtools.IteratorColumn.__cinit__");
15509 __Pyx_RefNannyFinishContext();
15511 __pyx_L4_argument_unpacking_done:;
15512 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_samfile), __pyx_ptype_9csamtools_Samfile, 1, "samfile", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1599; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15514 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1600
15516 * def __cinit__( self, Samfile samfile, **kwargs ):
15517 * self.samfile = samfile # <<<<<<<<<<<<<<
15518 * self.mask = kwargs.get("mask", BAM_DEF_MASK )
15519 * self.fastafile = kwargs.get( "fastafile", None )
15521 __Pyx_INCREF(((PyObject *)__pyx_v_samfile));
15522 __Pyx_GIVEREF(((PyObject *)__pyx_v_samfile));
15523 __Pyx_GOTREF(((struct __pyx_obj_9csamtools_IteratorColumn *)__pyx_v_self)->samfile);
15524 __Pyx_DECREF(((PyObject *)((struct __pyx_obj_9csamtools_IteratorColumn *)__pyx_v_self)->samfile));
15525 ((struct __pyx_obj_9csamtools_IteratorColumn *)__pyx_v_self)->samfile = __pyx_v_samfile;
15527 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1601
15528 * def __cinit__( self, Samfile samfile, **kwargs ):
15529 * self.samfile = samfile
15530 * self.mask = kwargs.get("mask", BAM_DEF_MASK ) # <<<<<<<<<<<<<<
15531 * self.fastafile = kwargs.get( "fastafile", None )
15532 * self.stepper = kwargs.get( "stepper", None )
15534 if (unlikely(__pyx_v_kwargs == Py_None)) {
15535 PyErr_SetString(PyExc_AttributeError, "'NoneType' object has no attribute 'get'"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1601; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15537 __pyx_t_1 = PyInt_FromLong(BAM_DEF_MASK); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1601; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15538 __Pyx_GOTREF(__pyx_t_1);
15539 __pyx_t_2 = __Pyx_PyDict_GetItemDefault(((PyObject *)__pyx_v_kwargs), ((PyObject *)__pyx_n_s__mask), __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1601; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15540 __Pyx_GOTREF(__pyx_t_2);
15541 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15542 __pyx_t_3 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1601; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15543 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15544 ((struct __pyx_obj_9csamtools_IteratorColumn *)__pyx_v_self)->mask = __pyx_t_3;
15546 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1602
15547 * self.samfile = samfile
15548 * self.mask = kwargs.get("mask", BAM_DEF_MASK )
15549 * self.fastafile = kwargs.get( "fastafile", None ) # <<<<<<<<<<<<<<
15550 * self.stepper = kwargs.get( "stepper", None )
15551 * self.iterdata.seq = NULL
15553 if (unlikely(__pyx_v_kwargs == Py_None)) {
15554 PyErr_SetString(PyExc_AttributeError, "'NoneType' object has no attribute 'get'"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1602; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15556 __pyx_t_2 = __Pyx_PyDict_GetItemDefault(((PyObject *)__pyx_v_kwargs), ((PyObject *)__pyx_n_s__fastafile), Py_None); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1602; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15557 __Pyx_GOTREF(__pyx_t_2);
15558 if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_9csamtools_Fastafile))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1602; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15559 __Pyx_GIVEREF(__pyx_t_2);
15560 __Pyx_GOTREF(((struct __pyx_obj_9csamtools_IteratorColumn *)__pyx_v_self)->fastafile);
15561 __Pyx_DECREF(((PyObject *)((struct __pyx_obj_9csamtools_IteratorColumn *)__pyx_v_self)->fastafile));
15562 ((struct __pyx_obj_9csamtools_IteratorColumn *)__pyx_v_self)->fastafile = ((struct __pyx_obj_9csamtools_Fastafile *)__pyx_t_2);
15565 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1603
15566 * self.mask = kwargs.get("mask", BAM_DEF_MASK )
15567 * self.fastafile = kwargs.get( "fastafile", None )
15568 * self.stepper = kwargs.get( "stepper", None ) # <<<<<<<<<<<<<<
15569 * self.iterdata.seq = NULL
15572 if (unlikely(__pyx_v_kwargs == Py_None)) {
15573 PyErr_SetString(PyExc_AttributeError, "'NoneType' object has no attribute 'get'"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1603; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15575 __pyx_t_2 = __Pyx_PyDict_GetItemDefault(((PyObject *)__pyx_v_kwargs), ((PyObject *)__pyx_n_s__stepper), Py_None); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1603; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15576 __Pyx_GOTREF(__pyx_t_2);
15577 __Pyx_GIVEREF(__pyx_t_2);
15578 __Pyx_GOTREF(((struct __pyx_obj_9csamtools_IteratorColumn *)__pyx_v_self)->stepper);
15579 __Pyx_DECREF(((struct __pyx_obj_9csamtools_IteratorColumn *)__pyx_v_self)->stepper);
15580 ((struct __pyx_obj_9csamtools_IteratorColumn *)__pyx_v_self)->stepper = __pyx_t_2;
15583 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1604
15584 * self.fastafile = kwargs.get( "fastafile", None )
15585 * self.stepper = kwargs.get( "stepper", None )
15586 * self.iterdata.seq = NULL # <<<<<<<<<<<<<<
15590 ((struct __pyx_obj_9csamtools_IteratorColumn *)__pyx_v_self)->iterdata.seq = NULL;
15592 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1605
15593 * self.stepper = kwargs.get( "stepper", None )
15594 * self.iterdata.seq = NULL
15595 * self.tid = 0 # <<<<<<<<<<<<<<
15599 ((struct __pyx_obj_9csamtools_IteratorColumn *)__pyx_v_self)->tid = 0;
15601 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1606
15602 * self.iterdata.seq = NULL
15604 * self.pos = 0 # <<<<<<<<<<<<<<
15608 ((struct __pyx_obj_9csamtools_IteratorColumn *)__pyx_v_self)->pos = 0;
15610 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1607
15613 * self.n_plp = 0 # <<<<<<<<<<<<<<
15615 * self.pileup_iter = <bam_plp_t>NULL
15617 ((struct __pyx_obj_9csamtools_IteratorColumn *)__pyx_v_self)->n_plp = 0;
15619 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1608
15622 * self.plp = NULL # <<<<<<<<<<<<<<
15623 * self.pileup_iter = <bam_plp_t>NULL
15626 ((struct __pyx_obj_9csamtools_IteratorColumn *)__pyx_v_self)->plp = NULL;
15628 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1609
15631 * self.pileup_iter = <bam_plp_t>NULL # <<<<<<<<<<<<<<
15633 * def __iter__(self):
15635 ((struct __pyx_obj_9csamtools_IteratorColumn *)__pyx_v_self)->pileup_iter = ((bam_plp_t)NULL);
15640 __Pyx_XDECREF(__pyx_t_1);
15641 __Pyx_XDECREF(__pyx_t_2);
15642 __Pyx_AddTraceback("csamtools.IteratorColumn.__cinit__");
15645 __Pyx_DECREF(__pyx_v_kwargs);
15646 __Pyx_TraceReturn(Py_None);
15647 __Pyx_RefNannyFinishContext();
15651 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1611
15652 * self.pileup_iter = <bam_plp_t>NULL
15654 * def __iter__(self): # <<<<<<<<<<<<<<
15659 static PyObject *__pyx_pf_9csamtools_14IteratorColumn___iter__(PyObject *__pyx_v_self); /*proto*/
15660 static PyObject *__pyx_pf_9csamtools_14IteratorColumn___iter__(PyObject *__pyx_v_self) {
15661 PyObject *__pyx_r = NULL;
15662 __Pyx_TraceDeclarations
15663 __Pyx_RefNannySetupContext("__iter__");
15664 __Pyx_TraceCall("__iter__", __pyx_f[0], 1611);
15666 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1612
15668 * def __iter__(self):
15669 * return self # <<<<<<<<<<<<<<
15671 * cdef int cnext(self):
15673 __Pyx_XDECREF(__pyx_r);
15674 __Pyx_INCREF(__pyx_v_self);
15675 __pyx_r = __pyx_v_self;
15678 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
15680 __Pyx_XGIVEREF(__pyx_r);
15681 __Pyx_TraceReturn(__pyx_r);
15682 __Pyx_RefNannyFinishContext();
15686 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1614
15689 * cdef int cnext(self): # <<<<<<<<<<<<<<
15690 * '''perform next iteration.
15694 static int __pyx_f_9csamtools_14IteratorColumn_cnext(struct __pyx_obj_9csamtools_IteratorColumn *__pyx_v_self) {
15696 __Pyx_TraceDeclarations
15697 __Pyx_RefNannySetupContext("cnext");
15698 __Pyx_TraceCall("cnext", __pyx_f[0], 1614);
15700 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1620
15701 * It has been re-implemented to permit for filtering.
15703 * self.plp = bam_plp_auto( self.pileup_iter, # <<<<<<<<<<<<<<
15707 __pyx_v_self->plp = bam_plp_auto(__pyx_v_self->pileup_iter, (&__pyx_v_self->tid), (&__pyx_v_self->pos), (&__pyx_v_self->n_plp));
15710 __Pyx_TraceReturn(Py_None);
15711 __Pyx_RefNannyFinishContext();
15715 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1625
15718 * cdef char * getSequence( self ): # <<<<<<<<<<<<<<
15719 * '''return current reference sequence underlying the iterator.
15723 static char *__pyx_f_9csamtools_14IteratorColumn_getSequence(struct __pyx_obj_9csamtools_IteratorColumn *__pyx_v_self) {
15725 __Pyx_TraceDeclarations
15726 __Pyx_RefNannySetupContext("getSequence");
15727 __Pyx_TraceCall("getSequence", __pyx_f[0], 1625);
15729 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1628
15730 * '''return current reference sequence underlying the iterator.
15732 * return self.iterdata.seq # <<<<<<<<<<<<<<
15734 * property seq_len:
15736 __pyx_r = __pyx_v_self->iterdata.seq;
15741 __Pyx_TraceReturn(Py_None);
15742 __Pyx_RefNannyFinishContext();
15746 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1632
15747 * property seq_len:
15748 * '''current sequence length.'''
15749 * def __get__(self): return self.iterdata.seq_len # <<<<<<<<<<<<<<
15751 * def addReference( self, Fastafile fastafile ):
15754 static PyObject *__pyx_pf_9csamtools_14IteratorColumn_7seq_len___get__(PyObject *__pyx_v_self); /*proto*/
15755 static PyObject *__pyx_pf_9csamtools_14IteratorColumn_7seq_len___get__(PyObject *__pyx_v_self) {
15756 PyObject *__pyx_r = NULL;
15757 PyObject *__pyx_t_1 = NULL;
15758 __Pyx_TraceDeclarations
15759 __Pyx_RefNannySetupContext("__get__");
15760 __Pyx_TraceCall("__get__", __pyx_f[0], 1632);
15761 __Pyx_XDECREF(__pyx_r);
15762 __pyx_t_1 = PyInt_FromLong(((struct __pyx_obj_9csamtools_IteratorColumn *)__pyx_v_self)->iterdata.seq_len); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1632; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15763 __Pyx_GOTREF(__pyx_t_1);
15764 __pyx_r = __pyx_t_1;
15768 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
15771 __Pyx_XDECREF(__pyx_t_1);
15772 __Pyx_AddTraceback("csamtools.IteratorColumn.seq_len.__get__");
15775 __Pyx_XGIVEREF(__pyx_r);
15776 __Pyx_TraceReturn(__pyx_r);
15777 __Pyx_RefNannyFinishContext();
15781 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1634
15782 * def __get__(self): return self.iterdata.seq_len
15784 * def addReference( self, Fastafile fastafile ): # <<<<<<<<<<<<<<
15786 * add reference sequences in *fastafile* to iterator.'''
15789 static PyObject *__pyx_pf_9csamtools_14IteratorColumn_addReference(PyObject *__pyx_v_self, PyObject *__pyx_v_fastafile); /*proto*/
15790 static char __pyx_doc_9csamtools_14IteratorColumn_addReference[] = "IteratorColumn.addReference(self, Fastafile fastafile)\n\n add reference sequences in *fastafile* to iterator.";
15791 static PyObject *__pyx_pf_9csamtools_14IteratorColumn_addReference(PyObject *__pyx_v_self, PyObject *__pyx_v_fastafile) {
15792 PyObject *__pyx_r = NULL;
15794 __Pyx_TraceDeclarations
15795 __Pyx_RefNannySetupContext("addReference");
15796 __Pyx_TraceCall("addReference", __pyx_f[0], 1634);
15797 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_fastafile), __pyx_ptype_9csamtools_Fastafile, 1, "fastafile", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1634; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15799 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1637
15801 * add reference sequences in *fastafile* to iterator.'''
15802 * self.fastafile = fastafile # <<<<<<<<<<<<<<
15803 * if self.iterdata.seq != NULL: free(self.iterdata.seq)
15804 * self.iterdata.tid = -1
15806 __Pyx_INCREF(__pyx_v_fastafile);
15807 __Pyx_GIVEREF(__pyx_v_fastafile);
15808 __Pyx_GOTREF(((struct __pyx_obj_9csamtools_IteratorColumn *)__pyx_v_self)->fastafile);
15809 __Pyx_DECREF(((PyObject *)((struct __pyx_obj_9csamtools_IteratorColumn *)__pyx_v_self)->fastafile));
15810 ((struct __pyx_obj_9csamtools_IteratorColumn *)__pyx_v_self)->fastafile = ((struct __pyx_obj_9csamtools_Fastafile *)__pyx_v_fastafile);
15812 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1638
15813 * add reference sequences in *fastafile* to iterator.'''
15814 * self.fastafile = fastafile
15815 * if self.iterdata.seq != NULL: free(self.iterdata.seq) # <<<<<<<<<<<<<<
15816 * self.iterdata.tid = -1
15817 * self.iterdata.fastafile = self.fastafile.fastafile
15819 __pyx_t_1 = (((struct __pyx_obj_9csamtools_IteratorColumn *)__pyx_v_self)->iterdata.seq != NULL);
15821 free(((struct __pyx_obj_9csamtools_IteratorColumn *)__pyx_v_self)->iterdata.seq);
15826 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1639
15827 * self.fastafile = fastafile
15828 * if self.iterdata.seq != NULL: free(self.iterdata.seq)
15829 * self.iterdata.tid = -1 # <<<<<<<<<<<<<<
15830 * self.iterdata.fastafile = self.fastafile.fastafile
15833 ((struct __pyx_obj_9csamtools_IteratorColumn *)__pyx_v_self)->iterdata.tid = -1;
15835 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1640
15836 * if self.iterdata.seq != NULL: free(self.iterdata.seq)
15837 * self.iterdata.tid = -1
15838 * self.iterdata.fastafile = self.fastafile.fastafile # <<<<<<<<<<<<<<
15840 * def hasReference( self ):
15842 ((struct __pyx_obj_9csamtools_IteratorColumn *)__pyx_v_self)->iterdata.fastafile = ((struct __pyx_obj_9csamtools_IteratorColumn *)__pyx_v_self)->fastafile->fastafile;
15844 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
15847 __Pyx_AddTraceback("csamtools.IteratorColumn.addReference");
15850 __Pyx_XGIVEREF(__pyx_r);
15851 __Pyx_TraceReturn(__pyx_r);
15852 __Pyx_RefNannyFinishContext();
15856 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1642
15857 * self.iterdata.fastafile = self.fastafile.fastafile
15859 * def hasReference( self ): # <<<<<<<<<<<<<<
15861 * return true if iterator is associated with a reference'''
15864 static PyObject *__pyx_pf_9csamtools_14IteratorColumn_hasReference(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
15865 static char __pyx_doc_9csamtools_14IteratorColumn_hasReference[] = "IteratorColumn.hasReference(self)\n\n return true if iterator is associated with a reference";
15866 static PyObject *__pyx_pf_9csamtools_14IteratorColumn_hasReference(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
15867 PyObject *__pyx_r = NULL;
15868 __Pyx_TraceDeclarations
15869 __Pyx_RefNannySetupContext("hasReference");
15870 __Pyx_TraceCall("hasReference", __pyx_f[0], 1642);
15872 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1645
15874 * return true if iterator is associated with a reference'''
15875 * return self.fastafile # <<<<<<<<<<<<<<
15877 * cdef setMask( self, mask ):
15879 __Pyx_XDECREF(__pyx_r);
15880 __Pyx_INCREF(((PyObject *)((struct __pyx_obj_9csamtools_IteratorColumn *)__pyx_v_self)->fastafile));
15881 __pyx_r = ((PyObject *)((struct __pyx_obj_9csamtools_IteratorColumn *)__pyx_v_self)->fastafile);
15884 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
15886 __Pyx_XGIVEREF(__pyx_r);
15887 __Pyx_TraceReturn(__pyx_r);
15888 __Pyx_RefNannyFinishContext();
15892 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1647
15893 * return self.fastafile
15895 * cdef setMask( self, mask ): # <<<<<<<<<<<<<<
15896 * '''set masking flag in iterator.
15900 static PyObject *__pyx_f_9csamtools_14IteratorColumn_setMask(struct __pyx_obj_9csamtools_IteratorColumn *__pyx_v_self, PyObject *__pyx_v_mask) {
15901 PyObject *__pyx_r = NULL;
15903 __Pyx_TraceDeclarations
15904 __Pyx_RefNannySetupContext("setMask");
15905 __Pyx_TraceCall("setMask", __pyx_f[0], 1647);
15907 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1652
15908 * reads with bits set in *mask* will be skipped.
15910 * self.mask = mask # <<<<<<<<<<<<<<
15911 * bam_plp_set_mask( self.pileup_iter, self.mask )
15914 __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_mask); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15915 __pyx_v_self->mask = __pyx_t_1;
15917 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1653
15920 * bam_plp_set_mask( self.pileup_iter, self.mask ) # <<<<<<<<<<<<<<
15922 * cdef setupIteratorData( self,
15924 bam_plp_set_mask(__pyx_v_self->pileup_iter, __pyx_v_self->mask);
15926 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
15929 __Pyx_AddTraceback("csamtools.IteratorColumn.setMask");
15932 __Pyx_XGIVEREF(__pyx_r);
15933 __Pyx_TraceReturn(__pyx_r);
15934 __Pyx_RefNannyFinishContext();
15938 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1655
15939 * bam_plp_set_mask( self.pileup_iter, self.mask )
15941 * cdef setupIteratorData( self, # <<<<<<<<<<<<<<
15946 static PyObject *__pyx_f_9csamtools_14IteratorColumn_setupIteratorData(struct __pyx_obj_9csamtools_IteratorColumn *__pyx_v_self, int __pyx_v_tid, int __pyx_v_start, int __pyx_v_end, struct __pyx_opt_args_9csamtools_14IteratorColumn_setupIteratorData *__pyx_optional_args) {
15947 int __pyx_v_reopen = ((int)0);
15948 PyObject *__pyx_r = NULL;
15949 PyObject *__pyx_t_1 = NULL;
15950 PyObject *__pyx_t_2 = NULL;
15951 PyObject *__pyx_t_3 = NULL;
15952 PyObject *__pyx_t_4 = NULL;
15953 PyObject *__pyx_t_5 = NULL;
15957 __Pyx_TraceDeclarations
15958 __Pyx_RefNannySetupContext("setupIteratorData");
15959 __Pyx_TraceCall("setupIteratorData", __pyx_f[0], 1655);
15960 if (__pyx_optional_args) {
15961 if (__pyx_optional_args->__pyx_n > 0) {
15962 __pyx_v_reopen = __pyx_optional_args->reopen;
15966 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1662
15967 * '''setup the iterator structure'''
15969 * self.iter = IteratorRowRegion( self.samfile, tid, start, end, reopen ) # <<<<<<<<<<<<<<
15970 * self.iterdata.samfile = self.samfile.samfile
15971 * self.iterdata.iter = self.iter.iter
15973 __pyx_t_1 = PyInt_FromLong(__pyx_v_tid); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1662; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15974 __Pyx_GOTREF(__pyx_t_1);
15975 __pyx_t_2 = PyInt_FromLong(__pyx_v_start); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1662; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15976 __Pyx_GOTREF(__pyx_t_2);
15977 __pyx_t_3 = PyInt_FromLong(__pyx_v_end); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1662; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15978 __Pyx_GOTREF(__pyx_t_3);
15979 __pyx_t_4 = PyInt_FromLong(__pyx_v_reopen); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1662; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15980 __Pyx_GOTREF(__pyx_t_4);
15981 __pyx_t_5 = PyTuple_New(5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1662; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15982 __Pyx_GOTREF(__pyx_t_5);
15983 __Pyx_INCREF(((PyObject *)__pyx_v_self->samfile));
15984 PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_self->samfile));
15985 __Pyx_GIVEREF(((PyObject *)__pyx_v_self->samfile));
15986 PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
15987 __Pyx_GIVEREF(__pyx_t_1);
15988 PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_2);
15989 __Pyx_GIVEREF(__pyx_t_2);
15990 PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_3);
15991 __Pyx_GIVEREF(__pyx_t_3);
15992 PyTuple_SET_ITEM(__pyx_t_5, 4, __pyx_t_4);
15993 __Pyx_GIVEREF(__pyx_t_4);
15998 __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_9csamtools_IteratorRowRegion)), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1662; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15999 __Pyx_GOTREF(__pyx_t_4);
16000 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
16001 __Pyx_GIVEREF(__pyx_t_4);
16002 __Pyx_GOTREF(__pyx_v_self->iter);
16003 __Pyx_DECREF(((PyObject *)__pyx_v_self->iter));
16004 __pyx_v_self->iter = ((struct __pyx_obj_9csamtools_IteratorRowRegion *)__pyx_t_4);
16007 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1663
16009 * self.iter = IteratorRowRegion( self.samfile, tid, start, end, reopen )
16010 * self.iterdata.samfile = self.samfile.samfile # <<<<<<<<<<<<<<
16011 * self.iterdata.iter = self.iter.iter
16012 * self.iterdata.seq = NULL
16014 __pyx_v_self->iterdata.samfile = __pyx_v_self->samfile->samfile;
16016 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1664
16017 * self.iter = IteratorRowRegion( self.samfile, tid, start, end, reopen )
16018 * self.iterdata.samfile = self.samfile.samfile
16019 * self.iterdata.iter = self.iter.iter # <<<<<<<<<<<<<<
16020 * self.iterdata.seq = NULL
16021 * self.iterdata.tid = -1
16023 __pyx_v_self->iterdata.iter = __pyx_v_self->iter->iter;
16025 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1665
16026 * self.iterdata.samfile = self.samfile.samfile
16027 * self.iterdata.iter = self.iter.iter
16028 * self.iterdata.seq = NULL # <<<<<<<<<<<<<<
16029 * self.iterdata.tid = -1
16032 __pyx_v_self->iterdata.seq = NULL;
16034 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1666
16035 * self.iterdata.iter = self.iter.iter
16036 * self.iterdata.seq = NULL
16037 * self.iterdata.tid = -1 # <<<<<<<<<<<<<<
16039 * if self.fastafile != None:
16041 __pyx_v_self->iterdata.tid = -1;
16043 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1668
16044 * self.iterdata.tid = -1
16046 * if self.fastafile != None: # <<<<<<<<<<<<<<
16047 * self.iterdata.fastafile = self.fastafile.fastafile
16050 __pyx_t_4 = PyObject_RichCompare(((PyObject *)__pyx_v_self->fastafile), Py_None, Py_NE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1668; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16051 __Pyx_GOTREF(__pyx_t_4);
16052 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1668; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16053 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
16056 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1669
16058 * if self.fastafile != None:
16059 * self.iterdata.fastafile = self.fastafile.fastafile # <<<<<<<<<<<<<<
16061 * self.iterdata.fastafile = NULL
16063 __pyx_v_self->iterdata.fastafile = __pyx_v_self->fastafile->fastafile;
16068 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1671
16069 * self.iterdata.fastafile = self.fastafile.fastafile
16071 * self.iterdata.fastafile = NULL # <<<<<<<<<<<<<<
16073 * if self.stepper == None or self.stepper == "all":
16075 __pyx_v_self->iterdata.fastafile = NULL;
16079 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1673
16080 * self.iterdata.fastafile = NULL
16082 * if self.stepper == None or self.stepper == "all": # <<<<<<<<<<<<<<
16083 * self.pileup_iter = bam_plp_init( &__advance_all, &self.iterdata )
16084 * elif self.stepper == "samtools":
16086 __pyx_t_4 = PyObject_RichCompare(__pyx_v_self->stepper, Py_None, Py_EQ); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1673; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16087 __Pyx_GOTREF(__pyx_t_4);
16088 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1673; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16089 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
16091 __pyx_t_4 = PyObject_RichCompare(__pyx_v_self->stepper, ((PyObject *)__pyx_n_s__all), Py_EQ); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1673; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16092 __Pyx_GOTREF(__pyx_t_4);
16093 __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1673; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16094 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
16095 __pyx_t_8 = __pyx_t_7;
16097 __pyx_t_8 = __pyx_t_6;
16101 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1674
16103 * if self.stepper == None or self.stepper == "all":
16104 * self.pileup_iter = bam_plp_init( &__advance_all, &self.iterdata ) # <<<<<<<<<<<<<<
16105 * elif self.stepper == "samtools":
16106 * self.pileup_iter = bam_plp_init( &__advance_snpcalls, &self.iterdata )
16108 __pyx_v_self->pileup_iter = bam_plp_init((&__pyx_f_9csamtools___advance_all), (&__pyx_v_self->iterdata));
16112 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1675
16113 * if self.stepper == None or self.stepper == "all":
16114 * self.pileup_iter = bam_plp_init( &__advance_all, &self.iterdata )
16115 * elif self.stepper == "samtools": # <<<<<<<<<<<<<<
16116 * self.pileup_iter = bam_plp_init( &__advance_snpcalls, &self.iterdata )
16119 __pyx_t_4 = PyObject_RichCompare(__pyx_v_self->stepper, ((PyObject *)__pyx_n_s__samtools), Py_EQ); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1675; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16120 __Pyx_GOTREF(__pyx_t_4);
16121 __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1675; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16122 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
16125 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1676
16126 * self.pileup_iter = bam_plp_init( &__advance_all, &self.iterdata )
16127 * elif self.stepper == "samtools":
16128 * self.pileup_iter = bam_plp_init( &__advance_snpcalls, &self.iterdata ) # <<<<<<<<<<<<<<
16130 * raise ValueError( "unknown stepper option `%s` in IteratorColumn" % self.stepper)
16132 __pyx_v_self->pileup_iter = bam_plp_init((&__pyx_f_9csamtools___advance_snpcalls), (&__pyx_v_self->iterdata));
16137 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1678
16138 * self.pileup_iter = bam_plp_init( &__advance_snpcalls, &self.iterdata )
16140 * raise ValueError( "unknown stepper option `%s` in IteratorColumn" % self.stepper) # <<<<<<<<<<<<<<
16142 * bam_plp_set_mask( self.pileup_iter, self.mask )
16144 __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_57), __pyx_v_self->stepper); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1678; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16145 __Pyx_GOTREF(((PyObject *)__pyx_t_4));
16146 __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1678; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16147 __Pyx_GOTREF(__pyx_t_5);
16148 PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_4));
16149 __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
16151 __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1678; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16152 __Pyx_GOTREF(__pyx_t_4);
16153 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
16154 __Pyx_Raise(__pyx_t_4, 0, 0);
16155 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
16156 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1678; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16160 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1680
16161 * raise ValueError( "unknown stepper option `%s` in IteratorColumn" % self.stepper)
16163 * bam_plp_set_mask( self.pileup_iter, self.mask ) # <<<<<<<<<<<<<<
16165 * cdef reset( self, tid, start, end ):
16167 bam_plp_set_mask(__pyx_v_self->pileup_iter, __pyx_v_self->mask);
16169 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
16172 __Pyx_XDECREF(__pyx_t_1);
16173 __Pyx_XDECREF(__pyx_t_2);
16174 __Pyx_XDECREF(__pyx_t_3);
16175 __Pyx_XDECREF(__pyx_t_4);
16176 __Pyx_XDECREF(__pyx_t_5);
16177 __Pyx_AddTraceback("csamtools.IteratorColumn.setupIteratorData");
16180 __Pyx_XGIVEREF(__pyx_r);
16181 __Pyx_TraceReturn(__pyx_r);
16182 __Pyx_RefNannyFinishContext();
16186 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1682
16187 * bam_plp_set_mask( self.pileup_iter, self.mask )
16189 * cdef reset( self, tid, start, end ): # <<<<<<<<<<<<<<
16190 * '''reset iterator position.
16194 static PyObject *__pyx_f_9csamtools_14IteratorColumn_reset(struct __pyx_obj_9csamtools_IteratorColumn *__pyx_v_self, PyObject *__pyx_v_tid, PyObject *__pyx_v_start, PyObject *__pyx_v_end) {
16195 PyObject *__pyx_r = NULL;
16196 PyObject *__pyx_t_1 = NULL;
16197 PyObject *__pyx_t_2 = NULL;
16198 PyObject *__pyx_t_3 = NULL;
16200 __Pyx_TraceDeclarations
16201 __Pyx_RefNannySetupContext("reset");
16202 __Pyx_TraceCall("reset", __pyx_f[0], 1682);
16204 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1688
16205 * having to incur the full set-up costs.
16207 * self.iter = IteratorRowRegion( self.samfile, tid, start, end, reopen = 0 ) # <<<<<<<<<<<<<<
16208 * self.iterdata.iter = self.iter.iter
16211 __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1688; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16212 __Pyx_GOTREF(__pyx_t_1);
16213 __Pyx_INCREF(((PyObject *)__pyx_v_self->samfile));
16214 PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self->samfile));
16215 __Pyx_GIVEREF(((PyObject *)__pyx_v_self->samfile));
16216 __Pyx_INCREF(__pyx_v_tid);
16217 PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_tid);
16218 __Pyx_GIVEREF(__pyx_v_tid);
16219 __Pyx_INCREF(__pyx_v_start);
16220 PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_start);
16221 __Pyx_GIVEREF(__pyx_v_start);
16222 __Pyx_INCREF(__pyx_v_end);
16223 PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_v_end);
16224 __Pyx_GIVEREF(__pyx_v_end);
16225 __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1688; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16226 __Pyx_GOTREF(((PyObject *)__pyx_t_2));
16227 if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__reopen), __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1688; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16228 __pyx_t_3 = PyEval_CallObjectWithKeywords(((PyObject *)((PyObject*)__pyx_ptype_9csamtools_IteratorRowRegion)), __pyx_t_1, ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1688; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16229 __Pyx_GOTREF(__pyx_t_3);
16230 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16231 __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
16232 __Pyx_GIVEREF(__pyx_t_3);
16233 __Pyx_GOTREF(__pyx_v_self->iter);
16234 __Pyx_DECREF(((PyObject *)__pyx_v_self->iter));
16235 __pyx_v_self->iter = ((struct __pyx_obj_9csamtools_IteratorRowRegion *)__pyx_t_3);
16238 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1689
16240 * self.iter = IteratorRowRegion( self.samfile, tid, start, end, reopen = 0 )
16241 * self.iterdata.iter = self.iter.iter # <<<<<<<<<<<<<<
16243 * # invalidate sequence if different tid
16245 __pyx_v_self->iterdata.iter = __pyx_v_self->iter->iter;
16247 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1692
16249 * # invalidate sequence if different tid
16250 * if self.tid != tid: # <<<<<<<<<<<<<<
16251 * if self.iterdata.seq != NULL: free( self.iterdata.seq )
16252 * self.iterdata.seq = NULL
16254 __pyx_t_3 = PyInt_FromLong(__pyx_v_self->tid); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1692; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16255 __Pyx_GOTREF(__pyx_t_3);
16256 __pyx_t_2 = PyObject_RichCompare(__pyx_t_3, __pyx_v_tid, Py_NE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1692; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16257 __Pyx_GOTREF(__pyx_t_2);
16258 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16259 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1692; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16260 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
16263 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1693
16264 * # invalidate sequence if different tid
16265 * if self.tid != tid:
16266 * if self.iterdata.seq != NULL: free( self.iterdata.seq ) # <<<<<<<<<<<<<<
16267 * self.iterdata.seq = NULL
16268 * self.iterdata.tid = -1
16270 __pyx_t_4 = (__pyx_v_self->iterdata.seq != NULL);
16272 free(__pyx_v_self->iterdata.seq);
16277 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1694
16278 * if self.tid != tid:
16279 * if self.iterdata.seq != NULL: free( self.iterdata.seq )
16280 * self.iterdata.seq = NULL # <<<<<<<<<<<<<<
16281 * self.iterdata.tid = -1
16284 __pyx_v_self->iterdata.seq = NULL;
16286 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1695
16287 * if self.iterdata.seq != NULL: free( self.iterdata.seq )
16288 * self.iterdata.seq = NULL
16289 * self.iterdata.tid = -1 # <<<<<<<<<<<<<<
16291 * # self.pileup_iter = bam_plp_init( &__advancepileup, &self.iterdata )
16293 __pyx_v_self->iterdata.tid = -1;
16298 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1698
16300 * # self.pileup_iter = bam_plp_init( &__advancepileup, &self.iterdata )
16301 * bam_plp_reset(self.pileup_iter) # <<<<<<<<<<<<<<
16303 * def __dealloc__(self):
16305 bam_plp_reset(__pyx_v_self->pileup_iter);
16307 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
16310 __Pyx_XDECREF(__pyx_t_1);
16311 __Pyx_XDECREF(__pyx_t_2);
16312 __Pyx_XDECREF(__pyx_t_3);
16313 __Pyx_AddTraceback("csamtools.IteratorColumn.reset");
16316 __Pyx_XGIVEREF(__pyx_r);
16317 __Pyx_TraceReturn(__pyx_r);
16318 __Pyx_RefNannyFinishContext();
16322 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1700
16323 * bam_plp_reset(self.pileup_iter)
16325 * def __dealloc__(self): # <<<<<<<<<<<<<<
16326 * # reset in order to avoid memory leak messages for iterators that have
16327 * # not been fully consumed
16330 static void __pyx_pf_9csamtools_14IteratorColumn___dealloc__(PyObject *__pyx_v_self); /*proto*/
16331 static void __pyx_pf_9csamtools_14IteratorColumn___dealloc__(PyObject *__pyx_v_self) {
16333 __Pyx_TraceDeclarations
16334 __Pyx_RefNannySetupContext("__dealloc__");
16335 __Pyx_TraceCall("__dealloc__", __pyx_f[0], 1700);
16337 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1703
16338 * # reset in order to avoid memory leak messages for iterators that have
16339 * # not been fully consumed
16340 * if self.pileup_iter != <bam_plp_t>NULL: # <<<<<<<<<<<<<<
16341 * bam_plp_reset(self.pileup_iter)
16342 * bam_plp_destroy(self.pileup_iter)
16344 __pyx_t_1 = (((struct __pyx_obj_9csamtools_IteratorColumn *)__pyx_v_self)->pileup_iter != ((bam_plp_t)NULL));
16347 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1704
16348 * # not been fully consumed
16349 * if self.pileup_iter != <bam_plp_t>NULL:
16350 * bam_plp_reset(self.pileup_iter) # <<<<<<<<<<<<<<
16351 * bam_plp_destroy(self.pileup_iter)
16352 * self.pileup_iter = <bam_plp_t>NULL
16354 bam_plp_reset(((struct __pyx_obj_9csamtools_IteratorColumn *)__pyx_v_self)->pileup_iter);
16356 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1705
16357 * if self.pileup_iter != <bam_plp_t>NULL:
16358 * bam_plp_reset(self.pileup_iter)
16359 * bam_plp_destroy(self.pileup_iter) # <<<<<<<<<<<<<<
16360 * self.pileup_iter = <bam_plp_t>NULL
16363 bam_plp_destroy(((struct __pyx_obj_9csamtools_IteratorColumn *)__pyx_v_self)->pileup_iter);
16365 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1706
16366 * bam_plp_reset(self.pileup_iter)
16367 * bam_plp_destroy(self.pileup_iter)
16368 * self.pileup_iter = <bam_plp_t>NULL # <<<<<<<<<<<<<<
16370 * if self.iterdata.seq != NULL:
16372 ((struct __pyx_obj_9csamtools_IteratorColumn *)__pyx_v_self)->pileup_iter = ((bam_plp_t)NULL);
16377 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1708
16378 * self.pileup_iter = <bam_plp_t>NULL
16380 * if self.iterdata.seq != NULL: # <<<<<<<<<<<<<<
16381 * free(self.iterdata.seq)
16382 * self.iterdata.seq = NULL
16384 __pyx_t_1 = (((struct __pyx_obj_9csamtools_IteratorColumn *)__pyx_v_self)->iterdata.seq != NULL);
16387 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1709
16389 * if self.iterdata.seq != NULL:
16390 * free(self.iterdata.seq) # <<<<<<<<<<<<<<
16391 * self.iterdata.seq = NULL
16394 free(((struct __pyx_obj_9csamtools_IteratorColumn *)__pyx_v_self)->iterdata.seq);
16396 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1710
16397 * if self.iterdata.seq != NULL:
16398 * free(self.iterdata.seq)
16399 * self.iterdata.seq = NULL # <<<<<<<<<<<<<<
16401 * cdef class IteratorColumnRegion(IteratorColumn):
16403 ((struct __pyx_obj_9csamtools_IteratorColumn *)__pyx_v_self)->iterdata.seq = NULL;
16408 __Pyx_TraceReturn(Py_None);
16409 __Pyx_RefNannyFinishContext();
16412 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1715
16413 * '''iterates over a region only.
16415 * def __cinit__(self, Samfile samfile, # <<<<<<<<<<<<<<
16420 static int __pyx_pf_9csamtools_20IteratorColumnRegion___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
16421 static int __pyx_pf_9csamtools_20IteratorColumnRegion___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
16422 struct __pyx_obj_9csamtools_Samfile *__pyx_v_samfile = 0;
16426 PyObject *__pyx_v_kwargs = 0;
16428 PyObject *__pyx_t_1 = NULL;
16429 struct __pyx_opt_args_9csamtools_14IteratorColumn_setupIteratorData __pyx_t_2;
16430 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__samfile,&__pyx_n_s__tid,&__pyx_n_s__start,&__pyx_n_s__end,0};
16431 __Pyx_TraceDeclarations
16432 __Pyx_RefNannySetupContext("__cinit__");
16433 __Pyx_TraceCall("__cinit__", __pyx_f[0], 1715);
16434 __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return -1;
16435 __Pyx_GOTREF(__pyx_v_kwargs);
16436 if (unlikely(__pyx_kwds)) {
16437 Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
16438 PyObject* values[4] = {0,0,0,0};
16439 switch (PyTuple_GET_SIZE(__pyx_args)) {
16440 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
16441 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
16442 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
16443 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
16445 default: goto __pyx_L5_argtuple_error;
16447 switch (PyTuple_GET_SIZE(__pyx_args)) {
16449 values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__samfile);
16450 if (likely(values[0])) kw_args--;
16451 else goto __pyx_L5_argtuple_error;
16454 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__tid);
16455 if (value) { values[1] = value; kw_args--; }
16459 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__start);
16460 if (value) { values[2] = value; kw_args--; }
16464 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__end);
16465 if (value) { values[3] = value; kw_args--; }
16468 if (unlikely(kw_args > 0)) {
16469 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, PyTuple_GET_SIZE(__pyx_args), "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1715; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
16471 __pyx_v_samfile = ((struct __pyx_obj_9csamtools_Samfile *)values[0]);
16473 __pyx_v_tid = __Pyx_PyInt_AsInt(values[1]); if (unlikely((__pyx_v_tid == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1716; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
16475 __pyx_v_tid = ((int)0);
16478 __pyx_v_start = __Pyx_PyInt_AsInt(values[2]); if (unlikely((__pyx_v_start == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1717; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
16480 __pyx_v_start = ((int)0);
16483 __pyx_v_end = __Pyx_PyInt_AsInt(values[3]); if (unlikely((__pyx_v_end == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1718; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
16485 __pyx_v_end = __pyx_k_58;
16488 __pyx_v_tid = ((int)0);
16489 __pyx_v_start = ((int)0);
16490 __pyx_v_end = __pyx_k_58;
16491 switch (PyTuple_GET_SIZE(__pyx_args)) {
16492 case 4: __pyx_v_end = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 3)); if (unlikely((__pyx_v_end == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1718; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
16493 case 3: __pyx_v_start = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 2)); if (unlikely((__pyx_v_start == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1717; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
16494 case 2: __pyx_v_tid = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely((__pyx_v_tid == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1716; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
16495 case 1: __pyx_v_samfile = ((struct __pyx_obj_9csamtools_Samfile *)PyTuple_GET_ITEM(__pyx_args, 0));
16497 default: goto __pyx_L5_argtuple_error;
16500 goto __pyx_L4_argument_unpacking_done;
16501 __pyx_L5_argtuple_error:;
16502 __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1715; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
16504 __Pyx_DECREF(__pyx_v_kwargs);
16505 __Pyx_AddTraceback("csamtools.IteratorColumnRegion.__cinit__");
16506 __Pyx_RefNannyFinishContext();
16508 __pyx_L4_argument_unpacking_done:;
16509 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_samfile), __pyx_ptype_9csamtools_Samfile, 1, "samfile", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1715; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16511 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1722
16513 * # initialize iterator
16514 * self.setupIteratorData( tid, start, end, 1 ) # <<<<<<<<<<<<<<
16516 * def __next__(self):
16518 __pyx_t_2.__pyx_n = 1;
16519 __pyx_t_2.reopen = 1;
16520 __pyx_t_1 = ((struct __pyx_vtabstruct_9csamtools_IteratorColumnRegion *)((struct __pyx_obj_9csamtools_IteratorColumnRegion *)__pyx_v_self)->__pyx_base.__pyx_vtab)->__pyx_base.setupIteratorData(((struct __pyx_obj_9csamtools_IteratorColumn *)__pyx_v_self), __pyx_v_tid, __pyx_v_start, __pyx_v_end, &__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1722; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16521 __Pyx_GOTREF(__pyx_t_1);
16522 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16527 __Pyx_XDECREF(__pyx_t_1);
16528 __Pyx_AddTraceback("csamtools.IteratorColumnRegion.__cinit__");
16531 __Pyx_DECREF(__pyx_v_kwargs);
16532 __Pyx_TraceReturn(Py_None);
16533 __Pyx_RefNannyFinishContext();
16537 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1724
16538 * self.setupIteratorData( tid, start, end, 1 )
16540 * def __next__(self): # <<<<<<<<<<<<<<
16541 * """python version of next().
16545 static PyObject *__pyx_pf_9csamtools_20IteratorColumnRegion___next__(PyObject *__pyx_v_self); /*proto*/
16546 static char __pyx_doc_9csamtools_20IteratorColumnRegion___next__[] = "python version of next().\n ";
16547 struct wrapperbase __pyx_wrapperbase_9csamtools_20IteratorColumnRegion___next__;
16548 static PyObject *__pyx_pf_9csamtools_20IteratorColumnRegion___next__(PyObject *__pyx_v_self) {
16549 PyObject *__pyx_r = NULL;
16551 PyObject *__pyx_t_2 = NULL;
16552 PyObject *__pyx_t_3 = NULL;
16553 __Pyx_TraceDeclarations
16554 __Pyx_RefNannySetupContext("__next__");
16555 __Pyx_TraceCall("__next__", __pyx_f[0], 1724);
16557 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1728
16560 * while 1: # <<<<<<<<<<<<<<
16562 * if self.n_plp < 0:
16567 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1729
16570 * self.cnext() # <<<<<<<<<<<<<<
16571 * if self.n_plp < 0:
16572 * raise ValueError("error during iteration" )
16574 ((struct __pyx_vtabstruct_9csamtools_IteratorColumnRegion *)((struct __pyx_obj_9csamtools_IteratorColumnRegion *)__pyx_v_self)->__pyx_base.__pyx_vtab)->__pyx_base.cnext(((struct __pyx_obj_9csamtools_IteratorColumn *)__pyx_v_self));
16576 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1730
16579 * if self.n_plp < 0: # <<<<<<<<<<<<<<
16580 * raise ValueError("error during iteration" )
16583 __pyx_t_1 = (((struct __pyx_obj_9csamtools_IteratorColumnRegion *)__pyx_v_self)->__pyx_base.n_plp < 0);
16586 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1731
16588 * if self.n_plp < 0:
16589 * raise ValueError("error during iteration" ) # <<<<<<<<<<<<<<
16591 * if self.plp == NULL:
16593 __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1731; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16594 __Pyx_GOTREF(__pyx_t_2);
16595 __Pyx_INCREF(((PyObject *)__pyx_kp_s_59));
16596 PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_59));
16597 __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_59));
16598 __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1731; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16599 __Pyx_GOTREF(__pyx_t_3);
16600 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
16601 __Pyx_Raise(__pyx_t_3, 0, 0);
16602 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16603 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1731; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16608 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1733
16609 * raise ValueError("error during iteration" )
16611 * if self.plp == NULL: # <<<<<<<<<<<<<<
16612 * raise StopIteration
16615 __pyx_t_1 = (((struct __pyx_obj_9csamtools_IteratorColumnRegion *)__pyx_v_self)->__pyx_base.plp == NULL);
16618 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1734
16620 * if self.plp == NULL:
16621 * raise StopIteration # <<<<<<<<<<<<<<
16623 * return makePileupProxy( <bam_pileup1_t*>self.plp,
16625 __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0);
16626 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1734; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16631 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1736
16632 * raise StopIteration
16634 * return makePileupProxy( <bam_pileup1_t*>self.plp, # <<<<<<<<<<<<<<
16638 __Pyx_XDECREF(__pyx_r);
16640 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1739
16643 * self.n_plp ) # <<<<<<<<<<<<<<
16645 * cdef class IteratorColumnAllRefs(IteratorColumn):
16647 __pyx_t_3 = __pyx_f_9csamtools_makePileupProxy(((bam_pileup1_t *)((struct __pyx_obj_9csamtools_IteratorColumnRegion *)__pyx_v_self)->__pyx_base.plp), ((struct __pyx_obj_9csamtools_IteratorColumnRegion *)__pyx_v_self)->__pyx_base.tid, ((struct __pyx_obj_9csamtools_IteratorColumnRegion *)__pyx_v_self)->__pyx_base.pos, ((struct __pyx_obj_9csamtools_IteratorColumnRegion *)__pyx_v_self)->__pyx_base.n_plp); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1736; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16648 __Pyx_GOTREF(__pyx_t_3);
16649 __pyx_r = __pyx_t_3;
16654 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
16657 __Pyx_XDECREF(__pyx_t_2);
16658 __Pyx_XDECREF(__pyx_t_3);
16659 __Pyx_AddTraceback("csamtools.IteratorColumnRegion.__next__");
16662 __Pyx_XGIVEREF(__pyx_r);
16663 __Pyx_TraceReturn(__pyx_r);
16664 __Pyx_RefNannyFinishContext();
16668 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1745
16671 * def __cinit__(self, # <<<<<<<<<<<<<<
16676 static int __pyx_pf_9csamtools_21IteratorColumnAllRefs___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
16677 static int __pyx_pf_9csamtools_21IteratorColumnAllRefs___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
16678 struct __pyx_obj_9csamtools_Samfile *__pyx_v_samfile = 0;
16679 PyObject *__pyx_v_kwargs = 0;
16681 PyObject *__pyx_t_1 = NULL;
16684 struct __pyx_opt_args_9csamtools_14IteratorColumn_setupIteratorData __pyx_t_4;
16685 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__samfile,0};
16686 __Pyx_TraceDeclarations
16687 __Pyx_RefNannySetupContext("__cinit__");
16688 __Pyx_TraceCall("__cinit__", __pyx_f[0], 1745);
16689 __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return -1;
16690 __Pyx_GOTREF(__pyx_v_kwargs);
16691 if (unlikely(__pyx_kwds)) {
16692 Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
16693 PyObject* values[1] = {0};
16694 switch (PyTuple_GET_SIZE(__pyx_args)) {
16695 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
16697 default: goto __pyx_L5_argtuple_error;
16699 switch (PyTuple_GET_SIZE(__pyx_args)) {
16701 values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__samfile);
16702 if (likely(values[0])) kw_args--;
16703 else goto __pyx_L5_argtuple_error;
16705 if (unlikely(kw_args > 0)) {
16706 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, PyTuple_GET_SIZE(__pyx_args), "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1745; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
16708 __pyx_v_samfile = ((struct __pyx_obj_9csamtools_Samfile *)values[0]);
16709 } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
16710 goto __pyx_L5_argtuple_error;
16712 __pyx_v_samfile = ((struct __pyx_obj_9csamtools_Samfile *)PyTuple_GET_ITEM(__pyx_args, 0));
16714 goto __pyx_L4_argument_unpacking_done;
16715 __pyx_L5_argtuple_error:;
16716 __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1745; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
16718 __Pyx_DECREF(__pyx_v_kwargs);
16719 __Pyx_AddTraceback("csamtools.IteratorColumnAllRefs.__cinit__");
16720 __Pyx_RefNannyFinishContext();
16722 __pyx_L4_argument_unpacking_done:;
16723 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_samfile), __pyx_ptype_9csamtools_Samfile, 1, "samfile", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1746; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16725 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1750
16727 * # no iteration over empty files
16728 * if not samfile.nreferences: raise StopIteration # <<<<<<<<<<<<<<
16730 * # initialize iterator
16732 __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_samfile), __pyx_n_s__nreferences); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1750; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16733 __Pyx_GOTREF(__pyx_t_1);
16734 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1750; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16735 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16736 __pyx_t_3 = (!__pyx_t_2);
16738 __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0);
16739 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1750; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16744 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1753
16746 * # initialize iterator
16747 * self.setupIteratorData( self.tid, 0, max_pos, 1 ) # <<<<<<<<<<<<<<
16749 * def __next__(self):
16751 __pyx_t_4.__pyx_n = 1;
16752 __pyx_t_4.reopen = 1;
16753 __pyx_t_1 = ((struct __pyx_vtabstruct_9csamtools_IteratorColumnAllRefs *)((struct __pyx_obj_9csamtools_IteratorColumnAllRefs *)__pyx_v_self)->__pyx_base.__pyx_vtab)->__pyx_base.setupIteratorData(((struct __pyx_obj_9csamtools_IteratorColumn *)__pyx_v_self), ((struct __pyx_obj_9csamtools_IteratorColumnAllRefs *)__pyx_v_self)->__pyx_base.tid, 0, __pyx_v_9csamtools_max_pos, &__pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1753; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16754 __Pyx_GOTREF(__pyx_t_1);
16755 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16760 __Pyx_XDECREF(__pyx_t_1);
16761 __Pyx_AddTraceback("csamtools.IteratorColumnAllRefs.__cinit__");
16764 __Pyx_DECREF(__pyx_v_kwargs);
16765 __Pyx_TraceReturn(Py_None);
16766 __Pyx_RefNannyFinishContext();
16770 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1755
16771 * self.setupIteratorData( self.tid, 0, max_pos, 1 )
16773 * def __next__(self): # <<<<<<<<<<<<<<
16774 * """python version of next().
16778 static PyObject *__pyx_pf_9csamtools_21IteratorColumnAllRefs___next__(PyObject *__pyx_v_self); /*proto*/
16779 static char __pyx_doc_9csamtools_21IteratorColumnAllRefs___next__[] = "python version of next().\n ";
16780 struct wrapperbase __pyx_wrapperbase_9csamtools_21IteratorColumnAllRefs___next__;
16781 static PyObject *__pyx_pf_9csamtools_21IteratorColumnAllRefs___next__(PyObject *__pyx_v_self) {
16782 PyObject *__pyx_r = NULL;
16784 PyObject *__pyx_t_2 = NULL;
16785 PyObject *__pyx_t_3 = NULL;
16786 PyObject *__pyx_t_4 = NULL;
16787 struct __pyx_opt_args_9csamtools_14IteratorColumn_setupIteratorData __pyx_t_5;
16788 __Pyx_TraceDeclarations
16789 __Pyx_RefNannySetupContext("__next__");
16790 __Pyx_TraceCall("__next__", __pyx_f[0], 1755);
16792 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1759
16795 * while 1: # <<<<<<<<<<<<<<
16802 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1760
16805 * self.cnext() # <<<<<<<<<<<<<<
16807 * if self.n_plp < 0:
16809 ((struct __pyx_vtabstruct_9csamtools_IteratorColumnAllRefs *)((struct __pyx_obj_9csamtools_IteratorColumnAllRefs *)__pyx_v_self)->__pyx_base.__pyx_vtab)->__pyx_base.cnext(((struct __pyx_obj_9csamtools_IteratorColumn *)__pyx_v_self));
16811 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1762
16814 * if self.n_plp < 0: # <<<<<<<<<<<<<<
16815 * raise ValueError("error during iteration" )
16818 __pyx_t_1 = (((struct __pyx_obj_9csamtools_IteratorColumnAllRefs *)__pyx_v_self)->__pyx_base.n_plp < 0);
16821 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1763
16823 * if self.n_plp < 0:
16824 * raise ValueError("error during iteration" ) # <<<<<<<<<<<<<<
16826 * # return result, if within same reference
16828 __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1763; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16829 __Pyx_GOTREF(__pyx_t_2);
16830 __Pyx_INCREF(((PyObject *)__pyx_kp_s_59));
16831 PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_59));
16832 __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_59));
16833 __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1763; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16834 __Pyx_GOTREF(__pyx_t_3);
16835 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
16836 __Pyx_Raise(__pyx_t_3, 0, 0);
16837 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16838 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1763; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16843 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1766
16845 * # return result, if within same reference
16846 * if self.plp != NULL: # <<<<<<<<<<<<<<
16847 * return makePileupProxy( <bam_pileup1_t*>self.plp,
16850 __pyx_t_1 = (((struct __pyx_obj_9csamtools_IteratorColumnAllRefs *)__pyx_v_self)->__pyx_base.plp != NULL);
16853 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1767
16854 * # return result, if within same reference
16855 * if self.plp != NULL:
16856 * return makePileupProxy( <bam_pileup1_t*>self.plp, # <<<<<<<<<<<<<<
16860 __Pyx_XDECREF(__pyx_r);
16862 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1770
16865 * self.n_plp ) # <<<<<<<<<<<<<<
16867 * # otherwise, proceed to next reference or stop
16869 __pyx_t_3 = __pyx_f_9csamtools_makePileupProxy(((bam_pileup1_t *)((struct __pyx_obj_9csamtools_IteratorColumnAllRefs *)__pyx_v_self)->__pyx_base.plp), ((struct __pyx_obj_9csamtools_IteratorColumnAllRefs *)__pyx_v_self)->__pyx_base.tid, ((struct __pyx_obj_9csamtools_IteratorColumnAllRefs *)__pyx_v_self)->__pyx_base.pos, ((struct __pyx_obj_9csamtools_IteratorColumnAllRefs *)__pyx_v_self)->__pyx_base.n_plp); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1767; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16870 __Pyx_GOTREF(__pyx_t_3);
16871 __pyx_r = __pyx_t_3;
16878 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1773
16880 * # otherwise, proceed to next reference or stop
16881 * self.tid += 1 # <<<<<<<<<<<<<<
16882 * if self.tid < self.samfile.nreferences:
16883 * self.setupIteratorData( self.tid, 0, max_pos, 0 )
16885 ((struct __pyx_obj_9csamtools_IteratorColumnAllRefs *)__pyx_v_self)->__pyx_base.tid += 1;
16887 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1774
16888 * # otherwise, proceed to next reference or stop
16890 * if self.tid < self.samfile.nreferences: # <<<<<<<<<<<<<<
16891 * self.setupIteratorData( self.tid, 0, max_pos, 0 )
16894 __pyx_t_3 = PyInt_FromLong(((struct __pyx_obj_9csamtools_IteratorColumnAllRefs *)__pyx_v_self)->__pyx_base.tid); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1774; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16895 __Pyx_GOTREF(__pyx_t_3);
16896 __pyx_t_2 = PyObject_GetAttr(((PyObject *)((struct __pyx_obj_9csamtools_IteratorColumnAllRefs *)__pyx_v_self)->__pyx_base.samfile), __pyx_n_s__nreferences); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1774; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16897 __Pyx_GOTREF(__pyx_t_2);
16898 __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_LT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1774; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16899 __Pyx_GOTREF(__pyx_t_4);
16900 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16901 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
16902 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1774; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16903 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
16906 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1775
16908 * if self.tid < self.samfile.nreferences:
16909 * self.setupIteratorData( self.tid, 0, max_pos, 0 ) # <<<<<<<<<<<<<<
16911 * raise StopIteration
16913 __pyx_t_5.__pyx_n = 1;
16914 __pyx_t_5.reopen = 0;
16915 __pyx_t_4 = ((struct __pyx_vtabstruct_9csamtools_IteratorColumnAllRefs *)((struct __pyx_obj_9csamtools_IteratorColumnAllRefs *)__pyx_v_self)->__pyx_base.__pyx_vtab)->__pyx_base.setupIteratorData(((struct __pyx_obj_9csamtools_IteratorColumn *)__pyx_v_self), ((struct __pyx_obj_9csamtools_IteratorColumnAllRefs *)__pyx_v_self)->__pyx_base.tid, 0, __pyx_v_9csamtools_max_pos, &__pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1775; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16916 __Pyx_GOTREF(__pyx_t_4);
16917 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
16922 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1777
16923 * self.setupIteratorData( self.tid, 0, max_pos, 0 )
16925 * raise StopIteration # <<<<<<<<<<<<<<
16927 * ##-------------------------------------------------------------------
16929 __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0);
16930 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1777; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16935 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
16938 __Pyx_XDECREF(__pyx_t_2);
16939 __Pyx_XDECREF(__pyx_t_3);
16940 __Pyx_XDECREF(__pyx_t_4);
16941 __Pyx_AddTraceback("csamtools.IteratorColumnAllRefs.__next__");
16944 __Pyx_XGIVEREF(__pyx_r);
16945 __Pyx_TraceReturn(__pyx_r);
16946 __Pyx_RefNannyFinishContext();
16950 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1782
16951 * ##-------------------------------------------------------------------
16952 * ##-------------------------------------------------------------------
16953 * cdef inline int32_t query_start(bam1_t *src) except -1: # <<<<<<<<<<<<<<
16954 * cdef uint32_t * cigar_p, op
16958 static CYTHON_INLINE int32_t __pyx_f_9csamtools_query_start(bam1_t *__pyx_v_src) {
16959 uint32_t *__pyx_v_cigar_p;
16960 uint32_t __pyx_v_op;
16961 uint32_t __pyx_v_k;
16962 uint32_t __pyx_v_start_offset;
16964 uint32_t __pyx_t_1;
16968 __Pyx_TraceDeclarations
16969 __Pyx_RefNannySetupContext("query_start");
16970 __Pyx_TraceCall("query_start", __pyx_f[0], 1782);
16972 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1785
16973 * cdef uint32_t * cigar_p, op
16975 * cdef uint32_t start_offset = 0 # <<<<<<<<<<<<<<
16977 * if src.core.n_cigar:
16979 __pyx_v_start_offset = 0;
16981 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1787
16982 * cdef uint32_t start_offset = 0
16984 * if src.core.n_cigar: # <<<<<<<<<<<<<<
16985 * cigar_p = bam1_cigar(src);
16986 * for k from 0 <= k < src.core.n_cigar:
16988 if (__pyx_v_src->core.n_cigar) {
16990 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1788
16992 * if src.core.n_cigar:
16993 * cigar_p = bam1_cigar(src); # <<<<<<<<<<<<<<
16994 * for k from 0 <= k < src.core.n_cigar:
16995 * op = cigar_p[k] & BAM_CIGAR_MASK
16997 __pyx_v_cigar_p = bam1_cigar(__pyx_v_src);
16999 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1789
17000 * if src.core.n_cigar:
17001 * cigar_p = bam1_cigar(src);
17002 * for k from 0 <= k < src.core.n_cigar: # <<<<<<<<<<<<<<
17003 * op = cigar_p[k] & BAM_CIGAR_MASK
17004 * if op==BAM_CHARD_CLIP:
17006 __pyx_t_1 = __pyx_v_src->core.n_cigar;
17007 for (__pyx_v_k = 0; __pyx_v_k < __pyx_t_1; __pyx_v_k++) {
17009 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1790
17010 * cigar_p = bam1_cigar(src);
17011 * for k from 0 <= k < src.core.n_cigar:
17012 * op = cigar_p[k] & BAM_CIGAR_MASK # <<<<<<<<<<<<<<
17013 * if op==BAM_CHARD_CLIP:
17014 * if start_offset!=0 and start_offset!=src.core.l_qseq:
17016 __pyx_v_op = ((__pyx_v_cigar_p[__pyx_v_k]) & 15);
17018 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1791
17019 * for k from 0 <= k < src.core.n_cigar:
17020 * op = cigar_p[k] & BAM_CIGAR_MASK
17021 * if op==BAM_CHARD_CLIP: # <<<<<<<<<<<<<<
17022 * if start_offset!=0 and start_offset!=src.core.l_qseq:
17023 * PyErr_SetString(ValueError, 'Invalid clipping in CIGAR string')
17025 switch (__pyx_v_op) {
17028 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1792
17029 * op = cigar_p[k] & BAM_CIGAR_MASK
17030 * if op==BAM_CHARD_CLIP:
17031 * if start_offset!=0 and start_offset!=src.core.l_qseq: # <<<<<<<<<<<<<<
17032 * PyErr_SetString(ValueError, 'Invalid clipping in CIGAR string')
17035 __pyx_t_2 = (__pyx_v_start_offset != 0);
17037 __pyx_t_3 = (__pyx_v_start_offset != __pyx_v_src->core.l_qseq);
17038 __pyx_t_4 = __pyx_t_3;
17040 __pyx_t_4 = __pyx_t_2;
17044 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1793
17045 * if op==BAM_CHARD_CLIP:
17046 * if start_offset!=0 and start_offset!=src.core.l_qseq:
17047 * PyErr_SetString(ValueError, 'Invalid clipping in CIGAR string') # <<<<<<<<<<<<<<
17049 * elif op==BAM_CSOFT_CLIP:
17051 PyErr_SetString(__pyx_builtin_ValueError, __pyx_k_60);
17053 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1794
17054 * if start_offset!=0 and start_offset!=src.core.l_qseq:
17055 * PyErr_SetString(ValueError, 'Invalid clipping in CIGAR string')
17056 * return -1 # <<<<<<<<<<<<<<
17057 * elif op==BAM_CSOFT_CLIP:
17058 * start_offset += cigar_p[k] >> BAM_CIGAR_SHIFT
17067 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1795
17068 * PyErr_SetString(ValueError, 'Invalid clipping in CIGAR string')
17070 * elif op==BAM_CSOFT_CLIP: # <<<<<<<<<<<<<<
17071 * start_offset += cigar_p[k] >> BAM_CIGAR_SHIFT
17076 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1796
17078 * elif op==BAM_CSOFT_CLIP:
17079 * start_offset += cigar_p[k] >> BAM_CIGAR_SHIFT # <<<<<<<<<<<<<<
17083 __pyx_v_start_offset += ((__pyx_v_cigar_p[__pyx_v_k]) >> 4);
17087 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1798
17088 * start_offset += cigar_p[k] >> BAM_CIGAR_SHIFT
17090 * break # <<<<<<<<<<<<<<
17092 * return start_offset
17094 goto __pyx_L5_break;
17103 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1800
17106 * return start_offset # <<<<<<<<<<<<<<
17108 * ##-------------------------------------------------------------------
17110 __pyx_r = __pyx_v_start_offset;
17115 __Pyx_TraceReturn(Py_None);
17116 __Pyx_RefNannyFinishContext();
17120 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1805
17121 * ##-------------------------------------------------------------------
17122 * ##-------------------------------------------------------------------
17123 * cdef inline int32_t query_end(bam1_t *src) except -1: # <<<<<<<<<<<<<<
17124 * cdef uint32_t * cigar_p, op
17128 static CYTHON_INLINE int32_t __pyx_f_9csamtools_query_end(bam1_t *__pyx_v_src) {
17129 uint32_t *__pyx_v_cigar_p;
17130 uint32_t __pyx_v_op;
17131 uint32_t __pyx_v_k;
17132 uint32_t __pyx_v_end_offset;
17137 __Pyx_TraceDeclarations
17138 __Pyx_RefNannySetupContext("query_end");
17139 __Pyx_TraceCall("query_end", __pyx_f[0], 1805);
17141 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1808
17142 * cdef uint32_t * cigar_p, op
17144 * cdef uint32_t end_offset = src.core.l_qseq # <<<<<<<<<<<<<<
17146 * if src.core.n_cigar>1:
17148 __pyx_v_end_offset = __pyx_v_src->core.l_qseq;
17150 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1810
17151 * cdef uint32_t end_offset = src.core.l_qseq
17153 * if src.core.n_cigar>1: # <<<<<<<<<<<<<<
17154 * cigar_p = bam1_cigar(src);
17155 * for k from src.core.n_cigar > k >= 1:
17157 __pyx_t_1 = (__pyx_v_src->core.n_cigar > 1);
17160 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1811
17162 * if src.core.n_cigar>1:
17163 * cigar_p = bam1_cigar(src); # <<<<<<<<<<<<<<
17164 * for k from src.core.n_cigar > k >= 1:
17165 * op = cigar_p[k] & BAM_CIGAR_MASK
17167 __pyx_v_cigar_p = bam1_cigar(__pyx_v_src);
17169 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1812
17170 * if src.core.n_cigar>1:
17171 * cigar_p = bam1_cigar(src);
17172 * for k from src.core.n_cigar > k >= 1: # <<<<<<<<<<<<<<
17173 * op = cigar_p[k] & BAM_CIGAR_MASK
17174 * if op==BAM_CHARD_CLIP:
17176 for (__pyx_v_k = __pyx_v_src->core.n_cigar-1; __pyx_v_k >= 1; __pyx_v_k--) {
17178 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1813
17179 * cigar_p = bam1_cigar(src);
17180 * for k from src.core.n_cigar > k >= 1:
17181 * op = cigar_p[k] & BAM_CIGAR_MASK # <<<<<<<<<<<<<<
17182 * if op==BAM_CHARD_CLIP:
17183 * if end_offset!=0 and end_offset!=src.core.l_qseq:
17185 __pyx_v_op = ((__pyx_v_cigar_p[__pyx_v_k]) & 15);
17187 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1814
17188 * for k from src.core.n_cigar > k >= 1:
17189 * op = cigar_p[k] & BAM_CIGAR_MASK
17190 * if op==BAM_CHARD_CLIP: # <<<<<<<<<<<<<<
17191 * if end_offset!=0 and end_offset!=src.core.l_qseq:
17192 * PyErr_SetString(ValueError, 'Invalid clipping in CIGAR string')
17194 switch (__pyx_v_op) {
17197 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1815
17198 * op = cigar_p[k] & BAM_CIGAR_MASK
17199 * if op==BAM_CHARD_CLIP:
17200 * if end_offset!=0 and end_offset!=src.core.l_qseq: # <<<<<<<<<<<<<<
17201 * PyErr_SetString(ValueError, 'Invalid clipping in CIGAR string')
17204 __pyx_t_1 = (__pyx_v_end_offset != 0);
17206 __pyx_t_2 = (__pyx_v_end_offset != __pyx_v_src->core.l_qseq);
17207 __pyx_t_3 = __pyx_t_2;
17209 __pyx_t_3 = __pyx_t_1;
17213 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1816
17214 * if op==BAM_CHARD_CLIP:
17215 * if end_offset!=0 and end_offset!=src.core.l_qseq:
17216 * PyErr_SetString(ValueError, 'Invalid clipping in CIGAR string') # <<<<<<<<<<<<<<
17218 * elif op==BAM_CSOFT_CLIP:
17220 PyErr_SetString(__pyx_builtin_ValueError, __pyx_k_60);
17222 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1817
17223 * if end_offset!=0 and end_offset!=src.core.l_qseq:
17224 * PyErr_SetString(ValueError, 'Invalid clipping in CIGAR string')
17225 * return -1 # <<<<<<<<<<<<<<
17226 * elif op==BAM_CSOFT_CLIP:
17227 * end_offset -= cigar_p[k] >> BAM_CIGAR_SHIFT
17236 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1818
17237 * PyErr_SetString(ValueError, 'Invalid clipping in CIGAR string')
17239 * elif op==BAM_CSOFT_CLIP: # <<<<<<<<<<<<<<
17240 * end_offset -= cigar_p[k] >> BAM_CIGAR_SHIFT
17245 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1819
17247 * elif op==BAM_CSOFT_CLIP:
17248 * end_offset -= cigar_p[k] >> BAM_CIGAR_SHIFT # <<<<<<<<<<<<<<
17252 __pyx_v_end_offset -= ((__pyx_v_cigar_p[__pyx_v_k]) >> 4);
17256 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1821
17257 * end_offset -= cigar_p[k] >> BAM_CIGAR_SHIFT
17259 * break # <<<<<<<<<<<<<<
17261 * if end_offset==0:
17263 goto __pyx_L5_break;
17272 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1823
17275 * if end_offset==0: # <<<<<<<<<<<<<<
17276 * end_offset = src.core.l_qseq
17279 __pyx_t_3 = (__pyx_v_end_offset == 0);
17282 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1824
17284 * if end_offset==0:
17285 * end_offset = src.core.l_qseq # <<<<<<<<<<<<<<
17287 * return end_offset
17289 __pyx_v_end_offset = __pyx_v_src->core.l_qseq;
17294 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1826
17295 * end_offset = src.core.l_qseq
17297 * return end_offset # <<<<<<<<<<<<<<
17301 __pyx_r = __pyx_v_end_offset;
17306 __Pyx_TraceReturn(Py_None);
17307 __Pyx_RefNannyFinishContext();
17311 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1829
17314 * cdef inline object get_seq_range(bam1_t *src, uint32_t start, uint32_t end): # <<<<<<<<<<<<<<
17319 static CYTHON_INLINE PyObject *__pyx_f_9csamtools_get_seq_range(bam1_t *__pyx_v_src, uint32_t __pyx_v_start, uint32_t __pyx_v_end) {
17320 uint8_t *__pyx_v_p;
17321 uint32_t __pyx_v_k;
17323 PyObject *__pyx_v_seq;
17324 PyObject *__pyx_r = NULL;
17326 PyObject *__pyx_t_2 = NULL;
17327 uint32_t __pyx_t_3;
17328 __Pyx_TraceDeclarations
17329 __Pyx_RefNannySetupContext("get_seq_range");
17330 __Pyx_TraceCall("get_seq_range", __pyx_f[0], 1829);
17331 __pyx_v_seq = Py_None; __Pyx_INCREF(Py_None);
17333 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1834
17336 * if not src.core.l_qseq: # <<<<<<<<<<<<<<
17340 __pyx_t_1 = (!__pyx_v_src->core.l_qseq);
17343 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1835
17345 * if not src.core.l_qseq:
17346 * return None # <<<<<<<<<<<<<<
17348 * seq = PyString_FromStringAndSize(NULL, end-start)
17350 __Pyx_XDECREF(__pyx_r);
17351 __Pyx_INCREF(Py_None);
17358 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1837
17361 * seq = PyString_FromStringAndSize(NULL, end-start) # <<<<<<<<<<<<<<
17362 * s = PyString_AS_STRING(seq)
17363 * p = bam1_seq(src)
17365 __pyx_t_2 = PyString_FromStringAndSize(NULL, (__pyx_v_end - __pyx_v_start)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17366 __Pyx_GOTREF(__pyx_t_2);
17367 __Pyx_DECREF(__pyx_v_seq);
17368 __pyx_v_seq = __pyx_t_2;
17371 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1838
17373 * seq = PyString_FromStringAndSize(NULL, end-start)
17374 * s = PyString_AS_STRING(seq) # <<<<<<<<<<<<<<
17375 * p = bam1_seq(src)
17378 __pyx_v_s = PyString_AS_STRING(__pyx_v_seq);
17380 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1839
17381 * seq = PyString_FromStringAndSize(NULL, end-start)
17382 * s = PyString_AS_STRING(seq)
17383 * p = bam1_seq(src) # <<<<<<<<<<<<<<
17385 * for k from start <= k < end:
17387 __pyx_v_p = bam1_seq(__pyx_v_src);
17389 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1841
17390 * p = bam1_seq(src)
17392 * for k from start <= k < end: # <<<<<<<<<<<<<<
17393 * # equivalent to bam_nt16_rev_table[bam1_seqi(s, i)] (see bam.c)
17394 * # note: do not use string literal as it will be a python string
17396 __pyx_t_3 = __pyx_v_end;
17397 for (__pyx_v_k = __pyx_v_start; __pyx_v_k < __pyx_t_3; __pyx_v_k++) {
17399 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1844
17400 * # equivalent to bam_nt16_rev_table[bam1_seqi(s, i)] (see bam.c)
17401 * # note: do not use string literal as it will be a python string
17402 * s[k-start] = bam_nt16_rev_table[p[k/2] >> 4 * (1 - k%2) & 0xf] # <<<<<<<<<<<<<<
17406 (__pyx_v_s[(__pyx_v_k - __pyx_v_start)]) = (__pyx_v_9csamtools_bam_nt16_rev_table[(((__pyx_v_p[__Pyx_div_long(__pyx_v_k, 2)]) >> (4 * (1 - __Pyx_mod_long(__pyx_v_k, 2)))) & 0xf)]);
17409 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1846
17410 * s[k-start] = bam_nt16_rev_table[p[k/2] >> 4 * (1 - k%2) & 0xf]
17412 * return seq # <<<<<<<<<<<<<<
17416 __Pyx_XDECREF(__pyx_r);
17417 __Pyx_INCREF(__pyx_v_seq);
17418 __pyx_r = __pyx_v_seq;
17421 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
17424 __Pyx_XDECREF(__pyx_t_2);
17425 __Pyx_AddTraceback("csamtools.get_seq_range");
17428 __Pyx_DECREF(__pyx_v_seq);
17429 __Pyx_XGIVEREF(__pyx_r);
17430 __Pyx_TraceReturn(__pyx_r);
17431 __Pyx_RefNannyFinishContext();
17435 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1849
17438 * cdef inline object get_qual_range(bam1_t *src, uint32_t start, uint32_t end): # <<<<<<<<<<<<<<
17443 static CYTHON_INLINE PyObject *__pyx_f_9csamtools_get_qual_range(bam1_t *__pyx_v_src, uint32_t __pyx_v_start, uint32_t __pyx_v_end) {
17444 uint8_t *__pyx_v_p;
17445 uint32_t __pyx_v_k;
17447 PyObject *__pyx_v_qual;
17448 PyObject *__pyx_r = NULL;
17450 PyObject *__pyx_t_2 = NULL;
17451 uint32_t __pyx_t_3;
17452 __Pyx_TraceDeclarations
17453 __Pyx_RefNannySetupContext("get_qual_range");
17454 __Pyx_TraceCall("get_qual_range", __pyx_f[0], 1849);
17455 __pyx_v_qual = Py_None; __Pyx_INCREF(Py_None);
17457 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1854
17460 * p = bam1_qual(src) # <<<<<<<<<<<<<<
17464 __pyx_v_p = bam1_qual(__pyx_v_src);
17466 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1855
17468 * p = bam1_qual(src)
17469 * if p[0] == 0xff: # <<<<<<<<<<<<<<
17473 __pyx_t_1 = ((__pyx_v_p[0]) == 0xff);
17476 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1856
17477 * p = bam1_qual(src)
17479 * return None # <<<<<<<<<<<<<<
17481 * qual = PyString_FromStringAndSize(NULL, end-start)
17483 __Pyx_XDECREF(__pyx_r);
17484 __Pyx_INCREF(Py_None);
17491 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1858
17494 * qual = PyString_FromStringAndSize(NULL, end-start) # <<<<<<<<<<<<<<
17495 * q = PyString_AS_STRING(qual)
17498 __pyx_t_2 = PyString_FromStringAndSize(NULL, (__pyx_v_end - __pyx_v_start)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1858; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17499 __Pyx_GOTREF(__pyx_t_2);
17500 __Pyx_DECREF(__pyx_v_qual);
17501 __pyx_v_qual = __pyx_t_2;
17504 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1859
17506 * qual = PyString_FromStringAndSize(NULL, end-start)
17507 * q = PyString_AS_STRING(qual) # <<<<<<<<<<<<<<
17509 * for k from start <= k < end:
17511 __pyx_v_q = PyString_AS_STRING(__pyx_v_qual);
17513 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1861
17514 * q = PyString_AS_STRING(qual)
17516 * for k from start <= k < end: # <<<<<<<<<<<<<<
17517 * ## equivalent to t[i] + 33 (see bam.c)
17518 * q[k-start] = p[k] + 33
17520 __pyx_t_3 = __pyx_v_end;
17521 for (__pyx_v_k = __pyx_v_start; __pyx_v_k < __pyx_t_3; __pyx_v_k++) {
17523 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1863
17524 * for k from start <= k < end:
17525 * ## equivalent to t[i] + 33 (see bam.c)
17526 * q[k-start] = p[k] + 33 # <<<<<<<<<<<<<<
17530 (__pyx_v_q[(__pyx_v_k - __pyx_v_start)]) = ((__pyx_v_p[__pyx_v_k]) + 33);
17533 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1865
17534 * q[k-start] = p[k] + 33
17536 * return qual # <<<<<<<<<<<<<<
17538 * cdef class AlignedRead:
17540 __Pyx_XDECREF(__pyx_r);
17541 __Pyx_INCREF(__pyx_v_qual);
17542 __pyx_r = __pyx_v_qual;
17545 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
17548 __Pyx_XDECREF(__pyx_t_2);
17549 __Pyx_AddTraceback("csamtools.get_qual_range");
17552 __Pyx_DECREF(__pyx_v_qual);
17553 __Pyx_XGIVEREF(__pyx_r);
17554 __Pyx_TraceReturn(__pyx_r);
17555 __Pyx_RefNannyFinishContext();
17559 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1890
17561 * # Now only called when instances are created from Python
17562 * def __init__(self): # <<<<<<<<<<<<<<
17564 * self._delegate = <bam1_t*>calloc( 1, sizeof( bam1_t) )
17567 static int __pyx_pf_9csamtools_11AlignedRead___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
17568 static int __pyx_pf_9csamtools_11AlignedRead___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
17570 __Pyx_TraceDeclarations
17571 __Pyx_RefNannySetupContext("__init__");
17572 __Pyx_TraceCall("__init__", __pyx_f[0], 1890);
17573 if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
17574 __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
17575 if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1;
17577 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1892
17578 * def __init__(self):
17580 * self._delegate = <bam1_t*>calloc( 1, sizeof( bam1_t) ) # <<<<<<<<<<<<<<
17581 * # allocate some memory
17582 * # If size is 0, calloc does not return a pointer that can be passed to free()
17584 ((struct __pyx_obj_9csamtools_AlignedRead *)__pyx_v_self)->_delegate = ((bam1_t *)calloc(1, (sizeof(bam1_t))));
17586 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1896
17587 * # If size is 0, calloc does not return a pointer that can be passed to free()
17588 * # so allocate 40 bytes for a new read
17589 * self._delegate.m_data = 40 # <<<<<<<<<<<<<<
17590 * self._delegate.data = <uint8_t *>calloc( self._delegate.m_data, 1 )
17591 * self._delegate.data_len = 0
17593 ((struct __pyx_obj_9csamtools_AlignedRead *)__pyx_v_self)->_delegate->m_data = 40;
17595 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1897
17596 * # so allocate 40 bytes for a new read
17597 * self._delegate.m_data = 40
17598 * self._delegate.data = <uint8_t *>calloc( self._delegate.m_data, 1 ) # <<<<<<<<<<<<<<
17599 * self._delegate.data_len = 0
17602 ((struct __pyx_obj_9csamtools_AlignedRead *)__pyx_v_self)->_delegate->data = ((uint8_t *)calloc(((struct __pyx_obj_9csamtools_AlignedRead *)__pyx_v_self)->_delegate->m_data, 1));
17604 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1898
17605 * self._delegate.m_data = 40
17606 * self._delegate.data = <uint8_t *>calloc( self._delegate.m_data, 1 )
17607 * self._delegate.data_len = 0 # <<<<<<<<<<<<<<
17609 * def __dealloc__(self):
17611 ((struct __pyx_obj_9csamtools_AlignedRead *)__pyx_v_self)->_delegate->data_len = 0;
17614 __Pyx_TraceReturn(Py_None);
17615 __Pyx_RefNannyFinishContext();
17619 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1900
17620 * self._delegate.data_len = 0
17622 * def __dealloc__(self): # <<<<<<<<<<<<<<
17623 * bam_destroy1(self._delegate)
17627 static void __pyx_pf_9csamtools_11AlignedRead___dealloc__(PyObject *__pyx_v_self); /*proto*/
17628 static void __pyx_pf_9csamtools_11AlignedRead___dealloc__(PyObject *__pyx_v_self) {
17629 __Pyx_TraceDeclarations
17630 __Pyx_RefNannySetupContext("__dealloc__");
17631 __Pyx_TraceCall("__dealloc__", __pyx_f[0], 1900);
17633 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1901
17635 * def __dealloc__(self):
17636 * bam_destroy1(self._delegate) # <<<<<<<<<<<<<<
17638 * def __str__(self):
17640 bam_destroy1(((struct __pyx_obj_9csamtools_AlignedRead *)__pyx_v_self)->_delegate);
17642 __Pyx_TraceReturn(Py_None);
17643 __Pyx_RefNannyFinishContext();
17646 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1903
17647 * bam_destroy1(self._delegate)
17649 * def __str__(self): # <<<<<<<<<<<<<<
17650 * """return string representation of alignment.
17654 static PyObject *__pyx_pf_9csamtools_11AlignedRead___str__(PyObject *__pyx_v_self); /*proto*/
17655 static char __pyx_doc_9csamtools_11AlignedRead___str__[] = "return string representation of alignment.\n\n The representation is an approximate :term:`sam` format.\n\n An aligned read might not be associated with a :term:`Samfile`.\n As a result :term:`tid` is shown instead of the reference name.\n\n Similarly, the tags field is returned in its parsed state.\n ";
17656 struct wrapperbase __pyx_wrapperbase_9csamtools_11AlignedRead___str__;
17657 static PyObject *__pyx_pf_9csamtools_11AlignedRead___str__(PyObject *__pyx_v_self) {
17658 PyObject *__pyx_r = NULL;
17659 PyObject *__pyx_t_1 = NULL;
17660 PyObject *__pyx_t_2 = NULL;
17661 PyObject *__pyx_t_3 = NULL;
17662 PyObject *__pyx_t_4 = NULL;
17663 PyObject *__pyx_t_5 = NULL;
17664 PyObject *__pyx_t_6 = NULL;
17665 PyObject *__pyx_t_7 = NULL;
17666 PyObject *__pyx_t_8 = NULL;
17667 PyObject *__pyx_t_9 = NULL;
17668 PyObject *__pyx_t_10 = NULL;
17669 PyObject *__pyx_t_11 = NULL;
17670 PyObject *__pyx_t_12 = NULL;
17671 PyObject *__pyx_t_13 = NULL;
17672 PyObject *__pyx_t_14 = NULL;
17673 __Pyx_TraceDeclarations
17674 __Pyx_RefNannySetupContext("__str__");
17675 __Pyx_TraceCall("__str__", __pyx_f[0], 1903);
17677 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1915
17678 * # sam-parsing is done in sam.c/bam_format1_core which
17679 * # requires a valid header.
17680 * return "\t".join(map(str, (self.qname, # <<<<<<<<<<<<<<
17684 __Pyx_XDECREF(__pyx_r);
17685 __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 = 1915; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17686 __Pyx_GOTREF(__pyx_t_1);
17687 __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__qname); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1915; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17688 __Pyx_GOTREF(__pyx_t_2);
17690 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1916
17691 * # requires a valid header.
17692 * return "\t".join(map(str, (self.qname,
17693 * self.flag, # <<<<<<<<<<<<<<
17697 __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__flag); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1916; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17698 __Pyx_GOTREF(__pyx_t_3);
17700 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1917
17701 * return "\t".join(map(str, (self.qname,
17703 * self.rname, # <<<<<<<<<<<<<<
17707 __pyx_t_4 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__rname); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1917; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17708 __Pyx_GOTREF(__pyx_t_4);
17710 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1918
17713 * self.pos, # <<<<<<<<<<<<<<
17717 __pyx_t_5 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__pos); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1918; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17718 __Pyx_GOTREF(__pyx_t_5);
17720 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1919
17723 * self.mapq, # <<<<<<<<<<<<<<
17727 __pyx_t_6 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__mapq); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1919; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17728 __Pyx_GOTREF(__pyx_t_6);
17730 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1920
17733 * self.cigar, # <<<<<<<<<<<<<<
17737 __pyx_t_7 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__cigar); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1920; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17738 __Pyx_GOTREF(__pyx_t_7);
17740 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1921
17743 * self.mrnm, # <<<<<<<<<<<<<<
17747 __pyx_t_8 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__mrnm); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1921; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17748 __Pyx_GOTREF(__pyx_t_8);
17750 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1922
17753 * self.mpos, # <<<<<<<<<<<<<<
17757 __pyx_t_9 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__mpos); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17758 __Pyx_GOTREF(__pyx_t_9);
17760 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1923
17763 * self.rlen, # <<<<<<<<<<<<<<
17767 __pyx_t_10 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__rlen); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1923; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17768 __Pyx_GOTREF(__pyx_t_10);
17770 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1924
17773 * self.seq, # <<<<<<<<<<<<<<
17777 __pyx_t_11 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__seq); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1924; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17778 __Pyx_GOTREF(__pyx_t_11);
17780 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1925
17783 * self.qual, # <<<<<<<<<<<<<<
17787 __pyx_t_12 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__qual); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1925; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17788 __Pyx_GOTREF(__pyx_t_12);
17790 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1926
17793 * self.tags ))) # <<<<<<<<<<<<<<
17795 * def compare(self, AlignedRead other):
17797 __pyx_t_13 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__tags); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1926; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17798 __Pyx_GOTREF(__pyx_t_13);
17799 __pyx_t_14 = PyTuple_New(12); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1915; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17800 __Pyx_GOTREF(__pyx_t_14);
17801 PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_2);
17802 __Pyx_GIVEREF(__pyx_t_2);
17803 PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_t_3);
17804 __Pyx_GIVEREF(__pyx_t_3);
17805 PyTuple_SET_ITEM(__pyx_t_14, 2, __pyx_t_4);
17806 __Pyx_GIVEREF(__pyx_t_4);
17807 PyTuple_SET_ITEM(__pyx_t_14, 3, __pyx_t_5);
17808 __Pyx_GIVEREF(__pyx_t_5);
17809 PyTuple_SET_ITEM(__pyx_t_14, 4, __pyx_t_6);
17810 __Pyx_GIVEREF(__pyx_t_6);
17811 PyTuple_SET_ITEM(__pyx_t_14, 5, __pyx_t_7);
17812 __Pyx_GIVEREF(__pyx_t_7);
17813 PyTuple_SET_ITEM(__pyx_t_14, 6, __pyx_t_8);
17814 __Pyx_GIVEREF(__pyx_t_8);
17815 PyTuple_SET_ITEM(__pyx_t_14, 7, __pyx_t_9);
17816 __Pyx_GIVEREF(__pyx_t_9);
17817 PyTuple_SET_ITEM(__pyx_t_14, 8, __pyx_t_10);
17818 __Pyx_GIVEREF(__pyx_t_10);
17819 PyTuple_SET_ITEM(__pyx_t_14, 9, __pyx_t_11);
17820 __Pyx_GIVEREF(__pyx_t_11);
17821 PyTuple_SET_ITEM(__pyx_t_14, 10, __pyx_t_12);
17822 __Pyx_GIVEREF(__pyx_t_12);
17823 PyTuple_SET_ITEM(__pyx_t_14, 11, __pyx_t_13);
17824 __Pyx_GIVEREF(__pyx_t_13);
17837 __pyx_t_13 = PyTuple_New(2); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1915; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17838 __Pyx_GOTREF(__pyx_t_13);
17839 __Pyx_INCREF(((PyObject *)((PyObject*)&PyString_Type)));
17840 PyTuple_SET_ITEM(__pyx_t_13, 0, ((PyObject *)((PyObject*)&PyString_Type)));
17841 __Pyx_GIVEREF(((PyObject *)((PyObject*)&PyString_Type)));
17842 PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_14);
17843 __Pyx_GIVEREF(__pyx_t_14);
17845 __pyx_t_14 = PyObject_Call(__pyx_builtin_map, __pyx_t_13, NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1915; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17846 __Pyx_GOTREF(__pyx_t_14);
17847 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
17848 __pyx_t_13 = PyTuple_New(1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1915; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17849 __Pyx_GOTREF(__pyx_t_13);
17850 PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_14);
17851 __Pyx_GIVEREF(__pyx_t_14);
17853 __pyx_t_14 = PyObject_Call(__pyx_t_1, __pyx_t_13, NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1915; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17854 __Pyx_GOTREF(__pyx_t_14);
17855 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17856 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
17857 __pyx_r = __pyx_t_14;
17861 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
17864 __Pyx_XDECREF(__pyx_t_1);
17865 __Pyx_XDECREF(__pyx_t_2);
17866 __Pyx_XDECREF(__pyx_t_3);
17867 __Pyx_XDECREF(__pyx_t_4);
17868 __Pyx_XDECREF(__pyx_t_5);
17869 __Pyx_XDECREF(__pyx_t_6);
17870 __Pyx_XDECREF(__pyx_t_7);
17871 __Pyx_XDECREF(__pyx_t_8);
17872 __Pyx_XDECREF(__pyx_t_9);
17873 __Pyx_XDECREF(__pyx_t_10);
17874 __Pyx_XDECREF(__pyx_t_11);
17875 __Pyx_XDECREF(__pyx_t_12);
17876 __Pyx_XDECREF(__pyx_t_13);
17877 __Pyx_XDECREF(__pyx_t_14);
17878 __Pyx_AddTraceback("csamtools.AlignedRead.__str__");
17881 __Pyx_XGIVEREF(__pyx_r);
17882 __Pyx_TraceReturn(__pyx_r);
17883 __Pyx_RefNannyFinishContext();
17887 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1928
17890 * def compare(self, AlignedRead other): # <<<<<<<<<<<<<<
17891 * '''return -1,0,1, if contents in this are binary <,=,> to *other*'''
17895 static PyObject *__pyx_pf_9csamtools_11AlignedRead_compare(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
17896 static char __pyx_doc_9csamtools_11AlignedRead_compare[] = "AlignedRead.compare(self, AlignedRead other)\nreturn -1,0,1, if contents in this are binary <,=,> to *other*";
17897 static PyObject *__pyx_pf_9csamtools_11AlignedRead_compare(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
17898 int __pyx_v_retval;
17901 PyObject *__pyx_r = NULL;
17903 PyObject *__pyx_t_2 = NULL;
17904 PyObject *__pyx_t_3 = NULL;
17905 PyObject *__pyx_t_4 = NULL;
17907 __Pyx_TraceDeclarations
17908 __Pyx_RefNannySetupContext("compare");
17909 __Pyx_TraceCall("compare", __pyx_f[0], 1928);
17910 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_9csamtools_AlignedRead, 1, "other", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1928; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17912 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1934
17913 * cdef bam1_t *t, *o
17915 * t = self._delegate # <<<<<<<<<<<<<<
17916 * o = other._delegate
17919 __pyx_v_t = ((struct __pyx_obj_9csamtools_AlignedRead *)__pyx_v_self)->_delegate;
17921 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1935
17923 * t = self._delegate
17924 * o = other._delegate # <<<<<<<<<<<<<<
17926 * # uncomment for debugging purposes
17928 __pyx_v_o = ((struct __pyx_obj_9csamtools_AlignedRead *)__pyx_v_other)->_delegate;
17930 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1947
17932 * # Fast-path test for object identity
17933 * if t==o: # <<<<<<<<<<<<<<
17937 __pyx_t_1 = (__pyx_v_t == __pyx_v_o);
17940 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1948
17941 * # Fast-path test for object identity
17943 * return 0 # <<<<<<<<<<<<<<
17945 * retval = memcmp(&t.core, &o.core, sizeof(bam1_core_t))
17947 __Pyx_XDECREF(__pyx_r);
17948 __Pyx_INCREF(__pyx_int_0);
17949 __pyx_r = __pyx_int_0;
17955 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1950
17958 * retval = memcmp(&t.core, &o.core, sizeof(bam1_core_t)) # <<<<<<<<<<<<<<
17960 * if retval: return retval
17962 __pyx_v_retval = memcmp((&__pyx_v_t->core), (&__pyx_v_o->core), (sizeof(bam1_core_t)));
17964 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1952
17965 * retval = memcmp(&t.core, &o.core, sizeof(bam1_core_t))
17967 * if retval: return retval # <<<<<<<<<<<<<<
17968 * retval = cmp(t.data_len, o.data_len)
17969 * if retval: return retval
17971 if (__pyx_v_retval) {
17972 __Pyx_XDECREF(__pyx_r);
17973 __pyx_t_2 = PyInt_FromLong(__pyx_v_retval); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1952; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17974 __Pyx_GOTREF(__pyx_t_2);
17975 __pyx_r = __pyx_t_2;
17982 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1953
17984 * if retval: return retval
17985 * retval = cmp(t.data_len, o.data_len) # <<<<<<<<<<<<<<
17986 * if retval: return retval
17987 * return memcmp(t.data, o.data, t.data_len)
17989 __pyx_t_2 = PyInt_FromLong(__pyx_v_t->data_len); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1953; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17990 __Pyx_GOTREF(__pyx_t_2);
17991 __pyx_t_3 = PyInt_FromLong(__pyx_v_o->data_len); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1953; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17992 __Pyx_GOTREF(__pyx_t_3);
17993 __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1953; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17994 __Pyx_GOTREF(__pyx_t_4);
17995 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
17996 __Pyx_GIVEREF(__pyx_t_2);
17997 PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
17998 __Pyx_GIVEREF(__pyx_t_3);
18001 __pyx_t_3 = PyObject_Call(__pyx_builtin_cmp, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1953; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
18002 __Pyx_GOTREF(__pyx_t_3);
18003 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
18004 __pyx_t_5 = __Pyx_PyInt_AsInt(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1953; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
18005 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18006 __pyx_v_retval = __pyx_t_5;
18008 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1954
18009 * if retval: return retval
18010 * retval = cmp(t.data_len, o.data_len)
18011 * if retval: return retval # <<<<<<<<<<<<<<
18012 * return memcmp(t.data, o.data, t.data_len)
18015 if (__pyx_v_retval) {
18016 __Pyx_XDECREF(__pyx_r);
18017 __pyx_t_3 = PyInt_FromLong(__pyx_v_retval); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1954; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
18018 __Pyx_GOTREF(__pyx_t_3);
18019 __pyx_r = __pyx_t_3;
18026 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1955
18027 * retval = cmp(t.data_len, o.data_len)
18028 * if retval: return retval
18029 * return memcmp(t.data, o.data, t.data_len) # <<<<<<<<<<<<<<
18031 * # Disabled so long as __cmp__ is a special method
18033 __Pyx_XDECREF(__pyx_r);
18034 __pyx_t_3 = PyInt_FromLong(memcmp(__pyx_v_t->data, __pyx_v_o->data, __pyx_v_t->data_len)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1955; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
18035 __Pyx_GOTREF(__pyx_t_3);
18036 __pyx_r = __pyx_t_3;
18040 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
18043 __Pyx_XDECREF(__pyx_t_2);
18044 __Pyx_XDECREF(__pyx_t_3);
18045 __Pyx_XDECREF(__pyx_t_4);
18046 __Pyx_AddTraceback("csamtools.AlignedRead.compare");
18049 __Pyx_XGIVEREF(__pyx_r);
18050 __Pyx_TraceReturn(__pyx_r);
18051 __Pyx_RefNannyFinishContext();
18055 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1958
18057 * # Disabled so long as __cmp__ is a special method
18058 * def __hash__(self): # <<<<<<<<<<<<<<
18059 * return _Py_HashPointer(<void *>self)
18063 static long __pyx_pf_9csamtools_11AlignedRead___hash__(PyObject *__pyx_v_self); /*proto*/
18064 static long __pyx_pf_9csamtools_11AlignedRead___hash__(PyObject *__pyx_v_self) {
18066 __Pyx_TraceDeclarations
18067 __Pyx_RefNannySetupContext("__hash__");
18068 __Pyx_TraceCall("__hash__", __pyx_f[0], 1958);
18070 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1959
18071 * # Disabled so long as __cmp__ is a special method
18072 * def __hash__(self):
18073 * return _Py_HashPointer(<void *>self) # <<<<<<<<<<<<<<
18077 __pyx_r = _Py_HashPointer(((void *)__pyx_v_self));
18082 if (unlikely(__pyx_r == -1) && !PyErr_Occurred()) __pyx_r = -2;
18083 __Pyx_TraceReturn(Py_None);
18084 __Pyx_RefNannyFinishContext();
18088 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1963
18090 * """the query name (None if not present)"""
18091 * def __get__(self): # <<<<<<<<<<<<<<
18092 * cdef bam1_t * src
18093 * src = self._delegate
18096 static PyObject *__pyx_pf_9csamtools_11AlignedRead_5qname___get__(PyObject *__pyx_v_self); /*proto*/
18097 static PyObject *__pyx_pf_9csamtools_11AlignedRead_5qname___get__(PyObject *__pyx_v_self) {
18098 bam1_t *__pyx_v_src;
18099 PyObject *__pyx_r = NULL;
18101 PyObject *__pyx_t_2 = NULL;
18102 __Pyx_TraceDeclarations
18103 __Pyx_RefNannySetupContext("__get__");
18104 __Pyx_TraceCall("__get__", __pyx_f[0], 1963);
18106 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1965
18107 * def __get__(self):
18108 * cdef bam1_t * src
18109 * src = self._delegate # <<<<<<<<<<<<<<
18110 * if src.core.l_qname == 0: return None
18111 * return <char *>bam1_qname( src )
18113 __pyx_v_src = ((struct __pyx_obj_9csamtools_AlignedRead *)__pyx_v_self)->_delegate;
18115 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1966
18116 * cdef bam1_t * src
18117 * src = self._delegate
18118 * if src.core.l_qname == 0: return None # <<<<<<<<<<<<<<
18119 * return <char *>bam1_qname( src )
18122 __pyx_t_1 = (__pyx_v_src->core.l_qname == 0);
18124 __Pyx_XDECREF(__pyx_r);
18125 __Pyx_INCREF(Py_None);
18132 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1967
18133 * src = self._delegate
18134 * if src.core.l_qname == 0: return None
18135 * return <char *>bam1_qname( src ) # <<<<<<<<<<<<<<
18137 * def __set__(self, qname ):
18139 __Pyx_XDECREF(__pyx_r);
18140 __pyx_t_2 = PyBytes_FromString(bam1_qname(__pyx_v_src)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1967; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
18141 __Pyx_GOTREF(((PyObject *)__pyx_t_2));
18142 __pyx_r = ((PyObject *)__pyx_t_2);
18146 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
18149 __Pyx_XDECREF(__pyx_t_2);
18150 __Pyx_AddTraceback("csamtools.AlignedRead.qname.__get__");
18153 __Pyx_XGIVEREF(__pyx_r);
18154 __Pyx_TraceReturn(__pyx_r);
18155 __Pyx_RefNannyFinishContext();
18159 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1969
18160 * return <char *>bam1_qname( src )
18162 * def __set__(self, qname ): # <<<<<<<<<<<<<<
18163 * if qname == None or len(qname) == 0: return
18164 * cdef bam1_t * src
18167 static int __pyx_pf_9csamtools_11AlignedRead_5qname___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_qname); /*proto*/
18168 static int __pyx_pf_9csamtools_11AlignedRead_5qname___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_qname) {
18169 bam1_t *__pyx_v_src;
18173 PyObject *__pyx_t_1 = NULL;
18175 Py_ssize_t __pyx_t_3;
18179 __Pyx_TraceDeclarations
18180 __Pyx_RefNannySetupContext("__set__");
18181 __Pyx_TraceCall("__set__", __pyx_f[0], 1969);
18183 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1970
18185 * def __set__(self, qname ):
18186 * if qname == None or len(qname) == 0: return # <<<<<<<<<<<<<<
18187 * cdef bam1_t * src
18190 __pyx_t_1 = PyObject_RichCompare(__pyx_v_qname, Py_None, Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1970; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
18191 __Pyx_GOTREF(__pyx_t_1);
18192 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1970; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
18193 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18195 __pyx_t_3 = PyObject_Length(__pyx_v_qname); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1970; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
18196 __pyx_t_4 = (__pyx_t_3 == 0);
18197 __pyx_t_5 = __pyx_t_4;
18199 __pyx_t_5 = __pyx_t_2;
18208 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1975
18211 * src = self._delegate # <<<<<<<<<<<<<<
18212 * p = bam1_qname( src )
18215 __pyx_v_src = ((struct __pyx_obj_9csamtools_AlignedRead *)__pyx_v_self)->_delegate;
18217 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1976
18219 * src = self._delegate
18220 * p = bam1_qname( src ) # <<<<<<<<<<<<<<
18222 * # the qname is \0 terminated
18224 __pyx_v_p = bam1_qname(__pyx_v_src);
18226 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1979
18228 * # the qname is \0 terminated
18229 * l = len(qname) + 1 # <<<<<<<<<<<<<<
18230 * pysam_bam_update( src,
18231 * src.core.l_qname,
18233 __pyx_t_3 = PyObject_Length(__pyx_v_qname); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1979; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
18234 __pyx_v_l = (__pyx_t_3 + 1);
18236 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1983
18237 * src.core.l_qname,
18239 * <uint8_t*>p ) # <<<<<<<<<<<<<<
18241 * src.core.l_qname = l
18243 pysam_bam_update(__pyx_v_src, __pyx_v_src->core.l_qname, __pyx_v_l, ((uint8_t *)__pyx_v_p));
18245 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1985
18248 * src.core.l_qname = l # <<<<<<<<<<<<<<
18250 * # re-acquire pointer to location in memory
18252 __pyx_v_src->core.l_qname = __pyx_v_l;
18254 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1989
18255 * # re-acquire pointer to location in memory
18256 * # as it might have moved
18257 * p = bam1_qname(src) # <<<<<<<<<<<<<<
18259 * strncpy( p, qname, l )
18261 __pyx_v_p = bam1_qname(__pyx_v_src);
18263 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1991
18264 * p = bam1_qname(src)
18266 * strncpy( p, qname, l ) # <<<<<<<<<<<<<<
18270 __pyx_t_6 = PyBytes_AsString(__pyx_v_qname); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1991; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
18271 strncpy(__pyx_v_p, __pyx_t_6, __pyx_v_l);
18276 __Pyx_XDECREF(__pyx_t_1);
18277 __Pyx_AddTraceback("csamtools.AlignedRead.qname.__set__");
18280 __Pyx_TraceReturn(Py_None);
18281 __Pyx_RefNannyFinishContext();
18285 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1996
18286 * """the :term:`cigar` alignment (None if not present).
18288 * def __get__(self): # <<<<<<<<<<<<<<
18289 * cdef uint32_t * cigar_p
18290 * cdef bam1_t * src
18293 static PyObject *__pyx_pf_9csamtools_11AlignedRead_5cigar___get__(PyObject *__pyx_v_self); /*proto*/
18294 static PyObject *__pyx_pf_9csamtools_11AlignedRead_5cigar___get__(PyObject *__pyx_v_self) {
18295 uint32_t *__pyx_v_cigar_p;
18296 bam1_t *__pyx_v_src;
18297 PyObject *__pyx_v_op;
18298 PyObject *__pyx_v_l;
18299 PyObject *__pyx_v_cigar;
18301 PyObject *__pyx_r = NULL;
18303 PyObject *__pyx_t_2 = NULL;
18304 uint32_t __pyx_t_3;
18305 PyObject *__pyx_t_4 = NULL;
18306 __Pyx_TraceDeclarations
18307 __Pyx_RefNannySetupContext("__get__");
18308 __Pyx_TraceCall("__get__", __pyx_f[0], 1996);
18309 __pyx_v_op = Py_None; __Pyx_INCREF(Py_None);
18310 __pyx_v_l = Py_None; __Pyx_INCREF(Py_None);
18311 __pyx_v_cigar = Py_None; __Pyx_INCREF(Py_None);
18313 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2002
18316 * src = self._delegate # <<<<<<<<<<<<<<
18317 * if src.core.n_cigar == 0: return None
18320 __pyx_v_src = ((struct __pyx_obj_9csamtools_AlignedRead *)__pyx_v_self)->_delegate;
18322 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2003
18324 * src = self._delegate
18325 * if src.core.n_cigar == 0: return None # <<<<<<<<<<<<<<
18329 __pyx_t_1 = (__pyx_v_src->core.n_cigar == 0);
18331 __Pyx_XDECREF(__pyx_r);
18332 __Pyx_INCREF(Py_None);
18339 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2005
18340 * if src.core.n_cigar == 0: return None
18342 * cigar = [] # <<<<<<<<<<<<<<
18343 * cigar_p = bam1_cigar(src);
18344 * for k from 0 <= k < src.core.n_cigar:
18346 __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2005; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
18347 __Pyx_GOTREF(((PyObject *)__pyx_t_2));
18348 __Pyx_DECREF(__pyx_v_cigar);
18349 __pyx_v_cigar = ((PyObject *)__pyx_t_2);
18352 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2006
18355 * cigar_p = bam1_cigar(src); # <<<<<<<<<<<<<<
18356 * for k from 0 <= k < src.core.n_cigar:
18357 * op = cigar_p[k] & BAM_CIGAR_MASK
18359 __pyx_v_cigar_p = bam1_cigar(__pyx_v_src);
18361 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2007
18363 * cigar_p = bam1_cigar(src);
18364 * for k from 0 <= k < src.core.n_cigar: # <<<<<<<<<<<<<<
18365 * op = cigar_p[k] & BAM_CIGAR_MASK
18366 * l = cigar_p[k] >> BAM_CIGAR_SHIFT
18368 __pyx_t_3 = __pyx_v_src->core.n_cigar;
18369 for (__pyx_v_k = 0; __pyx_v_k < __pyx_t_3; __pyx_v_k++) {
18371 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2008
18372 * cigar_p = bam1_cigar(src);
18373 * for k from 0 <= k < src.core.n_cigar:
18374 * op = cigar_p[k] & BAM_CIGAR_MASK # <<<<<<<<<<<<<<
18375 * l = cigar_p[k] >> BAM_CIGAR_SHIFT
18376 * cigar.append((op, l))
18378 __pyx_t_2 = PyInt_FromLong(((__pyx_v_cigar_p[__pyx_v_k]) & 15)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2008; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
18379 __Pyx_GOTREF(__pyx_t_2);
18380 __Pyx_DECREF(__pyx_v_op);
18381 __pyx_v_op = __pyx_t_2;
18384 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2009
18385 * for k from 0 <= k < src.core.n_cigar:
18386 * op = cigar_p[k] & BAM_CIGAR_MASK
18387 * l = cigar_p[k] >> BAM_CIGAR_SHIFT # <<<<<<<<<<<<<<
18388 * cigar.append((op, l))
18391 __pyx_t_2 = PyInt_FromLong(((__pyx_v_cigar_p[__pyx_v_k]) >> 4)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2009; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
18392 __Pyx_GOTREF(__pyx_t_2);
18393 __Pyx_DECREF(__pyx_v_l);
18394 __pyx_v_l = __pyx_t_2;
18397 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2010
18398 * op = cigar_p[k] & BAM_CIGAR_MASK
18399 * l = cigar_p[k] >> BAM_CIGAR_SHIFT
18400 * cigar.append((op, l)) # <<<<<<<<<<<<<<
18404 __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2010; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
18405 __Pyx_GOTREF(__pyx_t_2);
18406 __Pyx_INCREF(__pyx_v_op);
18407 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_op);
18408 __Pyx_GIVEREF(__pyx_v_op);
18409 __Pyx_INCREF(__pyx_v_l);
18410 PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_l);
18411 __Pyx_GIVEREF(__pyx_v_l);
18412 __pyx_t_4 = __Pyx_PyObject_Append(__pyx_v_cigar, __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2010; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
18413 __Pyx_GOTREF(__pyx_t_4);
18414 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18415 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
18418 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2011
18419 * l = cigar_p[k] >> BAM_CIGAR_SHIFT
18420 * cigar.append((op, l))
18421 * return cigar # <<<<<<<<<<<<<<
18423 * def __set__(self, values ):
18425 __Pyx_XDECREF(__pyx_r);
18426 __Pyx_INCREF(__pyx_v_cigar);
18427 __pyx_r = __pyx_v_cigar;
18430 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
18433 __Pyx_XDECREF(__pyx_t_2);
18434 __Pyx_XDECREF(__pyx_t_4);
18435 __Pyx_AddTraceback("csamtools.AlignedRead.cigar.__get__");
18438 __Pyx_DECREF(__pyx_v_op);
18439 __Pyx_DECREF(__pyx_v_l);
18440 __Pyx_DECREF(__pyx_v_cigar);
18441 __Pyx_XGIVEREF(__pyx_r);
18442 __Pyx_TraceReturn(__pyx_r);
18443 __Pyx_RefNannyFinishContext();
18447 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2013
18450 * def __set__(self, values ): # <<<<<<<<<<<<<<
18451 * if values == None or len(values) == 0: return
18452 * cdef uint32_t * p
18455 static int __pyx_pf_9csamtools_11AlignedRead_5cigar___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_values); /*proto*/
18456 static int __pyx_pf_9csamtools_11AlignedRead_5cigar___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_values) {
18457 uint32_t *__pyx_v_p;
18458 bam1_t *__pyx_v_src;
18459 PyObject *__pyx_v_op;
18460 PyObject *__pyx_v_l;
18463 PyObject *__pyx_t_1 = NULL;
18465 Py_ssize_t __pyx_t_3;
18468 PyObject *__pyx_t_6 = NULL;
18469 PyObject *__pyx_t_7 = NULL;
18470 PyObject *__pyx_t_8 = NULL;
18471 PyObject *__pyx_t_9 = NULL;
18472 uint32_t __pyx_t_10;
18473 __Pyx_TraceDeclarations
18474 __Pyx_RefNannySetupContext("__set__");
18475 __Pyx_TraceCall("__set__", __pyx_f[0], 2013);
18476 __pyx_v_op = Py_None; __Pyx_INCREF(Py_None);
18477 __pyx_v_l = Py_None; __Pyx_INCREF(Py_None);
18479 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2014
18481 * def __set__(self, values ):
18482 * if values == None or len(values) == 0: return # <<<<<<<<<<<<<<
18483 * cdef uint32_t * p
18484 * cdef bam1_t * src
18486 __pyx_t_1 = PyObject_RichCompare(__pyx_v_values, Py_None, Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2014; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
18487 __Pyx_GOTREF(__pyx_t_1);
18488 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2014; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
18489 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18491 __pyx_t_3 = PyObject_Length(__pyx_v_values); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2014; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
18492 __pyx_t_4 = (__pyx_t_3 == 0);
18493 __pyx_t_5 = __pyx_t_4;
18495 __pyx_t_5 = __pyx_t_2;
18504 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2020
18507 * k = 0 # <<<<<<<<<<<<<<
18509 * src = self._delegate
18513 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2022
18516 * src = self._delegate # <<<<<<<<<<<<<<
18518 * # get location of cigar string
18520 __pyx_v_src = ((struct __pyx_obj_9csamtools_AlignedRead *)__pyx_v_self)->_delegate;
18522 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2025
18524 * # get location of cigar string
18525 * p = bam1_cigar(src) # <<<<<<<<<<<<<<
18527 * # create space for cigar data within src.data
18529 __pyx_v_p = bam1_cigar(__pyx_v_src);
18531 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2030
18532 * pysam_bam_update( src,
18533 * src.core.n_cigar * 4,
18534 * len(values) * 4, # <<<<<<<<<<<<<<
18538 __pyx_t_3 = PyObject_Length(__pyx_v_values); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2030; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
18540 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2031
18541 * src.core.n_cigar * 4,
18543 * <uint8_t*>p ) # <<<<<<<<<<<<<<
18545 * # length is number of cigar operations, not bytes
18547 pysam_bam_update(__pyx_v_src, (__pyx_v_src->core.n_cigar * 4), (__pyx_t_3 * 4), ((uint8_t *)__pyx_v_p));
18549 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2034
18551 * # length is number of cigar operations, not bytes
18552 * src.core.n_cigar = len(values) # <<<<<<<<<<<<<<
18554 * # re-acquire pointer to location in memory
18556 __pyx_t_3 = PyObject_Length(__pyx_v_values); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2034; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
18557 __pyx_v_src->core.n_cigar = __pyx_t_3;
18559 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2038
18560 * # re-acquire pointer to location in memory
18561 * # as it might have moved
18562 * p = bam1_cigar(src) # <<<<<<<<<<<<<<
18564 * # insert cigar operations
18566 __pyx_v_p = bam1_cigar(__pyx_v_src);
18568 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2041
18570 * # insert cigar operations
18571 * for op, l in values: # <<<<<<<<<<<<<<
18572 * p[k] = l << BAM_CIGAR_SHIFT | op
18575 if (PyList_CheckExact(__pyx_v_values) || PyTuple_CheckExact(__pyx_v_values)) {
18576 __pyx_t_3 = 0; __pyx_t_1 = __pyx_v_values; __Pyx_INCREF(__pyx_t_1);
18578 __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_values); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2041; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
18579 __Pyx_GOTREF(__pyx_t_1);
18582 if (likely(PyList_CheckExact(__pyx_t_1))) {
18583 if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break;
18584 __pyx_t_6 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_6); __pyx_t_3++;
18585 } else if (likely(PyTuple_CheckExact(__pyx_t_1))) {
18586 if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
18587 __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_6); __pyx_t_3++;
18589 __pyx_t_6 = PyIter_Next(__pyx_t_1);
18591 if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2041; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
18594 __Pyx_GOTREF(__pyx_t_6);
18596 if (PyTuple_CheckExact(__pyx_t_6) && likely(PyTuple_GET_SIZE(__pyx_t_6) == 2)) {
18597 PyObject* tuple = __pyx_t_6;
18598 __pyx_t_7 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_7);
18599 __pyx_t_8 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_8);
18600 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
18601 __Pyx_DECREF(__pyx_v_op);
18602 __pyx_v_op = __pyx_t_7;
18604 __Pyx_DECREF(__pyx_v_l);
18605 __pyx_v_l = __pyx_t_8;
18608 __pyx_t_9 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2041; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
18609 __Pyx_GOTREF(__pyx_t_9);
18610 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
18611 __pyx_t_7 = __Pyx_UnpackItem(__pyx_t_9, 0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2041; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
18612 __Pyx_GOTREF(__pyx_t_7);
18613 __pyx_t_8 = __Pyx_UnpackItem(__pyx_t_9, 1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2041; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
18614 __Pyx_GOTREF(__pyx_t_8);
18615 if (__Pyx_EndUnpack(__pyx_t_9, 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2041; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
18616 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
18617 __Pyx_DECREF(__pyx_v_op);
18618 __pyx_v_op = __pyx_t_7;
18620 __Pyx_DECREF(__pyx_v_l);
18621 __pyx_v_l = __pyx_t_8;
18625 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2042
18626 * # insert cigar operations
18627 * for op, l in values:
18628 * p[k] = l << BAM_CIGAR_SHIFT | op # <<<<<<<<<<<<<<
18632 __pyx_t_6 = PyNumber_Lshift(__pyx_v_l, __pyx_int_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2042; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
18633 __Pyx_GOTREF(__pyx_t_6);
18634 __pyx_t_8 = PyNumber_Or(__pyx_t_6, __pyx_v_op); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2042; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
18635 __Pyx_GOTREF(__pyx_t_8);
18636 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
18637 __pyx_t_10 = __Pyx_PyInt_from_py_uint32_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (uint32_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2042; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
18638 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
18639 (__pyx_v_p[__pyx_v_k]) = __pyx_t_10;
18641 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2043
18642 * for op, l in values:
18643 * p[k] = l << BAM_CIGAR_SHIFT | op
18644 * k += 1 # <<<<<<<<<<<<<<
18646 * ## setting the cigar string also updates the "bin" attribute
18650 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18652 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2046
18654 * ## setting the cigar string also updates the "bin" attribute
18655 * src.core.bin = bam_reg2bin( src.core.pos, bam_calend( &src.core, p)) # <<<<<<<<<<<<<<
18659 __pyx_v_src->core.bin = bam_reg2bin(__pyx_v_src->core.pos, bam_calend((&__pyx_v_src->core), __pyx_v_p));
18664 __Pyx_XDECREF(__pyx_t_1);
18665 __Pyx_XDECREF(__pyx_t_6);
18666 __Pyx_XDECREF(__pyx_t_7);
18667 __Pyx_XDECREF(__pyx_t_8);
18668 __Pyx_XDECREF(__pyx_t_9);
18669 __Pyx_AddTraceback("csamtools.AlignedRead.cigar.__set__");
18672 __Pyx_DECREF(__pyx_v_op);
18673 __Pyx_DECREF(__pyx_v_l);
18674 __Pyx_TraceReturn(Py_None);
18675 __Pyx_RefNannyFinishContext();
18679 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2050
18681 * """read sequence bases, including :term:`soft clipped` bases (None if not present)"""
18682 * def __get__(self): # <<<<<<<<<<<<<<
18683 * cdef bam1_t * src
18687 static PyObject *__pyx_pf_9csamtools_11AlignedRead_3seq___get__(PyObject *__pyx_v_self); /*proto*/
18688 static PyObject *__pyx_pf_9csamtools_11AlignedRead_3seq___get__(PyObject *__pyx_v_self) {
18689 bam1_t *__pyx_v_src;
18690 PyObject *__pyx_r = NULL;
18692 PyObject *__pyx_t_2 = NULL;
18693 __Pyx_TraceDeclarations
18694 __Pyx_RefNannySetupContext("__get__");
18695 __Pyx_TraceCall("__get__", __pyx_f[0], 2050);
18697 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2053
18698 * cdef bam1_t * src
18700 * src = self._delegate # <<<<<<<<<<<<<<
18702 * if src.core.l_qseq == 0: return None
18704 __pyx_v_src = ((struct __pyx_obj_9csamtools_AlignedRead *)__pyx_v_self)->_delegate;
18706 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2055
18707 * src = self._delegate
18709 * if src.core.l_qseq == 0: return None # <<<<<<<<<<<<<<
18711 * return get_seq_range(src, 0, src.core.l_qseq)
18713 __pyx_t_1 = (__pyx_v_src->core.l_qseq == 0);
18715 __Pyx_XDECREF(__pyx_r);
18716 __Pyx_INCREF(Py_None);
18723 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2057
18724 * if src.core.l_qseq == 0: return None
18726 * return get_seq_range(src, 0, src.core.l_qseq) # <<<<<<<<<<<<<<
18728 * def __set__(self,seq):
18730 __Pyx_XDECREF(__pyx_r);
18731 __pyx_t_2 = __pyx_f_9csamtools_get_seq_range(__pyx_v_src, 0, __pyx_v_src->core.l_qseq); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
18732 __Pyx_GOTREF(__pyx_t_2);
18733 __pyx_r = __pyx_t_2;
18737 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
18740 __Pyx_XDECREF(__pyx_t_2);
18741 __Pyx_AddTraceback("csamtools.AlignedRead.seq.__get__");
18744 __Pyx_XGIVEREF(__pyx_r);
18745 __Pyx_TraceReturn(__pyx_r);
18746 __Pyx_RefNannyFinishContext();
18750 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2059
18751 * return get_seq_range(src, 0, src.core.l_qseq)
18753 * def __set__(self,seq): # <<<<<<<<<<<<<<
18754 * # samtools manages sequence and quality length memory together
18755 * # if no quality information is present, the first byte says 0xff.
18758 static int __pyx_pf_9csamtools_11AlignedRead_3seq___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_seq); /*proto*/
18759 static int __pyx_pf_9csamtools_11AlignedRead_3seq___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_seq) {
18760 bam1_t *__pyx_v_src;
18761 uint8_t *__pyx_v_p;
18765 int __pyx_v_nbytes_new;
18766 int __pyx_v_nbytes_old;
18768 PyObject *__pyx_t_1 = NULL;
18770 Py_ssize_t __pyx_t_3;
18775 __Pyx_TraceDeclarations
18776 __Pyx_RefNannySetupContext("__set__");
18777 __Pyx_TraceCall("__set__", __pyx_f[0], 2059);
18779 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2063
18780 * # if no quality information is present, the first byte says 0xff.
18782 * if seq == None or len(seq) == 0: return # <<<<<<<<<<<<<<
18783 * cdef bam1_t * src
18786 __pyx_t_1 = PyObject_RichCompare(__pyx_v_seq, Py_None, Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2063; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
18787 __Pyx_GOTREF(__pyx_t_1);
18788 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2063; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
18789 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18791 __pyx_t_3 = PyObject_Length(__pyx_v_seq); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2063; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
18792 __pyx_t_4 = (__pyx_t_3 == 0);
18793 __pyx_t_5 = __pyx_t_4;
18795 __pyx_t_5 = __pyx_t_2;
18804 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2069
18805 * cdef int l, k, nbytes_new, nbytes_old
18807 * src = self._delegate # <<<<<<<<<<<<<<
18811 __pyx_v_src = ((struct __pyx_obj_9csamtools_AlignedRead *)__pyx_v_self)->_delegate;
18813 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2071
18814 * src = self._delegate
18816 * l = len(seq) # <<<<<<<<<<<<<<
18818 * # as the sequence is stored in half-bytes, the total length (sequence
18820 __pyx_t_3 = PyObject_Length(__pyx_v_seq); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2071; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
18821 __pyx_v_l = __pyx_t_3;
18823 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2075
18824 * # as the sequence is stored in half-bytes, the total length (sequence
18825 * # plus quality scores) is (l+1)/2 + l
18826 * nbytes_new = (l+1)/2 + l # <<<<<<<<<<<<<<
18827 * nbytes_old = (src.core.l_qseq+1)/2 + src.core.l_qseq
18828 * # acquire pointer to location in memory
18830 __pyx_v_nbytes_new = (__Pyx_div_long((__pyx_v_l + 1), 2) + __pyx_v_l);
18832 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2076
18833 * # plus quality scores) is (l+1)/2 + l
18834 * nbytes_new = (l+1)/2 + l
18835 * nbytes_old = (src.core.l_qseq+1)/2 + src.core.l_qseq # <<<<<<<<<<<<<<
18836 * # acquire pointer to location in memory
18837 * p = bam1_seq( src )
18839 __pyx_v_nbytes_old = (__Pyx_div_long((__pyx_v_src->core.l_qseq + 1), 2) + __pyx_v_src->core.l_qseq);
18841 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2078
18842 * nbytes_old = (src.core.l_qseq+1)/2 + src.core.l_qseq
18843 * # acquire pointer to location in memory
18844 * p = bam1_seq( src ) # <<<<<<<<<<<<<<
18845 * src.core.l_qseq = l
18848 __pyx_v_p = bam1_seq(__pyx_v_src);
18850 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2079
18851 * # acquire pointer to location in memory
18852 * p = bam1_seq( src )
18853 * src.core.l_qseq = l # <<<<<<<<<<<<<<
18855 * pysam_bam_update( src,
18857 __pyx_v_src->core.l_qseq = __pyx_v_l;
18859 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2084
18862 * p) # <<<<<<<<<<<<<<
18863 * # re-acquire pointer to location in memory
18864 * # as it might have moved
18866 pysam_bam_update(__pyx_v_src, __pyx_v_nbytes_old, __pyx_v_nbytes_new, __pyx_v_p);
18868 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2087
18869 * # re-acquire pointer to location in memory
18870 * # as it might have moved
18871 * p = bam1_seq( src ) # <<<<<<<<<<<<<<
18872 * for k from 0 <= k < nbytes_new: p[k] = 0
18873 * # convert to C string
18875 __pyx_v_p = bam1_seq(__pyx_v_src);
18877 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2088
18878 * # as it might have moved
18879 * p = bam1_seq( src )
18880 * for k from 0 <= k < nbytes_new: p[k] = 0 # <<<<<<<<<<<<<<
18881 * # convert to C string
18884 __pyx_t_6 = __pyx_v_nbytes_new;
18885 for (__pyx_v_k = 0; __pyx_v_k < __pyx_t_6; __pyx_v_k++) {
18886 (__pyx_v_p[__pyx_v_k]) = 0;
18889 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2090
18890 * for k from 0 <= k < nbytes_new: p[k] = 0
18891 * # convert to C string
18892 * s = seq # <<<<<<<<<<<<<<
18893 * for k from 0 <= k < l:
18894 * p[k/2] |= pysam_translate_sequence(s[k]) << 4 * (1 - k % 2)
18896 __pyx_t_7 = PyBytes_AsString(__pyx_v_seq); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2090; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
18897 __pyx_v_s = __pyx_t_7;
18899 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2091
18900 * # convert to C string
18902 * for k from 0 <= k < l: # <<<<<<<<<<<<<<
18903 * p[k/2] |= pysam_translate_sequence(s[k]) << 4 * (1 - k % 2)
18906 __pyx_t_6 = __pyx_v_l;
18907 for (__pyx_v_k = 0; __pyx_v_k < __pyx_t_6; __pyx_v_k++) {
18909 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2092
18911 * for k from 0 <= k < l:
18912 * p[k/2] |= pysam_translate_sequence(s[k]) << 4 * (1 - k % 2) # <<<<<<<<<<<<<<
18914 * # erase qualities
18916 (__pyx_v_p[__Pyx_div_long(__pyx_v_k, 2)]) |= (pysam_translate_sequence((__pyx_v_s[__pyx_v_k])) << (4 * (1 - __Pyx_mod_long(__pyx_v_k, 2))));
18919 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2095
18921 * # erase qualities
18922 * p = bam1_qual( src ) # <<<<<<<<<<<<<<
18926 __pyx_v_p = bam1_qual(__pyx_v_src);
18928 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2096
18929 * # erase qualities
18930 * p = bam1_qual( src )
18931 * p[0] = 0xff # <<<<<<<<<<<<<<
18935 (__pyx_v_p[0]) = 0xff;
18940 __Pyx_XDECREF(__pyx_t_1);
18941 __Pyx_AddTraceback("csamtools.AlignedRead.seq.__set__");
18944 __Pyx_TraceReturn(Py_None);
18945 __Pyx_RefNannyFinishContext();
18949 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2101
18951 * """read sequence base qualities, including :term:`soft clipped` bases (None if not present)"""
18952 * def __get__(self): # <<<<<<<<<<<<<<
18954 * cdef bam1_t * src
18957 static PyObject *__pyx_pf_9csamtools_11AlignedRead_4qual___get__(PyObject *__pyx_v_self); /*proto*/
18958 static PyObject *__pyx_pf_9csamtools_11AlignedRead_4qual___get__(PyObject *__pyx_v_self) {
18959 bam1_t *__pyx_v_src;
18960 PyObject *__pyx_r = NULL;
18962 PyObject *__pyx_t_2 = NULL;
18963 __Pyx_TraceDeclarations
18964 __Pyx_RefNannySetupContext("__get__");
18965 __Pyx_TraceCall("__get__", __pyx_f[0], 2101);
18967 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2106
18970 * src = self._delegate # <<<<<<<<<<<<<<
18972 * if src.core.l_qseq == 0: return None
18974 __pyx_v_src = ((struct __pyx_obj_9csamtools_AlignedRead *)__pyx_v_self)->_delegate;
18976 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2108
18977 * src = self._delegate
18979 * if src.core.l_qseq == 0: return None # <<<<<<<<<<<<<<
18981 * return get_qual_range(src, 0, src.core.l_qseq)
18983 __pyx_t_1 = (__pyx_v_src->core.l_qseq == 0);
18985 __Pyx_XDECREF(__pyx_r);
18986 __Pyx_INCREF(Py_None);
18993 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2110
18994 * if src.core.l_qseq == 0: return None
18996 * return get_qual_range(src, 0, src.core.l_qseq) # <<<<<<<<<<<<<<
18998 * def __set__(self,qual):
19000 __Pyx_XDECREF(__pyx_r);
19001 __pyx_t_2 = __pyx_f_9csamtools_get_qual_range(__pyx_v_src, 0, __pyx_v_src->core.l_qseq); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
19002 __Pyx_GOTREF(__pyx_t_2);
19003 __pyx_r = __pyx_t_2;
19007 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
19010 __Pyx_XDECREF(__pyx_t_2);
19011 __Pyx_AddTraceback("csamtools.AlignedRead.qual.__get__");
19014 __Pyx_XGIVEREF(__pyx_r);
19015 __Pyx_TraceReturn(__pyx_r);
19016 __Pyx_RefNannyFinishContext();
19020 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2112
19021 * return get_qual_range(src, 0, src.core.l_qseq)
19023 * def __set__(self,qual): # <<<<<<<<<<<<<<
19024 * # note that space is already allocated via the sequences
19025 * cdef bam1_t * src
19028 static int __pyx_pf_9csamtools_11AlignedRead_4qual___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_qual); /*proto*/
19029 static int __pyx_pf_9csamtools_11AlignedRead_4qual___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_qual) {
19030 bam1_t *__pyx_v_src;
19031 uint8_t *__pyx_v_p;
19036 PyObject *__pyx_t_1 = NULL;
19038 Py_ssize_t __pyx_t_3;
19042 PyObject *__pyx_t_7 = NULL;
19043 PyObject *__pyx_t_8 = NULL;
19045 __Pyx_TraceDeclarations
19046 __Pyx_RefNannySetupContext("__set__");
19047 __Pyx_TraceCall("__set__", __pyx_f[0], 2112);
19049 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2119
19052 * src = self._delegate # <<<<<<<<<<<<<<
19053 * p = bam1_qual( src )
19054 * if qual == None or len(qual) == 0:
19056 __pyx_v_src = ((struct __pyx_obj_9csamtools_AlignedRead *)__pyx_v_self)->_delegate;
19058 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2120
19060 * src = self._delegate
19061 * p = bam1_qual( src ) # <<<<<<<<<<<<<<
19062 * if qual == None or len(qual) == 0:
19063 * # if absent - set to 0xff
19065 __pyx_v_p = bam1_qual(__pyx_v_src);
19067 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2121
19068 * src = self._delegate
19069 * p = bam1_qual( src )
19070 * if qual == None or len(qual) == 0: # <<<<<<<<<<<<<<
19071 * # if absent - set to 0xff
19074 __pyx_t_1 = PyObject_RichCompare(__pyx_v_qual, Py_None, Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
19075 __Pyx_GOTREF(__pyx_t_1);
19076 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
19077 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19079 __pyx_t_3 = PyObject_Length(__pyx_v_qual); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
19080 __pyx_t_4 = (__pyx_t_3 == 0);
19081 __pyx_t_5 = __pyx_t_4;
19083 __pyx_t_5 = __pyx_t_2;
19087 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2123
19088 * if qual == None or len(qual) == 0:
19089 * # if absent - set to 0xff
19090 * p[0] = 0xff # <<<<<<<<<<<<<<
19094 (__pyx_v_p[0]) = 0xff;
19096 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2124
19097 * # if absent - set to 0xff
19099 * return # <<<<<<<<<<<<<<
19101 * # convert to C string
19109 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2127
19111 * # convert to C string
19112 * q = qual # <<<<<<<<<<<<<<
19114 * if src.core.l_qseq != l:
19116 __pyx_t_6 = PyBytes_AsString(__pyx_v_qual); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
19117 __pyx_v_q = __pyx_t_6;
19119 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2128
19120 * # convert to C string
19122 * l = len(qual) # <<<<<<<<<<<<<<
19123 * if src.core.l_qseq != l:
19124 * raise ValueError("quality and sequence mismatch: %i != %i" % (l, src.core.l_qseq))
19126 __pyx_t_3 = PyObject_Length(__pyx_v_qual); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
19127 __pyx_v_l = __pyx_t_3;
19129 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2129
19132 * if src.core.l_qseq != l: # <<<<<<<<<<<<<<
19133 * raise ValueError("quality and sequence mismatch: %i != %i" % (l, src.core.l_qseq))
19134 * assert src.core.l_qseq == l
19136 __pyx_t_5 = (__pyx_v_src->core.l_qseq != __pyx_v_l);
19139 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2130
19141 * if src.core.l_qseq != l:
19142 * raise ValueError("quality and sequence mismatch: %i != %i" % (l, src.core.l_qseq)) # <<<<<<<<<<<<<<
19143 * assert src.core.l_qseq == l
19144 * for k from 0 <= k < l:
19146 __pyx_t_1 = PyInt_FromLong(__pyx_v_l); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
19147 __Pyx_GOTREF(__pyx_t_1);
19148 __pyx_t_7 = __Pyx_PyInt_to_py_int32_t(__pyx_v_src->core.l_qseq); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
19149 __Pyx_GOTREF(__pyx_t_7);
19150 __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
19151 __Pyx_GOTREF(__pyx_t_8);
19152 PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_1);
19153 __Pyx_GIVEREF(__pyx_t_1);
19154 PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_7);
19155 __Pyx_GIVEREF(__pyx_t_7);
19158 __pyx_t_7 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_61), __pyx_t_8); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
19159 __Pyx_GOTREF(((PyObject *)__pyx_t_7));
19160 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
19161 __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
19162 __Pyx_GOTREF(__pyx_t_8);
19163 PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)__pyx_t_7));
19164 __Pyx_GIVEREF(((PyObject *)__pyx_t_7));
19166 __pyx_t_7 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
19167 __Pyx_GOTREF(__pyx_t_7);
19168 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
19169 __Pyx_Raise(__pyx_t_7, 0, 0);
19170 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
19171 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
19176 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2131
19177 * if src.core.l_qseq != l:
19178 * raise ValueError("quality and sequence mismatch: %i != %i" % (l, src.core.l_qseq))
19179 * assert src.core.l_qseq == l # <<<<<<<<<<<<<<
19180 * for k from 0 <= k < l:
19181 * p[k] = <uint8_t>q[k] - 33
19183 #ifndef PYREX_WITHOUT_ASSERTIONS
19184 if (unlikely(!(__pyx_v_src->core.l_qseq == __pyx_v_l))) {
19185 PyErr_SetNone(PyExc_AssertionError);
19186 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
19190 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2132
19191 * raise ValueError("quality and sequence mismatch: %i != %i" % (l, src.core.l_qseq))
19192 * assert src.core.l_qseq == l
19193 * for k from 0 <= k < l: # <<<<<<<<<<<<<<
19194 * p[k] = <uint8_t>q[k] - 33
19197 __pyx_t_9 = __pyx_v_l;
19198 for (__pyx_v_k = 0; __pyx_v_k < __pyx_t_9; __pyx_v_k++) {
19200 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2133
19201 * assert src.core.l_qseq == l
19202 * for k from 0 <= k < l:
19203 * p[k] = <uint8_t>q[k] - 33 # <<<<<<<<<<<<<<
19207 (__pyx_v_p[__pyx_v_k]) = (((uint8_t)(__pyx_v_q[__pyx_v_k])) - 33);
19213 __Pyx_XDECREF(__pyx_t_1);
19214 __Pyx_XDECREF(__pyx_t_7);
19215 __Pyx_XDECREF(__pyx_t_8);
19216 __Pyx_AddTraceback("csamtools.AlignedRead.qual.__set__");
19219 __Pyx_TraceReturn(Py_None);
19220 __Pyx_RefNannyFinishContext();
19224 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2145
19225 * were not considered for alignment may have been retained."""
19227 * def __get__(self): # <<<<<<<<<<<<<<
19228 * cdef bam1_t * src
19229 * cdef uint32_t start, end
19232 static PyObject *__pyx_pf_9csamtools_11AlignedRead_5query___get__(PyObject *__pyx_v_self); /*proto*/
19233 static PyObject *__pyx_pf_9csamtools_11AlignedRead_5query___get__(PyObject *__pyx_v_self) {
19234 bam1_t *__pyx_v_src;
19235 uint32_t __pyx_v_start;
19236 uint32_t __pyx_v_end;
19237 PyObject *__pyx_r = NULL;
19240 PyObject *__pyx_t_3 = NULL;
19241 __Pyx_TraceDeclarations
19242 __Pyx_RefNannySetupContext("__get__");
19243 __Pyx_TraceCall("__get__", __pyx_f[0], 2145);
19245 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2150
19248 * src = self._delegate # <<<<<<<<<<<<<<
19250 * if src.core.l_qseq == 0: return None
19252 __pyx_v_src = ((struct __pyx_obj_9csamtools_AlignedRead *)__pyx_v_self)->_delegate;
19254 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2152
19255 * src = self._delegate
19257 * if src.core.l_qseq == 0: return None # <<<<<<<<<<<<<<
19259 * start = query_start(src)
19261 __pyx_t_1 = (__pyx_v_src->core.l_qseq == 0);
19263 __Pyx_XDECREF(__pyx_r);
19264 __Pyx_INCREF(Py_None);
19271 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2154
19272 * if src.core.l_qseq == 0: return None
19274 * start = query_start(src) # <<<<<<<<<<<<<<
19275 * end = query_end(src)
19278 __pyx_t_2 = __pyx_f_9csamtools_query_start(__pyx_v_src); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
19279 __pyx_v_start = __pyx_t_2;
19281 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2155
19283 * start = query_start(src)
19284 * end = query_end(src) # <<<<<<<<<<<<<<
19286 * return get_seq_range(src, start, end)
19288 __pyx_t_2 = __pyx_f_9csamtools_query_end(__pyx_v_src); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
19289 __pyx_v_end = __pyx_t_2;
19291 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2157
19292 * end = query_end(src)
19294 * return get_seq_range(src, start, end) # <<<<<<<<<<<<<<
19298 __Pyx_XDECREF(__pyx_r);
19299 __pyx_t_3 = __pyx_f_9csamtools_get_seq_range(__pyx_v_src, __pyx_v_start, __pyx_v_end); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
19300 __Pyx_GOTREF(__pyx_t_3);
19301 __pyx_r = __pyx_t_3;
19305 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
19308 __Pyx_XDECREF(__pyx_t_3);
19309 __Pyx_AddTraceback("csamtools.AlignedRead.query.__get__");
19312 __Pyx_XGIVEREF(__pyx_r);
19313 __Pyx_TraceReturn(__pyx_r);
19314 __Pyx_RefNannyFinishContext();
19318 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2161
19320 * """aligned query sequence quality values (None if not present)"""
19321 * def __get__(self): # <<<<<<<<<<<<<<
19322 * cdef bam1_t * src
19323 * cdef uint32_t start, end
19326 static PyObject *__pyx_pf_9csamtools_11AlignedRead_5qqual___get__(PyObject *__pyx_v_self); /*proto*/
19327 static PyObject *__pyx_pf_9csamtools_11AlignedRead_5qqual___get__(PyObject *__pyx_v_self) {
19328 bam1_t *__pyx_v_src;
19329 uint32_t __pyx_v_start;
19330 uint32_t __pyx_v_end;
19331 PyObject *__pyx_r = NULL;
19334 PyObject *__pyx_t_3 = NULL;
19335 __Pyx_TraceDeclarations
19336 __Pyx_RefNannySetupContext("__get__");
19337 __Pyx_TraceCall("__get__", __pyx_f[0], 2161);
19339 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2166
19342 * src = self._delegate # <<<<<<<<<<<<<<
19344 * if src.core.l_qseq == 0: return None
19346 __pyx_v_src = ((struct __pyx_obj_9csamtools_AlignedRead *)__pyx_v_self)->_delegate;
19348 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2168
19349 * src = self._delegate
19351 * if src.core.l_qseq == 0: return None # <<<<<<<<<<<<<<
19353 * start = query_start(src)
19355 __pyx_t_1 = (__pyx_v_src->core.l_qseq == 0);
19357 __Pyx_XDECREF(__pyx_r);
19358 __Pyx_INCREF(Py_None);
19365 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2170
19366 * if src.core.l_qseq == 0: return None
19368 * start = query_start(src) # <<<<<<<<<<<<<<
19369 * end = query_end(src)
19372 __pyx_t_2 = __pyx_f_9csamtools_query_start(__pyx_v_src); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
19373 __pyx_v_start = __pyx_t_2;
19375 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2171
19377 * start = query_start(src)
19378 * end = query_end(src) # <<<<<<<<<<<<<<
19380 * return get_qual_range(src, start, end)
19382 __pyx_t_2 = __pyx_f_9csamtools_query_end(__pyx_v_src); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
19383 __pyx_v_end = __pyx_t_2;
19385 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2173
19386 * end = query_end(src)
19388 * return get_qual_range(src, start, end) # <<<<<<<<<<<<<<
19392 __Pyx_XDECREF(__pyx_r);
19393 __pyx_t_3 = __pyx_f_9csamtools_get_qual_range(__pyx_v_src, __pyx_v_start, __pyx_v_end); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
19394 __Pyx_GOTREF(__pyx_t_3);
19395 __pyx_r = __pyx_t_3;
19399 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
19402 __Pyx_XDECREF(__pyx_t_3);
19403 __Pyx_AddTraceback("csamtools.AlignedRead.qqual.__get__");
19406 __Pyx_XGIVEREF(__pyx_r);
19407 __Pyx_TraceReturn(__pyx_r);
19408 __Pyx_RefNannyFinishContext();
19412 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2177
19414 * """start index of the aligned query portion of the sequence (0-based, inclusive)"""
19415 * def __get__(self): # <<<<<<<<<<<<<<
19416 * return query_start(self._delegate)
19420 static PyObject *__pyx_pf_9csamtools_11AlignedRead_6qstart___get__(PyObject *__pyx_v_self); /*proto*/
19421 static PyObject *__pyx_pf_9csamtools_11AlignedRead_6qstart___get__(PyObject *__pyx_v_self) {
19422 PyObject *__pyx_r = NULL;
19424 PyObject *__pyx_t_2 = NULL;
19425 __Pyx_TraceDeclarations
19426 __Pyx_RefNannySetupContext("__get__");
19427 __Pyx_TraceCall("__get__", __pyx_f[0], 2177);
19429 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2178
19430 * """start index of the aligned query portion of the sequence (0-based, inclusive)"""
19431 * def __get__(self):
19432 * return query_start(self._delegate) # <<<<<<<<<<<<<<
19436 __Pyx_XDECREF(__pyx_r);
19437 __pyx_t_1 = __pyx_f_9csamtools_query_start(((struct __pyx_obj_9csamtools_AlignedRead *)__pyx_v_self)->_delegate); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
19438 __pyx_t_2 = __Pyx_PyInt_to_py_int32_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
19439 __Pyx_GOTREF(__pyx_t_2);
19440 __pyx_r = __pyx_t_2;
19444 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
19447 __Pyx_XDECREF(__pyx_t_2);
19448 __Pyx_AddTraceback("csamtools.AlignedRead.qstart.__get__");
19451 __Pyx_XGIVEREF(__pyx_r);
19452 __Pyx_TraceReturn(__pyx_r);
19453 __Pyx_RefNannyFinishContext();
19457 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2182
19459 * """end index of the aligned query portion of the sequence (0-based, exclusive)"""
19460 * def __get__(self): # <<<<<<<<<<<<<<
19461 * return query_end(self._delegate)
19465 static PyObject *__pyx_pf_9csamtools_11AlignedRead_4qend___get__(PyObject *__pyx_v_self); /*proto*/
19466 static PyObject *__pyx_pf_9csamtools_11AlignedRead_4qend___get__(PyObject *__pyx_v_self) {
19467 PyObject *__pyx_r = NULL;
19469 PyObject *__pyx_t_2 = NULL;
19470 __Pyx_TraceDeclarations
19471 __Pyx_RefNannySetupContext("__get__");
19472 __Pyx_TraceCall("__get__", __pyx_f[0], 2182);
19474 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2183
19475 * """end index of the aligned query portion of the sequence (0-based, exclusive)"""
19476 * def __get__(self):
19477 * return query_end(self._delegate) # <<<<<<<<<<<<<<
19481 __Pyx_XDECREF(__pyx_r);
19482 __pyx_t_1 = __pyx_f_9csamtools_query_end(((struct __pyx_obj_9csamtools_AlignedRead *)__pyx_v_self)->_delegate); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
19483 __pyx_t_2 = __Pyx_PyInt_to_py_int32_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
19484 __Pyx_GOTREF(__pyx_t_2);
19485 __pyx_r = __pyx_t_2;
19489 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
19492 __Pyx_XDECREF(__pyx_t_2);
19493 __Pyx_AddTraceback("csamtools.AlignedRead.qend.__get__");
19496 __Pyx_XGIVEREF(__pyx_r);
19497 __Pyx_TraceReturn(__pyx_r);
19498 __Pyx_RefNannyFinishContext();
19502 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2187
19504 * """Length of the aligned query sequence"""
19505 * def __get__(self): # <<<<<<<<<<<<<<
19506 * cdef bam1_t * src
19507 * src = self._delegate
19510 static PyObject *__pyx_pf_9csamtools_11AlignedRead_4qlen___get__(PyObject *__pyx_v_self); /*proto*/
19511 static PyObject *__pyx_pf_9csamtools_11AlignedRead_4qlen___get__(PyObject *__pyx_v_self) {
19512 bam1_t *__pyx_v_src;
19513 PyObject *__pyx_r = NULL;
19516 PyObject *__pyx_t_3 = NULL;
19517 __Pyx_TraceDeclarations
19518 __Pyx_RefNannySetupContext("__get__");
19519 __Pyx_TraceCall("__get__", __pyx_f[0], 2187);
19521 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2189
19522 * def __get__(self):
19523 * cdef bam1_t * src
19524 * src = self._delegate # <<<<<<<<<<<<<<
19525 * return query_end(src)-query_start(src)
19528 __pyx_v_src = ((struct __pyx_obj_9csamtools_AlignedRead *)__pyx_v_self)->_delegate;
19530 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2190
19531 * cdef bam1_t * src
19532 * src = self._delegate
19533 * return query_end(src)-query_start(src) # <<<<<<<<<<<<<<
19537 __Pyx_XDECREF(__pyx_r);
19538 __pyx_t_1 = __pyx_f_9csamtools_query_end(__pyx_v_src); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
19539 __pyx_t_2 = __pyx_f_9csamtools_query_start(__pyx_v_src); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
19540 __pyx_t_3 = __Pyx_PyInt_to_py_int32_t((__pyx_t_1 - __pyx_t_2)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
19541 __Pyx_GOTREF(__pyx_t_3);
19542 __pyx_r = __pyx_t_3;
19546 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
19549 __Pyx_XDECREF(__pyx_t_3);
19550 __Pyx_AddTraceback("csamtools.AlignedRead.qlen.__get__");
19553 __Pyx_XGIVEREF(__pyx_r);
19554 __Pyx_TraceReturn(__pyx_r);
19555 __Pyx_RefNannyFinishContext();
19559 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2204
19562 * def __get__(self): # <<<<<<<<<<<<<<
19564 * cdef bam1_t * src
19567 static PyObject *__pyx_pf_9csamtools_11AlignedRead_4tags___get__(PyObject *__pyx_v_self); /*proto*/
19568 static PyObject *__pyx_pf_9csamtools_11AlignedRead_4tags___get__(PyObject *__pyx_v_self) {
19569 bam1_t *__pyx_v_src;
19570 uint8_t *__pyx_v_s;
19571 char __pyx_v_auxtag[3];
19572 char __pyx_v_auxtype;
19573 PyObject *__pyx_v_result;
19574 PyObject *__pyx_v_value;
19575 PyObject *__pyx_r = NULL;
19577 PyObject *__pyx_t_2 = NULL;
19581 PyObject *__pyx_t_6 = NULL;
19582 Py_ssize_t __pyx_t_7;
19584 __Pyx_TraceDeclarations
19585 __Pyx_RefNannySetupContext("__get__");
19586 __Pyx_TraceCall("__get__", __pyx_f[0], 2204);
19587 __pyx_v_result = ((PyObject *)Py_None); __Pyx_INCREF(Py_None);
19588 __pyx_v_value = Py_None; __Pyx_INCREF(Py_None);
19590 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2211
19591 * cdef char auxtype
19593 * src = self._delegate # <<<<<<<<<<<<<<
19594 * if src.l_aux == 0: return None
19597 __pyx_v_src = ((struct __pyx_obj_9csamtools_AlignedRead *)__pyx_v_self)->_delegate;
19599 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2212
19601 * src = self._delegate
19602 * if src.l_aux == 0: return None # <<<<<<<<<<<<<<
19604 * s = bam1_aux( src )
19606 __pyx_t_1 = (__pyx_v_src->l_aux == 0);
19608 __Pyx_XDECREF(__pyx_r);
19609 __Pyx_INCREF(Py_None);
19616 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2214
19617 * if src.l_aux == 0: return None
19619 * s = bam1_aux( src ) # <<<<<<<<<<<<<<
19623 __pyx_v_s = bam1_aux(__pyx_v_src);
19625 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2215
19627 * s = bam1_aux( src )
19628 * result = [] # <<<<<<<<<<<<<<
19630 * while s < (src.data + src.data_len):
19632 __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
19633 __Pyx_GOTREF(((PyObject *)__pyx_t_2));
19634 __Pyx_DECREF(((PyObject *)__pyx_v_result));
19635 __pyx_v_result = __pyx_t_2;
19638 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2216
19639 * s = bam1_aux( src )
19641 * auxtag[2] = 0 # <<<<<<<<<<<<<<
19642 * while s < (src.data + src.data_len):
19645 (__pyx_v_auxtag[2]) = 0;
19647 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2217
19650 * while s < (src.data + src.data_len): # <<<<<<<<<<<<<<
19655 __pyx_t_1 = (__pyx_v_s < (__pyx_v_src->data + __pyx_v_src->data_len));
19656 if (!__pyx_t_1) break;
19658 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2219
19659 * while s < (src.data + src.data_len):
19661 * auxtag[0] = s[0] # <<<<<<<<<<<<<<
19665 (__pyx_v_auxtag[0]) = (__pyx_v_s[0]);
19667 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2220
19670 * auxtag[1] = s[1] # <<<<<<<<<<<<<<
19674 (__pyx_v_auxtag[1]) = (__pyx_v_s[1]);
19676 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2221
19679 * s += 2 # <<<<<<<<<<<<<<
19685 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2222
19688 * auxtype = s[0] # <<<<<<<<<<<<<<
19690 * if auxtype in ('c', 'C'):
19692 __pyx_v_auxtype = (__pyx_v_s[0]);
19694 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2224
19697 * if auxtype in ('c', 'C'): # <<<<<<<<<<<<<<
19698 * value = <int>bam_aux2i(s)
19701 __pyx_t_3 = __pyx_v_auxtype;
19702 __pyx_t_1 = (__pyx_t_3 == 'c');
19704 __pyx_t_4 = (__pyx_t_3 == 'C');
19705 __pyx_t_5 = __pyx_t_4;
19707 __pyx_t_5 = __pyx_t_1;
19709 __pyx_t_1 = __pyx_t_5;
19712 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2225
19714 * if auxtype in ('c', 'C'):
19715 * value = <int>bam_aux2i(s) # <<<<<<<<<<<<<<
19717 * elif auxtype in ('s', 'S'):
19719 __pyx_t_2 = PyInt_FromLong(((int)bam_aux2i(__pyx_v_s))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
19720 __Pyx_GOTREF(__pyx_t_2);
19721 __Pyx_DECREF(__pyx_v_value);
19722 __pyx_v_value = __pyx_t_2;
19725 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2226
19726 * if auxtype in ('c', 'C'):
19727 * value = <int>bam_aux2i(s)
19728 * s += 1 # <<<<<<<<<<<<<<
19729 * elif auxtype in ('s', 'S'):
19730 * value = <int>bam_aux2i(s)
19736 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2227
19737 * value = <int>bam_aux2i(s)
19739 * elif auxtype in ('s', 'S'): # <<<<<<<<<<<<<<
19740 * value = <int>bam_aux2i(s)
19743 __pyx_t_3 = __pyx_v_auxtype;
19744 __pyx_t_1 = (__pyx_t_3 == 's');
19746 __pyx_t_5 = (__pyx_t_3 == 'S');
19747 __pyx_t_4 = __pyx_t_5;
19749 __pyx_t_4 = __pyx_t_1;
19751 __pyx_t_1 = __pyx_t_4;
19754 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2228
19756 * elif auxtype in ('s', 'S'):
19757 * value = <int>bam_aux2i(s) # <<<<<<<<<<<<<<
19759 * elif auxtype in ('i', 'I'):
19761 __pyx_t_2 = PyInt_FromLong(((int)bam_aux2i(__pyx_v_s))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
19762 __Pyx_GOTREF(__pyx_t_2);
19763 __Pyx_DECREF(__pyx_v_value);
19764 __pyx_v_value = __pyx_t_2;
19767 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2229
19768 * elif auxtype in ('s', 'S'):
19769 * value = <int>bam_aux2i(s)
19770 * s += 2 # <<<<<<<<<<<<<<
19771 * elif auxtype in ('i', 'I'):
19772 * value = <float>bam_aux2i(s)
19778 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2230
19779 * value = <int>bam_aux2i(s)
19781 * elif auxtype in ('i', 'I'): # <<<<<<<<<<<<<<
19782 * value = <float>bam_aux2i(s)
19785 __pyx_t_3 = __pyx_v_auxtype;
19786 __pyx_t_1 = (__pyx_t_3 == 'i');
19788 __pyx_t_4 = (__pyx_t_3 == 'I');
19789 __pyx_t_5 = __pyx_t_4;
19791 __pyx_t_5 = __pyx_t_1;
19793 __pyx_t_1 = __pyx_t_5;
19796 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2231
19798 * elif auxtype in ('i', 'I'):
19799 * value = <float>bam_aux2i(s) # <<<<<<<<<<<<<<
19801 * elif auxtype == 'f':
19803 __pyx_t_2 = PyFloat_FromDouble(((float)bam_aux2i(__pyx_v_s))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
19804 __Pyx_GOTREF(__pyx_t_2);
19805 __Pyx_DECREF(__pyx_v_value);
19806 __pyx_v_value = __pyx_t_2;
19809 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2232
19810 * elif auxtype in ('i', 'I'):
19811 * value = <float>bam_aux2i(s)
19812 * s += 4 # <<<<<<<<<<<<<<
19813 * elif auxtype == 'f':
19814 * value = <float>bam_aux2f(s)
19820 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2233
19821 * value = <float>bam_aux2i(s)
19823 * elif auxtype == 'f': # <<<<<<<<<<<<<<
19824 * value = <float>bam_aux2f(s)
19827 __pyx_t_1 = (__pyx_v_auxtype == 'f');
19830 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2234
19832 * elif auxtype == 'f':
19833 * value = <float>bam_aux2f(s) # <<<<<<<<<<<<<<
19835 * elif auxtype == 'd':
19837 __pyx_t_2 = PyFloat_FromDouble(bam_aux2f(__pyx_v_s)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
19838 __Pyx_GOTREF(__pyx_t_2);
19839 __Pyx_DECREF(__pyx_v_value);
19840 __pyx_v_value = __pyx_t_2;
19843 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2235
19844 * elif auxtype == 'f':
19845 * value = <float>bam_aux2f(s)
19846 * s += 4 # <<<<<<<<<<<<<<
19847 * elif auxtype == 'd':
19848 * value = <double>bam_aux2d(s)
19854 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2236
19855 * value = <float>bam_aux2f(s)
19857 * elif auxtype == 'd': # <<<<<<<<<<<<<<
19858 * value = <double>bam_aux2d(s)
19861 __pyx_t_1 = (__pyx_v_auxtype == 'd');
19864 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2237
19866 * elif auxtype == 'd':
19867 * value = <double>bam_aux2d(s) # <<<<<<<<<<<<<<
19869 * elif auxtype == 'A':
19871 __pyx_t_2 = PyFloat_FromDouble(bam_aux2d(__pyx_v_s)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
19872 __Pyx_GOTREF(__pyx_t_2);
19873 __Pyx_DECREF(__pyx_v_value);
19874 __pyx_v_value = __pyx_t_2;
19877 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2238
19878 * elif auxtype == 'd':
19879 * value = <double>bam_aux2d(s)
19880 * s += 8 # <<<<<<<<<<<<<<
19881 * elif auxtype == 'A':
19882 * value = "%c" % <char>bam_aux2A(s)
19888 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2239
19889 * value = <double>bam_aux2d(s)
19891 * elif auxtype == 'A': # <<<<<<<<<<<<<<
19892 * value = "%c" % <char>bam_aux2A(s)
19895 __pyx_t_1 = (__pyx_v_auxtype == 'A');
19898 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2240
19900 * elif auxtype == 'A':
19901 * value = "%c" % <char>bam_aux2A(s) # <<<<<<<<<<<<<<
19903 * elif auxtype in ('Z', 'H'):
19905 __pyx_t_2 = PyInt_FromLong(bam_aux2A(__pyx_v_s)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2240; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
19906 __Pyx_GOTREF(__pyx_t_2);
19907 __pyx_t_6 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_62), __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2240; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
19908 __Pyx_GOTREF(((PyObject *)__pyx_t_6));
19909 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
19910 __Pyx_DECREF(__pyx_v_value);
19911 __pyx_v_value = ((PyObject *)__pyx_t_6);
19914 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2241
19915 * elif auxtype == 'A':
19916 * value = "%c" % <char>bam_aux2A(s)
19917 * s += 1 # <<<<<<<<<<<<<<
19918 * elif auxtype in ('Z', 'H'):
19919 * value = <char*>bam_aux2Z(s)
19925 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2242
19926 * value = "%c" % <char>bam_aux2A(s)
19928 * elif auxtype in ('Z', 'H'): # <<<<<<<<<<<<<<
19929 * value = <char*>bam_aux2Z(s)
19930 * # +1 for NULL terminated string
19932 __pyx_t_3 = __pyx_v_auxtype;
19933 __pyx_t_1 = (__pyx_t_3 == 'Z');
19935 __pyx_t_5 = (__pyx_t_3 == 'H');
19936 __pyx_t_4 = __pyx_t_5;
19938 __pyx_t_4 = __pyx_t_1;
19940 __pyx_t_1 = __pyx_t_4;
19943 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2243
19945 * elif auxtype in ('Z', 'H'):
19946 * value = <char*>bam_aux2Z(s) # <<<<<<<<<<<<<<
19947 * # +1 for NULL terminated string
19948 * s += len(value) + 1
19950 __pyx_t_6 = PyBytes_FromString(bam_aux2Z(__pyx_v_s)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2243; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
19951 __Pyx_GOTREF(((PyObject *)__pyx_t_6));
19952 __Pyx_DECREF(__pyx_v_value);
19953 __pyx_v_value = ((PyObject *)__pyx_t_6);
19956 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2245
19957 * value = <char*>bam_aux2Z(s)
19958 * # +1 for NULL terminated string
19959 * s += len(value) + 1 # <<<<<<<<<<<<<<
19963 __pyx_t_7 = PyObject_Length(__pyx_v_value); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
19964 __pyx_v_s += (__pyx_t_7 + 1);
19969 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2247
19970 * s += len(value) + 1
19972 * s += 1 # <<<<<<<<<<<<<<
19974 * result.append( (auxtag, value) )
19978 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2249
19981 * result.append( (auxtag, value) ) # <<<<<<<<<<<<<<
19985 if (unlikely(__pyx_v_result == Py_None)) {
19986 PyErr_SetString(PyExc_AttributeError, "'NoneType' object has no attribute 'append'"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
19988 __pyx_t_6 = PyBytes_FromString(__pyx_v_auxtag); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
19989 __Pyx_GOTREF(((PyObject *)__pyx_t_6));
19990 __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
19991 __Pyx_GOTREF(__pyx_t_2);
19992 PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_6));
19993 __Pyx_GIVEREF(((PyObject *)__pyx_t_6));
19994 __Pyx_INCREF(__pyx_v_value);
19995 PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_value);
19996 __Pyx_GIVEREF(__pyx_v_value);
19998 __pyx_t_8 = PyList_Append(((PyObject *)__pyx_v_result), __pyx_t_2); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
19999 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20002 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2251
20003 * result.append( (auxtag, value) )
20005 * return result # <<<<<<<<<<<<<<
20007 * def __set__(self, tags):
20009 __Pyx_XDECREF(__pyx_r);
20010 __Pyx_INCREF(((PyObject *)__pyx_v_result));
20011 __pyx_r = ((PyObject *)__pyx_v_result);
20014 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
20017 __Pyx_XDECREF(__pyx_t_2);
20018 __Pyx_XDECREF(__pyx_t_6);
20019 __Pyx_AddTraceback("csamtools.AlignedRead.tags.__get__");
20022 __Pyx_DECREF(__pyx_v_result);
20023 __Pyx_DECREF(__pyx_v_value);
20024 __Pyx_XGIVEREF(__pyx_r);
20025 __Pyx_TraceReturn(__pyx_r);
20026 __Pyx_RefNannyFinishContext();
20030 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2253
20033 * def __set__(self, tags): # <<<<<<<<<<<<<<
20035 * cdef bam1_t * src
20038 static int __pyx_pf_9csamtools_11AlignedRead_4tags___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_tags); /*proto*/
20039 static int __pyx_pf_9csamtools_11AlignedRead_4tags___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_tags) {
20040 bam1_t *__pyx_v_src;
20041 uint8_t *__pyx_v_s;
20042 char *__pyx_v_temp;
20043 int __pyx_v_max_size;
20045 int __pyx_v_offset;
20046 PyObject *__pyx_v_buffer;
20047 PyObject *__pyx_v_pytag;
20048 PyObject *__pyx_v_value;
20049 PyObject *__pyx_v_t;
20050 PyObject *__pyx_v_fmt;
20051 PyObject *__pyx_v_pytype;
20053 PyObject *__pyx_t_1 = NULL;
20055 PyObject *__pyx_t_3 = NULL;
20056 PyObject *__pyx_t_4 = NULL;
20057 Py_ssize_t __pyx_t_5;
20058 PyObject *__pyx_t_6 = NULL;
20059 PyObject *__pyx_t_7 = NULL;
20060 Py_ssize_t __pyx_t_8;
20062 PyObject *__pyx_t_10 = NULL;
20064 __Pyx_TraceDeclarations
20065 __Pyx_RefNannySetupContext("__set__");
20066 __Pyx_TraceCall("__set__", __pyx_f[0], 2253);
20067 __pyx_v_buffer = Py_None; __Pyx_INCREF(Py_None);
20068 __pyx_v_pytag = Py_None; __Pyx_INCREF(Py_None);
20069 __pyx_v_value = Py_None; __Pyx_INCREF(Py_None);
20070 __pyx_v_t = ((PyObject *)Py_None); __Pyx_INCREF(Py_None);
20071 __pyx_v_fmt = Py_None; __Pyx_INCREF(Py_None);
20072 __pyx_v_pytype = Py_None; __Pyx_INCREF(Py_None);
20074 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2262
20075 * cdef int max_size, size, offset
20077 * src = self._delegate # <<<<<<<<<<<<<<
20081 __pyx_v_src = ((struct __pyx_obj_9csamtools_AlignedRead *)__pyx_v_self)->_delegate;
20083 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2263
20085 * src = self._delegate
20086 * max_size = 4000 # <<<<<<<<<<<<<<
20090 __pyx_v_max_size = 4000;
20092 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2264
20093 * src = self._delegate
20095 * offset = 0 # <<<<<<<<<<<<<<
20099 __pyx_v_offset = 0;
20101 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2266
20104 * if tags != None: # <<<<<<<<<<<<<<
20106 * # map samtools code to python.struct code and byte size
20108 __pyx_t_1 = PyObject_RichCompare(__pyx_v_tags, Py_None, Py_NE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20109 __Pyx_GOTREF(__pyx_t_1);
20110 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20111 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20114 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2269
20116 * # map samtools code to python.struct code and byte size
20117 * buffer = ctypes.create_string_buffer(max_size) # <<<<<<<<<<<<<<
20119 * for pytag, value in tags:
20121 __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__ctypes); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20122 __Pyx_GOTREF(__pyx_t_1);
20123 __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s_63); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20124 __Pyx_GOTREF(__pyx_t_3);
20125 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20126 __pyx_t_1 = PyInt_FromLong(__pyx_v_max_size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20127 __Pyx_GOTREF(__pyx_t_1);
20128 __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20129 __Pyx_GOTREF(__pyx_t_4);
20130 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
20131 __Pyx_GIVEREF(__pyx_t_1);
20133 __pyx_t_1 = PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20134 __Pyx_GOTREF(__pyx_t_1);
20135 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20136 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20137 __Pyx_DECREF(__pyx_v_buffer);
20138 __pyx_v_buffer = __pyx_t_1;
20141 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2271
20142 * buffer = ctypes.create_string_buffer(max_size)
20144 * for pytag, value in tags: # <<<<<<<<<<<<<<
20146 * if t == types.FloatType:
20148 if (PyList_CheckExact(__pyx_v_tags) || PyTuple_CheckExact(__pyx_v_tags)) {
20149 __pyx_t_5 = 0; __pyx_t_1 = __pyx_v_tags; __Pyx_INCREF(__pyx_t_1);
20151 __pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_tags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20152 __Pyx_GOTREF(__pyx_t_1);
20155 if (likely(PyList_CheckExact(__pyx_t_1))) {
20156 if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_1)) break;
20157 __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_4); __pyx_t_5++;
20158 } else if (likely(PyTuple_CheckExact(__pyx_t_1))) {
20159 if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
20160 __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_4); __pyx_t_5++;
20162 __pyx_t_4 = PyIter_Next(__pyx_t_1);
20164 if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20167 __Pyx_GOTREF(__pyx_t_4);
20169 if (PyTuple_CheckExact(__pyx_t_4) && likely(PyTuple_GET_SIZE(__pyx_t_4) == 2)) {
20170 PyObject* tuple = __pyx_t_4;
20171 __pyx_t_3 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_3);
20172 __pyx_t_6 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_6);
20173 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20174 __Pyx_DECREF(__pyx_v_pytag);
20175 __pyx_v_pytag = __pyx_t_3;
20177 __Pyx_DECREF(__pyx_v_value);
20178 __pyx_v_value = __pyx_t_6;
20181 __pyx_t_7 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20182 __Pyx_GOTREF(__pyx_t_7);
20183 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20184 __pyx_t_3 = __Pyx_UnpackItem(__pyx_t_7, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20185 __Pyx_GOTREF(__pyx_t_3);
20186 __pyx_t_6 = __Pyx_UnpackItem(__pyx_t_7, 1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20187 __Pyx_GOTREF(__pyx_t_6);
20188 if (__Pyx_EndUnpack(__pyx_t_7, 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20189 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
20190 __Pyx_DECREF(__pyx_v_pytag);
20191 __pyx_v_pytag = __pyx_t_3;
20193 __Pyx_DECREF(__pyx_v_value);
20194 __pyx_v_value = __pyx_t_6;
20198 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2272
20200 * for pytag, value in tags:
20201 * t = type(value) # <<<<<<<<<<<<<<
20202 * if t == types.FloatType:
20203 * fmt, pytype = "<cccf", 'f'
20205 __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_value)));
20206 __Pyx_DECREF(((PyObject *)__pyx_v_t));
20207 __pyx_v_t = ((PyObject *)((PyObject *)Py_TYPE(__pyx_v_value)));
20209 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2273
20210 * for pytag, value in tags:
20212 * if t == types.FloatType: # <<<<<<<<<<<<<<
20213 * fmt, pytype = "<cccf", 'f'
20214 * elif t == types.IntType:
20216 __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__types); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2273; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20217 __Pyx_GOTREF(__pyx_t_4);
20218 __pyx_t_6 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__FloatType); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2273; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20219 __Pyx_GOTREF(__pyx_t_6);
20220 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20221 __pyx_t_4 = PyObject_RichCompare(((PyObject *)__pyx_v_t), __pyx_t_6, Py_EQ); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2273; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20222 __Pyx_GOTREF(__pyx_t_4);
20223 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
20224 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2273; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20225 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20228 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2274
20230 * if t == types.FloatType:
20231 * fmt, pytype = "<cccf", 'f' # <<<<<<<<<<<<<<
20232 * elif t == types.IntType:
20235 __pyx_t_4 = ((PyObject *)__pyx_kp_s_64);
20236 __Pyx_INCREF(__pyx_t_4);
20237 __pyx_t_6 = ((PyObject *)__pyx_n_s__f);
20238 __Pyx_INCREF(__pyx_t_6);
20239 __Pyx_DECREF(__pyx_v_fmt);
20240 __pyx_v_fmt = __pyx_t_4;
20242 __Pyx_DECREF(__pyx_v_pytype);
20243 __pyx_v_pytype = __pyx_t_6;
20248 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2275
20249 * if t == types.FloatType:
20250 * fmt, pytype = "<cccf", 'f'
20251 * elif t == types.IntType: # <<<<<<<<<<<<<<
20253 * if value >= -127: fmt, pytype = "<cccb", 'c'
20255 __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__types); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20256 __Pyx_GOTREF(__pyx_t_6);
20257 __pyx_t_4 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__IntType); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20258 __Pyx_GOTREF(__pyx_t_4);
20259 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
20260 __pyx_t_6 = PyObject_RichCompare(((PyObject *)__pyx_v_t), __pyx_t_4, Py_EQ); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20261 __Pyx_GOTREF(__pyx_t_6);
20262 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20263 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20264 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
20267 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2276
20268 * fmt, pytype = "<cccf", 'f'
20269 * elif t == types.IntType:
20270 * if value < 0: # <<<<<<<<<<<<<<
20271 * if value >= -127: fmt, pytype = "<cccb", 'c'
20272 * elif value >= -32767: fmt, pytype = "<ccch", 's'
20274 __pyx_t_6 = PyObject_RichCompare(__pyx_v_value, __pyx_int_0, Py_LT); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20275 __Pyx_GOTREF(__pyx_t_6);
20276 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20277 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
20280 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2277
20281 * elif t == types.IntType:
20283 * if value >= -127: fmt, pytype = "<cccb", 'c' # <<<<<<<<<<<<<<
20284 * elif value >= -32767: fmt, pytype = "<ccch", 's'
20285 * elif value < -2147483648: raise ValueError( "integer %i out of range of BAM/SAM specification" % value )
20287 __pyx_t_6 = PyObject_RichCompare(__pyx_v_value, __pyx_int_neg_127, Py_GE); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20288 __Pyx_GOTREF(__pyx_t_6);
20289 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20290 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
20292 __pyx_t_6 = ((PyObject *)__pyx_kp_s_65);
20293 __Pyx_INCREF(__pyx_t_6);
20294 __pyx_t_4 = ((PyObject *)__pyx_n_s__c);
20295 __Pyx_INCREF(__pyx_t_4);
20296 __Pyx_DECREF(__pyx_v_fmt);
20297 __pyx_v_fmt = __pyx_t_6;
20299 __Pyx_DECREF(__pyx_v_pytype);
20300 __pyx_v_pytype = __pyx_t_4;
20305 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2278
20307 * if value >= -127: fmt, pytype = "<cccb", 'c'
20308 * elif value >= -32767: fmt, pytype = "<ccch", 's' # <<<<<<<<<<<<<<
20309 * elif value < -2147483648: raise ValueError( "integer %i out of range of BAM/SAM specification" % value )
20310 * else: fmt, pytype = "<ccci", 'i'[0]
20312 __pyx_t_4 = PyObject_RichCompare(__pyx_v_value, __pyx_int_neg_32767, Py_GE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20313 __Pyx_GOTREF(__pyx_t_4);
20314 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20315 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20317 __pyx_t_4 = ((PyObject *)__pyx_kp_s_66);
20318 __Pyx_INCREF(__pyx_t_4);
20319 __pyx_t_6 = ((PyObject *)__pyx_n_s__s);
20320 __Pyx_INCREF(__pyx_t_6);
20321 __Pyx_DECREF(__pyx_v_fmt);
20322 __pyx_v_fmt = __pyx_t_4;
20324 __Pyx_DECREF(__pyx_v_pytype);
20325 __pyx_v_pytype = __pyx_t_6;
20330 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2279
20331 * if value >= -127: fmt, pytype = "<cccb", 'c'
20332 * elif value >= -32767: fmt, pytype = "<ccch", 's'
20333 * elif value < -2147483648: raise ValueError( "integer %i out of range of BAM/SAM specification" % value ) # <<<<<<<<<<<<<<
20334 * else: fmt, pytype = "<ccci", 'i'[0]
20337 __pyx_t_6 = PyObject_RichCompare(__pyx_v_value, __pyx_int_neg_2147483648, Py_LT); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20338 __Pyx_GOTREF(__pyx_t_6);
20339 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20340 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
20342 __pyx_t_6 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_67), __pyx_v_value); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20343 __Pyx_GOTREF(((PyObject *)__pyx_t_6));
20344 __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20345 __Pyx_GOTREF(__pyx_t_4);
20346 PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_6));
20347 __Pyx_GIVEREF(((PyObject *)__pyx_t_6));
20349 __pyx_t_6 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20350 __Pyx_GOTREF(__pyx_t_6);
20351 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20352 __Pyx_Raise(__pyx_t_6, 0, 0);
20353 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
20354 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20359 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2280
20360 * elif value >= -32767: fmt, pytype = "<ccch", 's'
20361 * elif value < -2147483648: raise ValueError( "integer %i out of range of BAM/SAM specification" % value )
20362 * else: fmt, pytype = "<ccci", 'i'[0] # <<<<<<<<<<<<<<
20364 * if value <= 255: fmt, pytype = "<cccB", 'C'
20366 __pyx_t_6 = ((PyObject *)__pyx_kp_s_68);
20367 __Pyx_INCREF(__pyx_t_6);
20368 __pyx_t_4 = __Pyx_GetItemInt(((PyObject *)__pyx_n_s__i), 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20369 __Pyx_GOTREF(__pyx_t_4);
20370 __Pyx_DECREF(__pyx_v_fmt);
20371 __pyx_v_fmt = __pyx_t_6;
20373 __Pyx_DECREF(__pyx_v_pytype);
20374 __pyx_v_pytype = __pyx_t_4;
20382 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2282
20383 * else: fmt, pytype = "<ccci", 'i'[0]
20385 * if value <= 255: fmt, pytype = "<cccB", 'C' # <<<<<<<<<<<<<<
20386 * elif value <= 65535: fmt, pytype = "<cccH", 'S'
20387 * elif value > 4294967295: raise ValueError( "integer %i out of range of BAM/SAM specification" % value )
20389 __pyx_t_4 = PyObject_RichCompare(__pyx_v_value, __pyx_int_255, Py_LE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20390 __Pyx_GOTREF(__pyx_t_4);
20391 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20392 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20394 __pyx_t_4 = ((PyObject *)__pyx_kp_s_69);
20395 __Pyx_INCREF(__pyx_t_4);
20396 __pyx_t_6 = ((PyObject *)__pyx_n_s__C);
20397 __Pyx_INCREF(__pyx_t_6);
20398 __Pyx_DECREF(__pyx_v_fmt);
20399 __pyx_v_fmt = __pyx_t_4;
20401 __Pyx_DECREF(__pyx_v_pytype);
20402 __pyx_v_pytype = __pyx_t_6;
20407 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2283
20409 * if value <= 255: fmt, pytype = "<cccB", 'C'
20410 * elif value <= 65535: fmt, pytype = "<cccH", 'S' # <<<<<<<<<<<<<<
20411 * elif value > 4294967295: raise ValueError( "integer %i out of range of BAM/SAM specification" % value )
20412 * else: fmt, pytype = "<cccI", 'I'
20414 __pyx_t_6 = PyObject_RichCompare(__pyx_v_value, __pyx_int_65535, Py_LE); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20415 __Pyx_GOTREF(__pyx_t_6);
20416 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20417 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
20419 __pyx_t_6 = ((PyObject *)__pyx_kp_s_70);
20420 __Pyx_INCREF(__pyx_t_6);
20421 __pyx_t_4 = ((PyObject *)__pyx_n_s__S);
20422 __Pyx_INCREF(__pyx_t_4);
20423 __Pyx_DECREF(__pyx_v_fmt);
20424 __pyx_v_fmt = __pyx_t_6;
20426 __Pyx_DECREF(__pyx_v_pytype);
20427 __pyx_v_pytype = __pyx_t_4;
20432 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2284
20433 * if value <= 255: fmt, pytype = "<cccB", 'C'
20434 * elif value <= 65535: fmt, pytype = "<cccH", 'S'
20435 * elif value > 4294967295: raise ValueError( "integer %i out of range of BAM/SAM specification" % value ) # <<<<<<<<<<<<<<
20436 * else: fmt, pytype = "<cccI", 'I'
20439 __pyx_t_4 = PyObject_RichCompare(__pyx_v_value, __pyx_int_4294967295, Py_GT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20440 __Pyx_GOTREF(__pyx_t_4);
20441 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20442 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20444 __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_67), __pyx_v_value); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20445 __Pyx_GOTREF(((PyObject *)__pyx_t_4));
20446 __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20447 __Pyx_GOTREF(__pyx_t_6);
20448 PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_t_4));
20449 __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
20451 __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20452 __Pyx_GOTREF(__pyx_t_4);
20453 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
20454 __Pyx_Raise(__pyx_t_4, 0, 0);
20455 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20456 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20461 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2285
20462 * elif value <= 65535: fmt, pytype = "<cccH", 'S'
20463 * elif value > 4294967295: raise ValueError( "integer %i out of range of BAM/SAM specification" % value )
20464 * else: fmt, pytype = "<cccI", 'I' # <<<<<<<<<<<<<<
20466 * # Note: hex strings (H) are not supported yet
20468 __pyx_t_4 = ((PyObject *)__pyx_kp_s_71);
20469 __Pyx_INCREF(__pyx_t_4);
20470 __pyx_t_6 = ((PyObject *)__pyx_n_s__I);
20471 __Pyx_INCREF(__pyx_t_6);
20472 __Pyx_DECREF(__pyx_v_fmt);
20473 __pyx_v_fmt = __pyx_t_4;
20475 __Pyx_DECREF(__pyx_v_pytype);
20476 __pyx_v_pytype = __pyx_t_6;
20486 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2288
20488 * # Note: hex strings (H) are not supported yet
20489 * if len(value) == 1: # <<<<<<<<<<<<<<
20490 * fmt, pytype = "<cccc", 'A'
20493 __pyx_t_8 = PyObject_Length(__pyx_v_value); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20494 __pyx_t_2 = (__pyx_t_8 == 1);
20497 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2289
20498 * # Note: hex strings (H) are not supported yet
20499 * if len(value) == 1:
20500 * fmt, pytype = "<cccc", 'A' # <<<<<<<<<<<<<<
20502 * fmt, pytype = "<ccc%is" % (len(value)+1), 'Z'
20504 __pyx_t_6 = ((PyObject *)__pyx_kp_s_72);
20505 __Pyx_INCREF(__pyx_t_6);
20506 __pyx_t_4 = ((PyObject *)__pyx_n_s__A);
20507 __Pyx_INCREF(__pyx_t_4);
20508 __Pyx_DECREF(__pyx_v_fmt);
20509 __pyx_v_fmt = __pyx_t_6;
20511 __Pyx_DECREF(__pyx_v_pytype);
20512 __pyx_v_pytype = __pyx_t_4;
20518 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2291
20519 * fmt, pytype = "<cccc", 'A'
20521 * fmt, pytype = "<ccc%is" % (len(value)+1), 'Z' # <<<<<<<<<<<<<<
20523 * size = struct.calcsize(fmt)
20525 __pyx_t_8 = PyObject_Length(__pyx_v_value); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20526 __pyx_t_4 = PyInt_FromSsize_t((__pyx_t_8 + 1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20527 __Pyx_GOTREF(__pyx_t_4);
20528 __pyx_t_6 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_73), __pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20529 __Pyx_GOTREF(((PyObject *)__pyx_t_6));
20530 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20531 __pyx_t_4 = ((PyObject *)__pyx_n_s__Z);
20532 __Pyx_INCREF(__pyx_t_4);
20533 __Pyx_DECREF(__pyx_v_fmt);
20534 __pyx_v_fmt = ((PyObject *)__pyx_t_6);
20536 __Pyx_DECREF(__pyx_v_pytype);
20537 __pyx_v_pytype = __pyx_t_4;
20544 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2293
20545 * fmt, pytype = "<ccc%is" % (len(value)+1), 'Z'
20547 * size = struct.calcsize(fmt) # <<<<<<<<<<<<<<
20548 * if offset + size > max_size:
20549 * raise NotImplementedError("tags field too large")
20551 __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__struct); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20552 __Pyx_GOTREF(__pyx_t_4);
20553 __pyx_t_6 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__calcsize); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20554 __Pyx_GOTREF(__pyx_t_6);
20555 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20556 __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20557 __Pyx_GOTREF(__pyx_t_4);
20558 __Pyx_INCREF(__pyx_v_fmt);
20559 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_fmt);
20560 __Pyx_GIVEREF(__pyx_v_fmt);
20561 __pyx_t_3 = PyObject_Call(__pyx_t_6, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20562 __Pyx_GOTREF(__pyx_t_3);
20563 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
20564 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20565 __pyx_t_9 = __Pyx_PyInt_AsInt(__pyx_t_3); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20566 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20567 __pyx_v_size = __pyx_t_9;
20569 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2294
20571 * size = struct.calcsize(fmt)
20572 * if offset + size > max_size: # <<<<<<<<<<<<<<
20573 * raise NotImplementedError("tags field too large")
20576 __pyx_t_2 = ((__pyx_v_offset + __pyx_v_size) > __pyx_v_max_size);
20579 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2295
20580 * size = struct.calcsize(fmt)
20581 * if offset + size > max_size:
20582 * raise NotImplementedError("tags field too large") # <<<<<<<<<<<<<<
20584 * struct.pack_into( fmt,
20586 __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2295; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20587 __Pyx_GOTREF(__pyx_t_3);
20588 __Pyx_INCREF(((PyObject *)__pyx_kp_s_74));
20589 PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_s_74));
20590 __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_74));
20591 __pyx_t_4 = PyObject_Call(__pyx_builtin_NotImplementedError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2295; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20592 __Pyx_GOTREF(__pyx_t_4);
20593 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20594 __Pyx_Raise(__pyx_t_4, 0, 0);
20595 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20596 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2295; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20601 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2297
20602 * raise NotImplementedError("tags field too large")
20604 * struct.pack_into( fmt, # <<<<<<<<<<<<<<
20608 __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__struct); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20609 __Pyx_GOTREF(__pyx_t_4);
20610 __pyx_t_3 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__pack_into); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20611 __Pyx_GOTREF(__pyx_t_3);
20612 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20614 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2299
20615 * struct.pack_into( fmt,
20617 * offset, # <<<<<<<<<<<<<<
20621 __pyx_t_4 = PyInt_FromLong(__pyx_v_offset); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20622 __Pyx_GOTREF(__pyx_t_4);
20624 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2300
20627 * pytag[0], # <<<<<<<<<<<<<<
20631 __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_pytag, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2300; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20632 __Pyx_GOTREF(__pyx_t_6);
20634 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2301
20637 * pytag[1], # <<<<<<<<<<<<<<
20641 __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_pytag, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20642 __Pyx_GOTREF(__pyx_t_7);
20644 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2303
20647 * value ) # <<<<<<<<<<<<<<
20651 __pyx_t_10 = PyTuple_New(7); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20652 __Pyx_GOTREF(__pyx_t_10);
20653 __Pyx_INCREF(__pyx_v_fmt);
20654 PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_fmt);
20655 __Pyx_GIVEREF(__pyx_v_fmt);
20656 __Pyx_INCREF(__pyx_v_buffer);
20657 PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_v_buffer);
20658 __Pyx_GIVEREF(__pyx_v_buffer);
20659 PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_t_4);
20660 __Pyx_GIVEREF(__pyx_t_4);
20661 PyTuple_SET_ITEM(__pyx_t_10, 3, __pyx_t_6);
20662 __Pyx_GIVEREF(__pyx_t_6);
20663 PyTuple_SET_ITEM(__pyx_t_10, 4, __pyx_t_7);
20664 __Pyx_GIVEREF(__pyx_t_7);
20665 __Pyx_INCREF(__pyx_v_pytype);
20666 PyTuple_SET_ITEM(__pyx_t_10, 5, __pyx_v_pytype);
20667 __Pyx_GIVEREF(__pyx_v_pytype);
20668 __Pyx_INCREF(__pyx_v_value);
20669 PyTuple_SET_ITEM(__pyx_t_10, 6, __pyx_v_value);
20670 __Pyx_GIVEREF(__pyx_v_value);
20674 __pyx_t_7 = PyObject_Call(__pyx_t_3, __pyx_t_10, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20675 __Pyx_GOTREF(__pyx_t_7);
20676 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20677 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
20678 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
20680 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2304
20683 * offset += size # <<<<<<<<<<<<<<
20685 * # delete the old data and allocate new
20687 __pyx_v_offset += __pyx_v_size;
20689 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20694 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2312
20697 * bam1_aux( src ) ) # <<<<<<<<<<<<<<
20699 * src.l_aux = offset
20701 pysam_bam_update(__pyx_v_src, __pyx_v_src->l_aux, __pyx_v_offset, bam1_aux(__pyx_v_src));
20703 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2314
20704 * bam1_aux( src ) )
20706 * src.l_aux = offset # <<<<<<<<<<<<<<
20708 * # copy data only if there is any
20710 __pyx_v_src->l_aux = __pyx_v_offset;
20712 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2317
20714 * # copy data only if there is any
20715 * if offset != 0: # <<<<<<<<<<<<<<
20717 * # get location of new data
20719 __pyx_t_2 = (__pyx_v_offset != 0);
20722 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2320
20724 * # get location of new data
20725 * s = bam1_aux( src ) # <<<<<<<<<<<<<<
20727 * # check if there is direct path from buffer.raw to tmp
20729 __pyx_v_s = bam1_aux(__pyx_v_src);
20731 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2323
20733 * # check if there is direct path from buffer.raw to tmp
20734 * temp = buffer.raw # <<<<<<<<<<<<<<
20735 * memcpy( s, temp, offset )
20738 __pyx_t_1 = PyObject_GetAttr(__pyx_v_buffer, __pyx_n_s__raw); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20739 __Pyx_GOTREF(__pyx_t_1);
20740 __pyx_t_11 = PyBytes_AsString(__pyx_t_1); if (unlikely((!__pyx_t_11) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20741 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20742 __pyx_v_temp = __pyx_t_11;
20744 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2324
20745 * # check if there is direct path from buffer.raw to tmp
20746 * temp = buffer.raw
20747 * memcpy( s, temp, offset ) # <<<<<<<<<<<<<<
20751 memcpy(__pyx_v_s, __pyx_v_temp, __pyx_v_offset);
20759 __Pyx_XDECREF(__pyx_t_1);
20760 __Pyx_XDECREF(__pyx_t_3);
20761 __Pyx_XDECREF(__pyx_t_4);
20762 __Pyx_XDECREF(__pyx_t_6);
20763 __Pyx_XDECREF(__pyx_t_7);
20764 __Pyx_XDECREF(__pyx_t_10);
20765 __Pyx_AddTraceback("csamtools.AlignedRead.tags.__set__");
20768 __Pyx_DECREF(__pyx_v_buffer);
20769 __Pyx_DECREF(__pyx_v_pytag);
20770 __Pyx_DECREF(__pyx_v_value);
20771 __Pyx_DECREF(__pyx_v_t);
20772 __Pyx_DECREF(__pyx_v_fmt);
20773 __Pyx_DECREF(__pyx_v_pytype);
20774 __Pyx_TraceReturn(Py_None);
20775 __Pyx_RefNannyFinishContext();
20779 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2328
20781 * """properties flag"""
20782 * def __get__(self): return self._delegate.core.flag # <<<<<<<<<<<<<<
20783 * def __set__(self, flag): self._delegate.core.flag = flag
20787 static PyObject *__pyx_pf_9csamtools_11AlignedRead_4flag___get__(PyObject *__pyx_v_self); /*proto*/
20788 static PyObject *__pyx_pf_9csamtools_11AlignedRead_4flag___get__(PyObject *__pyx_v_self) {
20789 PyObject *__pyx_r = NULL;
20790 PyObject *__pyx_t_1 = NULL;
20791 __Pyx_TraceDeclarations
20792 __Pyx_RefNannySetupContext("__get__");
20793 __Pyx_TraceCall("__get__", __pyx_f[0], 2328);
20794 __Pyx_XDECREF(__pyx_r);
20795 __pyx_t_1 = __Pyx_PyInt_to_py_uint32_t(((struct __pyx_obj_9csamtools_AlignedRead *)__pyx_v_self)->_delegate->core.flag); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20796 __Pyx_GOTREF(__pyx_t_1);
20797 __pyx_r = __pyx_t_1;
20801 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
20804 __Pyx_XDECREF(__pyx_t_1);
20805 __Pyx_AddTraceback("csamtools.AlignedRead.flag.__get__");
20808 __Pyx_XGIVEREF(__pyx_r);
20809 __Pyx_TraceReturn(__pyx_r);
20810 __Pyx_RefNannyFinishContext();
20814 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2329
20815 * """properties flag"""
20816 * def __get__(self): return self._delegate.core.flag
20817 * def __set__(self, flag): self._delegate.core.flag = flag # <<<<<<<<<<<<<<
20822 static int __pyx_pf_9csamtools_11AlignedRead_4flag___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_flag); /*proto*/
20823 static int __pyx_pf_9csamtools_11AlignedRead_4flag___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_flag) {
20825 uint32_t __pyx_t_1;
20826 __Pyx_TraceDeclarations
20827 __Pyx_RefNannySetupContext("__set__");
20828 __Pyx_TraceCall("__set__", __pyx_f[0], 2329);
20829 __pyx_t_1 = __Pyx_PyInt_from_py_uint32_t(__pyx_v_flag); if (unlikely((__pyx_t_1 == (uint32_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20830 ((struct __pyx_obj_9csamtools_AlignedRead *)__pyx_v_self)->_delegate->core.flag = __pyx_t_1;
20835 __Pyx_AddTraceback("csamtools.AlignedRead.flag.__set__");
20838 __Pyx_TraceReturn(Py_None);
20839 __Pyx_RefNannyFinishContext();
20843 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2347
20846 * def __get__(self): return self._delegate.core.tid # <<<<<<<<<<<<<<
20847 * def __set__(self, tid): self._delegate.core.tid = tid
20851 static PyObject *__pyx_pf_9csamtools_11AlignedRead_5rname___get__(PyObject *__pyx_v_self); /*proto*/
20852 static PyObject *__pyx_pf_9csamtools_11AlignedRead_5rname___get__(PyObject *__pyx_v_self) {
20853 PyObject *__pyx_r = NULL;
20854 PyObject *__pyx_t_1 = NULL;
20855 __Pyx_TraceDeclarations
20856 __Pyx_RefNannySetupContext("__get__");
20857 __Pyx_TraceCall("__get__", __pyx_f[0], 2347);
20858 __Pyx_XDECREF(__pyx_r);
20859 __pyx_t_1 = __Pyx_PyInt_to_py_int32_t(((struct __pyx_obj_9csamtools_AlignedRead *)__pyx_v_self)->_delegate->core.tid); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20860 __Pyx_GOTREF(__pyx_t_1);
20861 __pyx_r = __pyx_t_1;
20865 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
20868 __Pyx_XDECREF(__pyx_t_1);
20869 __Pyx_AddTraceback("csamtools.AlignedRead.rname.__get__");
20872 __Pyx_XGIVEREF(__pyx_r);
20873 __Pyx_TraceReturn(__pyx_r);
20874 __Pyx_RefNannyFinishContext();
20878 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2348
20880 * def __get__(self): return self._delegate.core.tid
20881 * def __set__(self, tid): self._delegate.core.tid = tid # <<<<<<<<<<<<<<
20886 static int __pyx_pf_9csamtools_11AlignedRead_5rname___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_tid); /*proto*/
20887 static int __pyx_pf_9csamtools_11AlignedRead_5rname___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_tid) {
20890 __Pyx_TraceDeclarations
20891 __Pyx_RefNannySetupContext("__set__");
20892 __Pyx_TraceCall("__set__", __pyx_f[0], 2348);
20893 __pyx_t_1 = __Pyx_PyInt_from_py_int32_t(__pyx_v_tid); if (unlikely((__pyx_t_1 == (int32_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20894 ((struct __pyx_obj_9csamtools_AlignedRead *)__pyx_v_self)->_delegate->core.tid = __pyx_t_1;
20899 __Pyx_AddTraceback("csamtools.AlignedRead.rname.__set__");
20902 __Pyx_TraceReturn(Py_None);
20903 __Pyx_RefNannyFinishContext();
20907 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2361
20910 * def __get__(self): return self._delegate.core.tid # <<<<<<<<<<<<<<
20911 * def __set__(self, tid): self._delegate.core.tid = tid
20915 static PyObject *__pyx_pf_9csamtools_11AlignedRead_3tid___get__(PyObject *__pyx_v_self); /*proto*/
20916 static PyObject *__pyx_pf_9csamtools_11AlignedRead_3tid___get__(PyObject *__pyx_v_self) {
20917 PyObject *__pyx_r = NULL;
20918 PyObject *__pyx_t_1 = NULL;
20919 __Pyx_TraceDeclarations
20920 __Pyx_RefNannySetupContext("__get__");
20921 __Pyx_TraceCall("__get__", __pyx_f[0], 2361);
20922 __Pyx_XDECREF(__pyx_r);
20923 __pyx_t_1 = __Pyx_PyInt_to_py_int32_t(((struct __pyx_obj_9csamtools_AlignedRead *)__pyx_v_self)->_delegate->core.tid); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2361; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20924 __Pyx_GOTREF(__pyx_t_1);
20925 __pyx_r = __pyx_t_1;
20929 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
20932 __Pyx_XDECREF(__pyx_t_1);
20933 __Pyx_AddTraceback("csamtools.AlignedRead.tid.__get__");
20936 __Pyx_XGIVEREF(__pyx_r);
20937 __Pyx_TraceReturn(__pyx_r);
20938 __Pyx_RefNannyFinishContext();
20942 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2362
20944 * def __get__(self): return self._delegate.core.tid
20945 * def __set__(self, tid): self._delegate.core.tid = tid # <<<<<<<<<<<<<<
20950 static int __pyx_pf_9csamtools_11AlignedRead_3tid___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_tid); /*proto*/
20951 static int __pyx_pf_9csamtools_11AlignedRead_3tid___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_tid) {
20954 __Pyx_TraceDeclarations
20955 __Pyx_RefNannySetupContext("__set__");
20956 __Pyx_TraceCall("__set__", __pyx_f[0], 2362);
20957 __pyx_t_1 = __Pyx_PyInt_from_py_int32_t(__pyx_v_tid); if (unlikely((__pyx_t_1 == (int32_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2362; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20958 ((struct __pyx_obj_9csamtools_AlignedRead *)__pyx_v_self)->_delegate->core.tid = __pyx_t_1;
20963 __Pyx_AddTraceback("csamtools.AlignedRead.tid.__set__");
20966 __Pyx_TraceReturn(Py_None);
20967 __Pyx_RefNannyFinishContext();
20971 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2366
20973 * """0-based leftmost coordinate"""
20974 * def __get__(self): return self._delegate.core.pos # <<<<<<<<<<<<<<
20975 * def __set__(self, pos):
20976 * ## setting the cigar string also updates the "bin" attribute
20979 static PyObject *__pyx_pf_9csamtools_11AlignedRead_3pos___get__(PyObject *__pyx_v_self); /*proto*/
20980 static PyObject *__pyx_pf_9csamtools_11AlignedRead_3pos___get__(PyObject *__pyx_v_self) {
20981 PyObject *__pyx_r = NULL;
20982 PyObject *__pyx_t_1 = NULL;
20983 __Pyx_TraceDeclarations
20984 __Pyx_RefNannySetupContext("__get__");
20985 __Pyx_TraceCall("__get__", __pyx_f[0], 2366);
20986 __Pyx_XDECREF(__pyx_r);
20987 __pyx_t_1 = __Pyx_PyInt_to_py_int32_t(((struct __pyx_obj_9csamtools_AlignedRead *)__pyx_v_self)->_delegate->core.pos); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20988 __Pyx_GOTREF(__pyx_t_1);
20989 __pyx_r = __pyx_t_1;
20993 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
20996 __Pyx_XDECREF(__pyx_t_1);
20997 __Pyx_AddTraceback("csamtools.AlignedRead.pos.__get__");
21000 __Pyx_XGIVEREF(__pyx_r);
21001 __Pyx_TraceReturn(__pyx_r);
21002 __Pyx_RefNannyFinishContext();
21006 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2367
21007 * """0-based leftmost coordinate"""
21008 * def __get__(self): return self._delegate.core.pos
21009 * def __set__(self, pos): # <<<<<<<<<<<<<<
21010 * ## setting the cigar string also updates the "bin" attribute
21011 * cdef bam1_t * src
21014 static int __pyx_pf_9csamtools_11AlignedRead_3pos___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_pos); /*proto*/
21015 static int __pyx_pf_9csamtools_11AlignedRead_3pos___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_pos) {
21016 bam1_t *__pyx_v_src;
21019 __Pyx_TraceDeclarations
21020 __Pyx_RefNannySetupContext("__set__");
21021 __Pyx_TraceCall("__set__", __pyx_f[0], 2367);
21023 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2370
21024 * ## setting the cigar string also updates the "bin" attribute
21025 * cdef bam1_t * src
21026 * src = self._delegate # <<<<<<<<<<<<<<
21027 * if src.core.n_cigar:
21028 * src.core.bin = bam_reg2bin( src.core.pos, bam_calend( &src.core, bam1_cigar(src)) )
21030 __pyx_v_src = ((struct __pyx_obj_9csamtools_AlignedRead *)__pyx_v_self)->_delegate;
21032 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2371
21033 * cdef bam1_t * src
21034 * src = self._delegate
21035 * if src.core.n_cigar: # <<<<<<<<<<<<<<
21036 * src.core.bin = bam_reg2bin( src.core.pos, bam_calend( &src.core, bam1_cigar(src)) )
21039 if (__pyx_v_src->core.n_cigar) {
21041 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2372
21042 * src = self._delegate
21043 * if src.core.n_cigar:
21044 * src.core.bin = bam_reg2bin( src.core.pos, bam_calend( &src.core, bam1_cigar(src)) ) # <<<<<<<<<<<<<<
21046 * src.core.bin = bam_reg2bin( src.core.pos, src.core.pos + 1)
21048 __pyx_v_src->core.bin = bam_reg2bin(__pyx_v_src->core.pos, bam_calend((&__pyx_v_src->core), bam1_cigar(__pyx_v_src)));
21053 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2374
21054 * src.core.bin = bam_reg2bin( src.core.pos, bam_calend( &src.core, bam1_cigar(src)) )
21056 * src.core.bin = bam_reg2bin( src.core.pos, src.core.pos + 1) # <<<<<<<<<<<<<<
21057 * self._delegate.core.pos = pos
21060 __pyx_v_src->core.bin = bam_reg2bin(__pyx_v_src->core.pos, (__pyx_v_src->core.pos + 1));
21064 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2375
21066 * src.core.bin = bam_reg2bin( src.core.pos, src.core.pos + 1)
21067 * self._delegate.core.pos = pos # <<<<<<<<<<<<<<
21069 * """properties bin"""
21071 __pyx_t_1 = __Pyx_PyInt_from_py_int32_t(__pyx_v_pos); if (unlikely((__pyx_t_1 == (int32_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21072 ((struct __pyx_obj_9csamtools_AlignedRead *)__pyx_v_self)->_delegate->core.pos = __pyx_t_1;
21077 __Pyx_AddTraceback("csamtools.AlignedRead.pos.__set__");
21080 __Pyx_TraceReturn(Py_None);
21081 __Pyx_RefNannyFinishContext();
21085 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2378
21087 * """properties bin"""
21088 * def __get__(self): return self._delegate.core.bin # <<<<<<<<<<<<<<
21089 * def __set__(self, bin): self._delegate.core.bin = bin
21093 static PyObject *__pyx_pf_9csamtools_11AlignedRead_3bin___get__(PyObject *__pyx_v_self); /*proto*/
21094 static PyObject *__pyx_pf_9csamtools_11AlignedRead_3bin___get__(PyObject *__pyx_v_self) {
21095 PyObject *__pyx_r = NULL;
21096 PyObject *__pyx_t_1 = NULL;
21097 __Pyx_TraceDeclarations
21098 __Pyx_RefNannySetupContext("__get__");
21099 __Pyx_TraceCall("__get__", __pyx_f[0], 2378);
21100 __Pyx_XDECREF(__pyx_r);
21101 __pyx_t_1 = __Pyx_PyInt_to_py_uint32_t(((struct __pyx_obj_9csamtools_AlignedRead *)__pyx_v_self)->_delegate->core.bin); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2378; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21102 __Pyx_GOTREF(__pyx_t_1);
21103 __pyx_r = __pyx_t_1;
21107 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
21110 __Pyx_XDECREF(__pyx_t_1);
21111 __Pyx_AddTraceback("csamtools.AlignedRead.bin.__get__");
21114 __Pyx_XGIVEREF(__pyx_r);
21115 __Pyx_TraceReturn(__pyx_r);
21116 __Pyx_RefNannyFinishContext();
21120 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2379
21121 * """properties bin"""
21122 * def __get__(self): return self._delegate.core.bin
21123 * def __set__(self, bin): self._delegate.core.bin = bin # <<<<<<<<<<<<<<
21125 * '''length of the read (read only). Returns 0 if not given.'''
21128 static int __pyx_pf_9csamtools_11AlignedRead_3bin___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_bin); /*proto*/
21129 static int __pyx_pf_9csamtools_11AlignedRead_3bin___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_bin) {
21131 uint32_t __pyx_t_1;
21132 __Pyx_TraceDeclarations
21133 __Pyx_RefNannySetupContext("__set__");
21134 __Pyx_TraceCall("__set__", __pyx_f[0], 2379);
21135 __pyx_t_1 = __Pyx_PyInt_from_py_uint32_t(__pyx_v_bin); if (unlikely((__pyx_t_1 == (uint32_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2379; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21136 ((struct __pyx_obj_9csamtools_AlignedRead *)__pyx_v_self)->_delegate->core.bin = __pyx_t_1;
21141 __Pyx_AddTraceback("csamtools.AlignedRead.bin.__set__");
21144 __Pyx_TraceReturn(Py_None);
21145 __Pyx_RefNannyFinishContext();
21149 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2382
21151 * '''length of the read (read only). Returns 0 if not given.'''
21152 * def __get__(self): return self._delegate.core.l_qseq # <<<<<<<<<<<<<<
21154 * '''aligned end position of the read (read only). Returns
21157 static PyObject *__pyx_pf_9csamtools_11AlignedRead_4rlen___get__(PyObject *__pyx_v_self); /*proto*/
21158 static PyObject *__pyx_pf_9csamtools_11AlignedRead_4rlen___get__(PyObject *__pyx_v_self) {
21159 PyObject *__pyx_r = NULL;
21160 PyObject *__pyx_t_1 = NULL;
21161 __Pyx_TraceDeclarations
21162 __Pyx_RefNannySetupContext("__get__");
21163 __Pyx_TraceCall("__get__", __pyx_f[0], 2382);
21164 __Pyx_XDECREF(__pyx_r);
21165 __pyx_t_1 = __Pyx_PyInt_to_py_int32_t(((struct __pyx_obj_9csamtools_AlignedRead *)__pyx_v_self)->_delegate->core.l_qseq); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2382; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21166 __Pyx_GOTREF(__pyx_t_1);
21167 __pyx_r = __pyx_t_1;
21171 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
21174 __Pyx_XDECREF(__pyx_t_1);
21175 __Pyx_AddTraceback("csamtools.AlignedRead.rlen.__get__");
21178 __Pyx_XGIVEREF(__pyx_r);
21179 __Pyx_TraceReturn(__pyx_r);
21180 __Pyx_RefNannyFinishContext();
21184 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2386
21185 * '''aligned end position of the read (read only). Returns
21186 * None if not available.'''
21187 * def __get__(self): # <<<<<<<<<<<<<<
21188 * cdef bam1_t * src
21189 * src = self._delegate
21192 static PyObject *__pyx_pf_9csamtools_11AlignedRead_4aend___get__(PyObject *__pyx_v_self); /*proto*/
21193 static PyObject *__pyx_pf_9csamtools_11AlignedRead_4aend___get__(PyObject *__pyx_v_self) {
21194 bam1_t *__pyx_v_src;
21195 PyObject *__pyx_r = NULL;
21196 PyObject *__pyx_t_1 = NULL;
21197 PyObject *__pyx_t_2 = NULL;
21201 __Pyx_TraceDeclarations
21202 __Pyx_RefNannySetupContext("__get__");
21203 __Pyx_TraceCall("__get__", __pyx_f[0], 2386);
21205 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2388
21206 * def __get__(self):
21207 * cdef bam1_t * src
21208 * src = self._delegate # <<<<<<<<<<<<<<
21209 * if (self.flag & BAM_FUNMAP) or src.core.n_cigar == 0:
21212 __pyx_v_src = ((struct __pyx_obj_9csamtools_AlignedRead *)__pyx_v_self)->_delegate;
21214 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2389
21215 * cdef bam1_t * src
21216 * src = self._delegate
21217 * if (self.flag & BAM_FUNMAP) or src.core.n_cigar == 0: # <<<<<<<<<<<<<<
21219 * return bam_calend(&src.core, bam1_cigar(src))
21221 __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__flag); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2389; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21222 __Pyx_GOTREF(__pyx_t_1);
21223 __pyx_t_2 = PyNumber_And(__pyx_t_1, __pyx_int_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2389; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21224 __Pyx_GOTREF(__pyx_t_2);
21225 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21226 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2389; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21227 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21229 __pyx_t_4 = (__pyx_v_src->core.n_cigar == 0);
21230 __pyx_t_5 = __pyx_t_4;
21232 __pyx_t_5 = __pyx_t_3;
21236 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2390
21237 * src = self._delegate
21238 * if (self.flag & BAM_FUNMAP) or src.core.n_cigar == 0:
21239 * return None # <<<<<<<<<<<<<<
21240 * return bam_calend(&src.core, bam1_cigar(src))
21243 __Pyx_XDECREF(__pyx_r);
21244 __Pyx_INCREF(Py_None);
21251 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2391
21252 * if (self.flag & BAM_FUNMAP) or src.core.n_cigar == 0:
21254 * return bam_calend(&src.core, bam1_cigar(src)) # <<<<<<<<<<<<<<
21256 * '''aligned length of the read (read only). Returns None if
21258 __Pyx_XDECREF(__pyx_r);
21259 __pyx_t_2 = __Pyx_PyInt_to_py_uint32_t(bam_calend((&__pyx_v_src->core), bam1_cigar(__pyx_v_src))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21260 __Pyx_GOTREF(__pyx_t_2);
21261 __pyx_r = __pyx_t_2;
21265 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
21268 __Pyx_XDECREF(__pyx_t_1);
21269 __Pyx_XDECREF(__pyx_t_2);
21270 __Pyx_AddTraceback("csamtools.AlignedRead.aend.__get__");
21273 __Pyx_XGIVEREF(__pyx_r);
21274 __Pyx_TraceReturn(__pyx_r);
21275 __Pyx_RefNannyFinishContext();
21279 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2395
21280 * '''aligned length of the read (read only). Returns None if
21281 * not available.'''
21282 * def __get__(self): # <<<<<<<<<<<<<<
21283 * cdef bam1_t * src
21284 * src = self._delegate
21287 static PyObject *__pyx_pf_9csamtools_11AlignedRead_4alen___get__(PyObject *__pyx_v_self); /*proto*/
21288 static PyObject *__pyx_pf_9csamtools_11AlignedRead_4alen___get__(PyObject *__pyx_v_self) {
21289 bam1_t *__pyx_v_src;
21290 PyObject *__pyx_r = NULL;
21291 PyObject *__pyx_t_1 = NULL;
21292 PyObject *__pyx_t_2 = NULL;
21296 __Pyx_TraceDeclarations
21297 __Pyx_RefNannySetupContext("__get__");
21298 __Pyx_TraceCall("__get__", __pyx_f[0], 2395);
21300 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2397
21301 * def __get__(self):
21302 * cdef bam1_t * src
21303 * src = self._delegate # <<<<<<<<<<<<<<
21304 * if (self.flag & BAM_FUNMAP) or src.core.n_cigar == 0:
21307 __pyx_v_src = ((struct __pyx_obj_9csamtools_AlignedRead *)__pyx_v_self)->_delegate;
21309 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2398
21310 * cdef bam1_t * src
21311 * src = self._delegate
21312 * if (self.flag & BAM_FUNMAP) or src.core.n_cigar == 0: # <<<<<<<<<<<<<<
21314 * return bam_calend(&src.core,
21316 __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__flag); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21317 __Pyx_GOTREF(__pyx_t_1);
21318 __pyx_t_2 = PyNumber_And(__pyx_t_1, __pyx_int_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21319 __Pyx_GOTREF(__pyx_t_2);
21320 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21321 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21322 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21324 __pyx_t_4 = (__pyx_v_src->core.n_cigar == 0);
21325 __pyx_t_5 = __pyx_t_4;
21327 __pyx_t_5 = __pyx_t_3;
21331 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2399
21332 * src = self._delegate
21333 * if (self.flag & BAM_FUNMAP) or src.core.n_cigar == 0:
21334 * return None # <<<<<<<<<<<<<<
21335 * return bam_calend(&src.core,
21336 * bam1_cigar(src)) - \
21338 __Pyx_XDECREF(__pyx_r);
21339 __Pyx_INCREF(Py_None);
21346 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2400
21347 * if (self.flag & BAM_FUNMAP) or src.core.n_cigar == 0:
21349 * return bam_calend(&src.core, # <<<<<<<<<<<<<<
21350 * bam1_cigar(src)) - \
21351 * self._delegate.core.pos
21353 __Pyx_XDECREF(__pyx_r);
21355 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2402
21356 * return bam_calend(&src.core,
21357 * bam1_cigar(src)) - \
21358 * self._delegate.core.pos # <<<<<<<<<<<<<<
21362 __pyx_t_2 = __Pyx_PyInt_to_py_int32_t((bam_calend((&__pyx_v_src->core), bam1_cigar(__pyx_v_src)) - ((struct __pyx_obj_9csamtools_AlignedRead *)__pyx_v_self)->_delegate->core.pos)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21363 __Pyx_GOTREF(__pyx_t_2);
21364 __pyx_r = __pyx_t_2;
21368 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
21371 __Pyx_XDECREF(__pyx_t_1);
21372 __Pyx_XDECREF(__pyx_t_2);
21373 __Pyx_AddTraceback("csamtools.AlignedRead.alen.__get__");
21376 __Pyx_XGIVEREF(__pyx_r);
21377 __Pyx_TraceReturn(__pyx_r);
21378 __Pyx_RefNannyFinishContext();
21382 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2406
21384 * """mapping quality"""
21385 * def __get__(self): return self._delegate.core.qual # <<<<<<<<<<<<<<
21386 * def __set__(self, qual): self._delegate.core.qual = qual
21390 static PyObject *__pyx_pf_9csamtools_11AlignedRead_4mapq___get__(PyObject *__pyx_v_self); /*proto*/
21391 static PyObject *__pyx_pf_9csamtools_11AlignedRead_4mapq___get__(PyObject *__pyx_v_self) {
21392 PyObject *__pyx_r = NULL;
21393 PyObject *__pyx_t_1 = NULL;
21394 __Pyx_TraceDeclarations
21395 __Pyx_RefNannySetupContext("__get__");
21396 __Pyx_TraceCall("__get__", __pyx_f[0], 2406);
21397 __Pyx_XDECREF(__pyx_r);
21398 __pyx_t_1 = __Pyx_PyInt_to_py_uint32_t(((struct __pyx_obj_9csamtools_AlignedRead *)__pyx_v_self)->_delegate->core.qual); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21399 __Pyx_GOTREF(__pyx_t_1);
21400 __pyx_r = __pyx_t_1;
21404 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
21407 __Pyx_XDECREF(__pyx_t_1);
21408 __Pyx_AddTraceback("csamtools.AlignedRead.mapq.__get__");
21411 __Pyx_XGIVEREF(__pyx_r);
21412 __Pyx_TraceReturn(__pyx_r);
21413 __Pyx_RefNannyFinishContext();
21417 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2407
21418 * """mapping quality"""
21419 * def __get__(self): return self._delegate.core.qual
21420 * def __set__(self, qual): self._delegate.core.qual = qual # <<<<<<<<<<<<<<
21422 * """the :term:`reference` id of the mate """
21425 static int __pyx_pf_9csamtools_11AlignedRead_4mapq___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_qual); /*proto*/
21426 static int __pyx_pf_9csamtools_11AlignedRead_4mapq___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_qual) {
21428 uint32_t __pyx_t_1;
21429 __Pyx_TraceDeclarations
21430 __Pyx_RefNannySetupContext("__set__");
21431 __Pyx_TraceCall("__set__", __pyx_f[0], 2407);
21432 __pyx_t_1 = __Pyx_PyInt_from_py_uint32_t(__pyx_v_qual); if (unlikely((__pyx_t_1 == (uint32_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21433 ((struct __pyx_obj_9csamtools_AlignedRead *)__pyx_v_self)->_delegate->core.qual = __pyx_t_1;
21438 __Pyx_AddTraceback("csamtools.AlignedRead.mapq.__set__");
21441 __Pyx_TraceReturn(Py_None);
21442 __Pyx_RefNannyFinishContext();
21446 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2410
21448 * """the :term:`reference` id of the mate """
21449 * def __get__(self): return self._delegate.core.mtid # <<<<<<<<<<<<<<
21450 * def __set__(self, mtid): self._delegate.core.mtid = mtid
21454 static PyObject *__pyx_pf_9csamtools_11AlignedRead_4mrnm___get__(PyObject *__pyx_v_self); /*proto*/
21455 static PyObject *__pyx_pf_9csamtools_11AlignedRead_4mrnm___get__(PyObject *__pyx_v_self) {
21456 PyObject *__pyx_r = NULL;
21457 PyObject *__pyx_t_1 = NULL;
21458 __Pyx_TraceDeclarations
21459 __Pyx_RefNannySetupContext("__get__");
21460 __Pyx_TraceCall("__get__", __pyx_f[0], 2410);
21461 __Pyx_XDECREF(__pyx_r);
21462 __pyx_t_1 = __Pyx_PyInt_to_py_int32_t(((struct __pyx_obj_9csamtools_AlignedRead *)__pyx_v_self)->_delegate->core.mtid); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2410; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21463 __Pyx_GOTREF(__pyx_t_1);
21464 __pyx_r = __pyx_t_1;
21468 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
21471 __Pyx_XDECREF(__pyx_t_1);
21472 __Pyx_AddTraceback("csamtools.AlignedRead.mrnm.__get__");
21475 __Pyx_XGIVEREF(__pyx_r);
21476 __Pyx_TraceReturn(__pyx_r);
21477 __Pyx_RefNannyFinishContext();
21481 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2411
21482 * """the :term:`reference` id of the mate """
21483 * def __get__(self): return self._delegate.core.mtid
21484 * def __set__(self, mtid): self._delegate.core.mtid = mtid # <<<<<<<<<<<<<<
21486 * """the position of the mate"""
21489 static int __pyx_pf_9csamtools_11AlignedRead_4mrnm___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_mtid); /*proto*/
21490 static int __pyx_pf_9csamtools_11AlignedRead_4mrnm___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_mtid) {
21493 __Pyx_TraceDeclarations
21494 __Pyx_RefNannySetupContext("__set__");
21495 __Pyx_TraceCall("__set__", __pyx_f[0], 2411);
21496 __pyx_t_1 = __Pyx_PyInt_from_py_int32_t(__pyx_v_mtid); if (unlikely((__pyx_t_1 == (int32_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21497 ((struct __pyx_obj_9csamtools_AlignedRead *)__pyx_v_self)->_delegate->core.mtid = __pyx_t_1;
21502 __Pyx_AddTraceback("csamtools.AlignedRead.mrnm.__set__");
21505 __Pyx_TraceReturn(Py_None);
21506 __Pyx_RefNannyFinishContext();
21510 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2414
21512 * """the position of the mate"""
21513 * def __get__(self): return self._delegate.core.mpos # <<<<<<<<<<<<<<
21514 * def __set__(self, mpos): self._delegate.core.mpos = mpos
21518 static PyObject *__pyx_pf_9csamtools_11AlignedRead_4mpos___get__(PyObject *__pyx_v_self); /*proto*/
21519 static PyObject *__pyx_pf_9csamtools_11AlignedRead_4mpos___get__(PyObject *__pyx_v_self) {
21520 PyObject *__pyx_r = NULL;
21521 PyObject *__pyx_t_1 = NULL;
21522 __Pyx_TraceDeclarations
21523 __Pyx_RefNannySetupContext("__get__");
21524 __Pyx_TraceCall("__get__", __pyx_f[0], 2414);
21525 __Pyx_XDECREF(__pyx_r);
21526 __pyx_t_1 = __Pyx_PyInt_to_py_int32_t(((struct __pyx_obj_9csamtools_AlignedRead *)__pyx_v_self)->_delegate->core.mpos); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21527 __Pyx_GOTREF(__pyx_t_1);
21528 __pyx_r = __pyx_t_1;
21532 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
21535 __Pyx_XDECREF(__pyx_t_1);
21536 __Pyx_AddTraceback("csamtools.AlignedRead.mpos.__get__");
21539 __Pyx_XGIVEREF(__pyx_r);
21540 __Pyx_TraceReturn(__pyx_r);
21541 __Pyx_RefNannyFinishContext();
21545 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2415
21546 * """the position of the mate"""
21547 * def __get__(self): return self._delegate.core.mpos
21548 * def __set__(self, mpos): self._delegate.core.mpos = mpos # <<<<<<<<<<<<<<
21550 * """the insert size"""
21553 static int __pyx_pf_9csamtools_11AlignedRead_4mpos___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_mpos); /*proto*/
21554 static int __pyx_pf_9csamtools_11AlignedRead_4mpos___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_mpos) {
21557 __Pyx_TraceDeclarations
21558 __Pyx_RefNannySetupContext("__set__");
21559 __Pyx_TraceCall("__set__", __pyx_f[0], 2415);
21560 __pyx_t_1 = __Pyx_PyInt_from_py_int32_t(__pyx_v_mpos); if (unlikely((__pyx_t_1 == (int32_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2415; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21561 ((struct __pyx_obj_9csamtools_AlignedRead *)__pyx_v_self)->_delegate->core.mpos = __pyx_t_1;
21566 __Pyx_AddTraceback("csamtools.AlignedRead.mpos.__set__");
21569 __Pyx_TraceReturn(Py_None);
21570 __Pyx_RefNannyFinishContext();
21574 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2418
21576 * """the insert size"""
21577 * def __get__(self): return self._delegate.core.isize # <<<<<<<<<<<<<<
21578 * def __set__(self, isize): self._delegate.core.isize = isize
21579 * property is_paired:
21582 static PyObject *__pyx_pf_9csamtools_11AlignedRead_5isize___get__(PyObject *__pyx_v_self); /*proto*/
21583 static PyObject *__pyx_pf_9csamtools_11AlignedRead_5isize___get__(PyObject *__pyx_v_self) {
21584 PyObject *__pyx_r = NULL;
21585 PyObject *__pyx_t_1 = NULL;
21586 __Pyx_TraceDeclarations
21587 __Pyx_RefNannySetupContext("__get__");
21588 __Pyx_TraceCall("__get__", __pyx_f[0], 2418);
21589 __Pyx_XDECREF(__pyx_r);
21590 __pyx_t_1 = __Pyx_PyInt_to_py_int32_t(((struct __pyx_obj_9csamtools_AlignedRead *)__pyx_v_self)->_delegate->core.isize); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21591 __Pyx_GOTREF(__pyx_t_1);
21592 __pyx_r = __pyx_t_1;
21596 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
21599 __Pyx_XDECREF(__pyx_t_1);
21600 __Pyx_AddTraceback("csamtools.AlignedRead.isize.__get__");
21603 __Pyx_XGIVEREF(__pyx_r);
21604 __Pyx_TraceReturn(__pyx_r);
21605 __Pyx_RefNannyFinishContext();
21609 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2419
21610 * """the insert size"""
21611 * def __get__(self): return self._delegate.core.isize
21612 * def __set__(self, isize): self._delegate.core.isize = isize # <<<<<<<<<<<<<<
21613 * property is_paired:
21614 * """true if read is paired in sequencing"""
21617 static int __pyx_pf_9csamtools_11AlignedRead_5isize___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_isize); /*proto*/
21618 static int __pyx_pf_9csamtools_11AlignedRead_5isize___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_isize) {
21621 __Pyx_TraceDeclarations
21622 __Pyx_RefNannySetupContext("__set__");
21623 __Pyx_TraceCall("__set__", __pyx_f[0], 2419);
21624 __pyx_t_1 = __Pyx_PyInt_from_py_int32_t(__pyx_v_isize); if (unlikely((__pyx_t_1 == (int32_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2419; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21625 ((struct __pyx_obj_9csamtools_AlignedRead *)__pyx_v_self)->_delegate->core.isize = __pyx_t_1;
21630 __Pyx_AddTraceback("csamtools.AlignedRead.isize.__set__");
21633 __Pyx_TraceReturn(Py_None);
21634 __Pyx_RefNannyFinishContext();
21638 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2422
21639 * property is_paired:
21640 * """true if read is paired in sequencing"""
21641 * def __get__(self): return (self._delegate.core.flag & BAM_FPAIRED) != 0 # <<<<<<<<<<<<<<
21642 * def __set__(self,val):
21643 * if val: self._delegate.core.flag |= BAM_FPAIRED
21646 static PyObject *__pyx_pf_9csamtools_11AlignedRead_9is_paired___get__(PyObject *__pyx_v_self); /*proto*/
21647 static PyObject *__pyx_pf_9csamtools_11AlignedRead_9is_paired___get__(PyObject *__pyx_v_self) {
21648 PyObject *__pyx_r = NULL;
21649 PyObject *__pyx_t_1 = NULL;
21650 __Pyx_TraceDeclarations
21651 __Pyx_RefNannySetupContext("__get__");
21652 __Pyx_TraceCall("__get__", __pyx_f[0], 2422);
21653 __Pyx_XDECREF(__pyx_r);
21654 __pyx_t_1 = __Pyx_PyBool_FromLong(((((struct __pyx_obj_9csamtools_AlignedRead *)__pyx_v_self)->_delegate->core.flag & 1) != 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2422; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21655 __Pyx_GOTREF(__pyx_t_1);
21656 __pyx_r = __pyx_t_1;
21660 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
21663 __Pyx_XDECREF(__pyx_t_1);
21664 __Pyx_AddTraceback("csamtools.AlignedRead.is_paired.__get__");
21667 __Pyx_XGIVEREF(__pyx_r);
21668 __Pyx_TraceReturn(__pyx_r);
21669 __Pyx_RefNannyFinishContext();
21673 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2423
21674 * """true if read is paired in sequencing"""
21675 * def __get__(self): return (self._delegate.core.flag & BAM_FPAIRED) != 0
21676 * def __set__(self,val): # <<<<<<<<<<<<<<
21677 * if val: self._delegate.core.flag |= BAM_FPAIRED
21678 * else: self._delegate.core.flag &= ~BAM_FPAIRED
21681 static int __pyx_pf_9csamtools_11AlignedRead_9is_paired___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/
21682 static int __pyx_pf_9csamtools_11AlignedRead_9is_paired___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) {
21685 __Pyx_TraceDeclarations
21686 __Pyx_RefNannySetupContext("__set__");
21687 __Pyx_TraceCall("__set__", __pyx_f[0], 2423);
21689 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2424
21690 * def __get__(self): return (self._delegate.core.flag & BAM_FPAIRED) != 0
21691 * def __set__(self,val):
21692 * if val: self._delegate.core.flag |= BAM_FPAIRED # <<<<<<<<<<<<<<
21693 * else: self._delegate.core.flag &= ~BAM_FPAIRED
21694 * property is_proper_pair:
21696 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_val); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21698 ((struct __pyx_obj_9csamtools_AlignedRead *)__pyx_v_self)->_delegate->core.flag |= 1;
21703 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2425
21704 * def __set__(self,val):
21705 * if val: self._delegate.core.flag |= BAM_FPAIRED
21706 * else: self._delegate.core.flag &= ~BAM_FPAIRED # <<<<<<<<<<<<<<
21707 * property is_proper_pair:
21708 * """true if read is mapped in a proper pair"""
21710 ((struct __pyx_obj_9csamtools_AlignedRead *)__pyx_v_self)->_delegate->core.flag &= (~1);
21717 __Pyx_AddTraceback("csamtools.AlignedRead.is_paired.__set__");
21720 __Pyx_TraceReturn(Py_None);
21721 __Pyx_RefNannyFinishContext();
21725 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2428
21726 * property is_proper_pair:
21727 * """true if read is mapped in a proper pair"""
21728 * def __get__(self): return (self.flag & BAM_FPROPER_PAIR) != 0 # <<<<<<<<<<<<<<
21729 * def __set__(self,val):
21730 * if val: self._delegate.core.flag |= BAM_FPROPER_PAIR
21733 static PyObject *__pyx_pf_9csamtools_11AlignedRead_14is_proper_pair___get__(PyObject *__pyx_v_self); /*proto*/
21734 static PyObject *__pyx_pf_9csamtools_11AlignedRead_14is_proper_pair___get__(PyObject *__pyx_v_self) {
21735 PyObject *__pyx_r = NULL;
21736 PyObject *__pyx_t_1 = NULL;
21737 PyObject *__pyx_t_2 = NULL;
21738 __Pyx_TraceDeclarations
21739 __Pyx_RefNannySetupContext("__get__");
21740 __Pyx_TraceCall("__get__", __pyx_f[0], 2428);
21741 __Pyx_XDECREF(__pyx_r);
21742 __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__flag); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21743 __Pyx_GOTREF(__pyx_t_1);
21744 __pyx_t_2 = PyNumber_And(__pyx_t_1, __pyx_int_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21745 __Pyx_GOTREF(__pyx_t_2);
21746 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21747 __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_int_0, Py_NE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21748 __Pyx_GOTREF(__pyx_t_1);
21749 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21750 __pyx_r = __pyx_t_1;
21754 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
21757 __Pyx_XDECREF(__pyx_t_1);
21758 __Pyx_XDECREF(__pyx_t_2);
21759 __Pyx_AddTraceback("csamtools.AlignedRead.is_proper_pair.__get__");
21762 __Pyx_XGIVEREF(__pyx_r);
21763 __Pyx_TraceReturn(__pyx_r);
21764 __Pyx_RefNannyFinishContext();
21768 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2429
21769 * """true if read is mapped in a proper pair"""
21770 * def __get__(self): return (self.flag & BAM_FPROPER_PAIR) != 0
21771 * def __set__(self,val): # <<<<<<<<<<<<<<
21772 * if val: self._delegate.core.flag |= BAM_FPROPER_PAIR
21773 * else: self._delegate.core.flag &= ~BAM_FPROPER_PAIR
21776 static int __pyx_pf_9csamtools_11AlignedRead_14is_proper_pair___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/
21777 static int __pyx_pf_9csamtools_11AlignedRead_14is_proper_pair___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) {
21780 __Pyx_TraceDeclarations
21781 __Pyx_RefNannySetupContext("__set__");
21782 __Pyx_TraceCall("__set__", __pyx_f[0], 2429);
21784 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2430
21785 * def __get__(self): return (self.flag & BAM_FPROPER_PAIR) != 0
21786 * def __set__(self,val):
21787 * if val: self._delegate.core.flag |= BAM_FPROPER_PAIR # <<<<<<<<<<<<<<
21788 * else: self._delegate.core.flag &= ~BAM_FPROPER_PAIR
21789 * property is_unmapped:
21791 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_val); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2430; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21793 ((struct __pyx_obj_9csamtools_AlignedRead *)__pyx_v_self)->_delegate->core.flag |= 2;
21798 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2431
21799 * def __set__(self,val):
21800 * if val: self._delegate.core.flag |= BAM_FPROPER_PAIR
21801 * else: self._delegate.core.flag &= ~BAM_FPROPER_PAIR # <<<<<<<<<<<<<<
21802 * property is_unmapped:
21803 * """true if read itself is unmapped"""
21805 ((struct __pyx_obj_9csamtools_AlignedRead *)__pyx_v_self)->_delegate->core.flag &= (~2);
21812 __Pyx_AddTraceback("csamtools.AlignedRead.is_proper_pair.__set__");
21815 __Pyx_TraceReturn(Py_None);
21816 __Pyx_RefNannyFinishContext();
21820 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2434
21821 * property is_unmapped:
21822 * """true if read itself is unmapped"""
21823 * def __get__(self): return (self.flag & BAM_FUNMAP) != 0 # <<<<<<<<<<<<<<
21824 * def __set__(self,val):
21825 * if val: self._delegate.core.flag |= BAM_FUNMAP
21828 static PyObject *__pyx_pf_9csamtools_11AlignedRead_11is_unmapped___get__(PyObject *__pyx_v_self); /*proto*/
21829 static PyObject *__pyx_pf_9csamtools_11AlignedRead_11is_unmapped___get__(PyObject *__pyx_v_self) {
21830 PyObject *__pyx_r = NULL;
21831 PyObject *__pyx_t_1 = NULL;
21832 PyObject *__pyx_t_2 = NULL;
21833 __Pyx_TraceDeclarations
21834 __Pyx_RefNannySetupContext("__get__");
21835 __Pyx_TraceCall("__get__", __pyx_f[0], 2434);
21836 __Pyx_XDECREF(__pyx_r);
21837 __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__flag); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21838 __Pyx_GOTREF(__pyx_t_1);
21839 __pyx_t_2 = PyNumber_And(__pyx_t_1, __pyx_int_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21840 __Pyx_GOTREF(__pyx_t_2);
21841 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21842 __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_int_0, Py_NE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21843 __Pyx_GOTREF(__pyx_t_1);
21844 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21845 __pyx_r = __pyx_t_1;
21849 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
21852 __Pyx_XDECREF(__pyx_t_1);
21853 __Pyx_XDECREF(__pyx_t_2);
21854 __Pyx_AddTraceback("csamtools.AlignedRead.is_unmapped.__get__");
21857 __Pyx_XGIVEREF(__pyx_r);
21858 __Pyx_TraceReturn(__pyx_r);
21859 __Pyx_RefNannyFinishContext();
21863 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2435
21864 * """true if read itself is unmapped"""
21865 * def __get__(self): return (self.flag & BAM_FUNMAP) != 0
21866 * def __set__(self,val): # <<<<<<<<<<<<<<
21867 * if val: self._delegate.core.flag |= BAM_FUNMAP
21868 * else: self._delegate.core.flag &= ~BAM_FUNMAP
21871 static int __pyx_pf_9csamtools_11AlignedRead_11is_unmapped___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/
21872 static int __pyx_pf_9csamtools_11AlignedRead_11is_unmapped___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) {
21875 __Pyx_TraceDeclarations
21876 __Pyx_RefNannySetupContext("__set__");
21877 __Pyx_TraceCall("__set__", __pyx_f[0], 2435);
21879 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2436
21880 * def __get__(self): return (self.flag & BAM_FUNMAP) != 0
21881 * def __set__(self,val):
21882 * if val: self._delegate.core.flag |= BAM_FUNMAP # <<<<<<<<<<<<<<
21883 * else: self._delegate.core.flag &= ~BAM_FUNMAP
21884 * property mate_is_unmapped:
21886 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_val); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21888 ((struct __pyx_obj_9csamtools_AlignedRead *)__pyx_v_self)->_delegate->core.flag |= 4;
21893 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2437
21894 * def __set__(self,val):
21895 * if val: self._delegate.core.flag |= BAM_FUNMAP
21896 * else: self._delegate.core.flag &= ~BAM_FUNMAP # <<<<<<<<<<<<<<
21897 * property mate_is_unmapped:
21898 * """true if the mate is unmapped"""
21900 ((struct __pyx_obj_9csamtools_AlignedRead *)__pyx_v_self)->_delegate->core.flag &= (~4);
21907 __Pyx_AddTraceback("csamtools.AlignedRead.is_unmapped.__set__");
21910 __Pyx_TraceReturn(Py_None);
21911 __Pyx_RefNannyFinishContext();
21915 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2440
21916 * property mate_is_unmapped:
21917 * """true if the mate is unmapped"""
21918 * def __get__(self): return (self.flag & BAM_FMUNMAP) != 0 # <<<<<<<<<<<<<<
21919 * def __set__(self,val):
21920 * if val: self._delegate.core.flag |= BAM_FMUNMAP
21923 static PyObject *__pyx_pf_9csamtools_11AlignedRead_16mate_is_unmapped___get__(PyObject *__pyx_v_self); /*proto*/
21924 static PyObject *__pyx_pf_9csamtools_11AlignedRead_16mate_is_unmapped___get__(PyObject *__pyx_v_self) {
21925 PyObject *__pyx_r = NULL;
21926 PyObject *__pyx_t_1 = NULL;
21927 PyObject *__pyx_t_2 = NULL;
21928 __Pyx_TraceDeclarations
21929 __Pyx_RefNannySetupContext("__get__");
21930 __Pyx_TraceCall("__get__", __pyx_f[0], 2440);
21931 __Pyx_XDECREF(__pyx_r);
21932 __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__flag); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2440; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21933 __Pyx_GOTREF(__pyx_t_1);
21934 __pyx_t_2 = PyNumber_And(__pyx_t_1, __pyx_int_8); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2440; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21935 __Pyx_GOTREF(__pyx_t_2);
21936 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21937 __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_int_0, Py_NE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2440; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21938 __Pyx_GOTREF(__pyx_t_1);
21939 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21940 __pyx_r = __pyx_t_1;
21944 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
21947 __Pyx_XDECREF(__pyx_t_1);
21948 __Pyx_XDECREF(__pyx_t_2);
21949 __Pyx_AddTraceback("csamtools.AlignedRead.mate_is_unmapped.__get__");
21952 __Pyx_XGIVEREF(__pyx_r);
21953 __Pyx_TraceReturn(__pyx_r);
21954 __Pyx_RefNannyFinishContext();
21958 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2441
21959 * """true if the mate is unmapped"""
21960 * def __get__(self): return (self.flag & BAM_FMUNMAP) != 0
21961 * def __set__(self,val): # <<<<<<<<<<<<<<
21962 * if val: self._delegate.core.flag |= BAM_FMUNMAP
21963 * else: self._delegate.core.flag &= ~BAM_FMUNMAP
21966 static int __pyx_pf_9csamtools_11AlignedRead_16mate_is_unmapped___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/
21967 static int __pyx_pf_9csamtools_11AlignedRead_16mate_is_unmapped___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) {
21970 __Pyx_TraceDeclarations
21971 __Pyx_RefNannySetupContext("__set__");
21972 __Pyx_TraceCall("__set__", __pyx_f[0], 2441);
21974 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2442
21975 * def __get__(self): return (self.flag & BAM_FMUNMAP) != 0
21976 * def __set__(self,val):
21977 * if val: self._delegate.core.flag |= BAM_FMUNMAP # <<<<<<<<<<<<<<
21978 * else: self._delegate.core.flag &= ~BAM_FMUNMAP
21979 * property is_reverse:
21981 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_val); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21983 ((struct __pyx_obj_9csamtools_AlignedRead *)__pyx_v_self)->_delegate->core.flag |= 8;
21988 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2443
21989 * def __set__(self,val):
21990 * if val: self._delegate.core.flag |= BAM_FMUNMAP
21991 * else: self._delegate.core.flag &= ~BAM_FMUNMAP # <<<<<<<<<<<<<<
21992 * property is_reverse:
21993 * """true if read is mapped to reverse strand"""
21995 ((struct __pyx_obj_9csamtools_AlignedRead *)__pyx_v_self)->_delegate->core.flag &= (~8);
22002 __Pyx_AddTraceback("csamtools.AlignedRead.mate_is_unmapped.__set__");
22005 __Pyx_TraceReturn(Py_None);
22006 __Pyx_RefNannyFinishContext();
22010 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2446
22011 * property is_reverse:
22012 * """true if read is mapped to reverse strand"""
22013 * def __get__(self): return (self.flag & BAM_FREVERSE) != 0 # <<<<<<<<<<<<<<
22014 * def __set__(self,val):
22015 * if val: self._delegate.core.flag |= BAM_FREVERSE
22018 static PyObject *__pyx_pf_9csamtools_11AlignedRead_10is_reverse___get__(PyObject *__pyx_v_self); /*proto*/
22019 static PyObject *__pyx_pf_9csamtools_11AlignedRead_10is_reverse___get__(PyObject *__pyx_v_self) {
22020 PyObject *__pyx_r = NULL;
22021 PyObject *__pyx_t_1 = NULL;
22022 PyObject *__pyx_t_2 = NULL;
22023 __Pyx_TraceDeclarations
22024 __Pyx_RefNannySetupContext("__get__");
22025 __Pyx_TraceCall("__get__", __pyx_f[0], 2446);
22026 __Pyx_XDECREF(__pyx_r);
22027 __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__flag); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2446; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22028 __Pyx_GOTREF(__pyx_t_1);
22029 __pyx_t_2 = PyNumber_And(__pyx_t_1, __pyx_int_16); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2446; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22030 __Pyx_GOTREF(__pyx_t_2);
22031 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22032 __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_int_0, Py_NE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2446; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22033 __Pyx_GOTREF(__pyx_t_1);
22034 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22035 __pyx_r = __pyx_t_1;
22039 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
22042 __Pyx_XDECREF(__pyx_t_1);
22043 __Pyx_XDECREF(__pyx_t_2);
22044 __Pyx_AddTraceback("csamtools.AlignedRead.is_reverse.__get__");
22047 __Pyx_XGIVEREF(__pyx_r);
22048 __Pyx_TraceReturn(__pyx_r);
22049 __Pyx_RefNannyFinishContext();
22053 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2447
22054 * """true if read is mapped to reverse strand"""
22055 * def __get__(self): return (self.flag & BAM_FREVERSE) != 0
22056 * def __set__(self,val): # <<<<<<<<<<<<<<
22057 * if val: self._delegate.core.flag |= BAM_FREVERSE
22058 * else: self._delegate.core.flag &= ~BAM_FREVERSE
22061 static int __pyx_pf_9csamtools_11AlignedRead_10is_reverse___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/
22062 static int __pyx_pf_9csamtools_11AlignedRead_10is_reverse___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) {
22065 __Pyx_TraceDeclarations
22066 __Pyx_RefNannySetupContext("__set__");
22067 __Pyx_TraceCall("__set__", __pyx_f[0], 2447);
22069 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2448
22070 * def __get__(self): return (self.flag & BAM_FREVERSE) != 0
22071 * def __set__(self,val):
22072 * if val: self._delegate.core.flag |= BAM_FREVERSE # <<<<<<<<<<<<<<
22073 * else: self._delegate.core.flag &= ~BAM_FREVERSE
22074 * property mate_is_reverse:
22076 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_val); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22078 ((struct __pyx_obj_9csamtools_AlignedRead *)__pyx_v_self)->_delegate->core.flag |= 16;
22083 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2449
22084 * def __set__(self,val):
22085 * if val: self._delegate.core.flag |= BAM_FREVERSE
22086 * else: self._delegate.core.flag &= ~BAM_FREVERSE # <<<<<<<<<<<<<<
22087 * property mate_is_reverse:
22088 * """true is read is mapped to reverse strand"""
22090 ((struct __pyx_obj_9csamtools_AlignedRead *)__pyx_v_self)->_delegate->core.flag &= (~16);
22097 __Pyx_AddTraceback("csamtools.AlignedRead.is_reverse.__set__");
22100 __Pyx_TraceReturn(Py_None);
22101 __Pyx_RefNannyFinishContext();
22105 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2452
22106 * property mate_is_reverse:
22107 * """true is read is mapped to reverse strand"""
22108 * def __get__(self): return (self.flag & BAM_FMREVERSE) != 0 # <<<<<<<<<<<<<<
22109 * def __set__(self,val):
22110 * if val: self._delegate.core.flag |= BAM_FMREVERSE
22113 static PyObject *__pyx_pf_9csamtools_11AlignedRead_15mate_is_reverse___get__(PyObject *__pyx_v_self); /*proto*/
22114 static PyObject *__pyx_pf_9csamtools_11AlignedRead_15mate_is_reverse___get__(PyObject *__pyx_v_self) {
22115 PyObject *__pyx_r = NULL;
22116 PyObject *__pyx_t_1 = NULL;
22117 PyObject *__pyx_t_2 = NULL;
22118 __Pyx_TraceDeclarations
22119 __Pyx_RefNannySetupContext("__get__");
22120 __Pyx_TraceCall("__get__", __pyx_f[0], 2452);
22121 __Pyx_XDECREF(__pyx_r);
22122 __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__flag); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22123 __Pyx_GOTREF(__pyx_t_1);
22124 __pyx_t_2 = PyNumber_And(__pyx_t_1, __pyx_int_32); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22125 __Pyx_GOTREF(__pyx_t_2);
22126 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22127 __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_int_0, Py_NE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22128 __Pyx_GOTREF(__pyx_t_1);
22129 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22130 __pyx_r = __pyx_t_1;
22134 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
22137 __Pyx_XDECREF(__pyx_t_1);
22138 __Pyx_XDECREF(__pyx_t_2);
22139 __Pyx_AddTraceback("csamtools.AlignedRead.mate_is_reverse.__get__");
22142 __Pyx_XGIVEREF(__pyx_r);
22143 __Pyx_TraceReturn(__pyx_r);
22144 __Pyx_RefNannyFinishContext();
22148 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2453
22149 * """true is read is mapped to reverse strand"""
22150 * def __get__(self): return (self.flag & BAM_FMREVERSE) != 0
22151 * def __set__(self,val): # <<<<<<<<<<<<<<
22152 * if val: self._delegate.core.flag |= BAM_FMREVERSE
22153 * else: self._delegate.core.flag &= ~BAM_FMREVERSE
22156 static int __pyx_pf_9csamtools_11AlignedRead_15mate_is_reverse___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/
22157 static int __pyx_pf_9csamtools_11AlignedRead_15mate_is_reverse___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) {
22160 __Pyx_TraceDeclarations
22161 __Pyx_RefNannySetupContext("__set__");
22162 __Pyx_TraceCall("__set__", __pyx_f[0], 2453);
22164 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2454
22165 * def __get__(self): return (self.flag & BAM_FMREVERSE) != 0
22166 * def __set__(self,val):
22167 * if val: self._delegate.core.flag |= BAM_FMREVERSE # <<<<<<<<<<<<<<
22168 * else: self._delegate.core.flag &= ~BAM_FMREVERSE
22169 * property is_read1:
22171 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_val); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22173 ((struct __pyx_obj_9csamtools_AlignedRead *)__pyx_v_self)->_delegate->core.flag |= 32;
22178 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2455
22179 * def __set__(self,val):
22180 * if val: self._delegate.core.flag |= BAM_FMREVERSE
22181 * else: self._delegate.core.flag &= ~BAM_FMREVERSE # <<<<<<<<<<<<<<
22182 * property is_read1:
22183 * """true if this is read1"""
22185 ((struct __pyx_obj_9csamtools_AlignedRead *)__pyx_v_self)->_delegate->core.flag &= (~32);
22192 __Pyx_AddTraceback("csamtools.AlignedRead.mate_is_reverse.__set__");
22195 __Pyx_TraceReturn(Py_None);
22196 __Pyx_RefNannyFinishContext();
22200 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2458
22201 * property is_read1:
22202 * """true if this is read1"""
22203 * def __get__(self): return (self.flag & BAM_FREAD1) != 0 # <<<<<<<<<<<<<<
22204 * def __set__(self,val):
22205 * if val: self._delegate.core.flag |= BAM_FREAD1
22208 static PyObject *__pyx_pf_9csamtools_11AlignedRead_8is_read1___get__(PyObject *__pyx_v_self); /*proto*/
22209 static PyObject *__pyx_pf_9csamtools_11AlignedRead_8is_read1___get__(PyObject *__pyx_v_self) {
22210 PyObject *__pyx_r = NULL;
22211 PyObject *__pyx_t_1 = NULL;
22212 PyObject *__pyx_t_2 = NULL;
22213 __Pyx_TraceDeclarations
22214 __Pyx_RefNannySetupContext("__get__");
22215 __Pyx_TraceCall("__get__", __pyx_f[0], 2458);
22216 __Pyx_XDECREF(__pyx_r);
22217 __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__flag); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22218 __Pyx_GOTREF(__pyx_t_1);
22219 __pyx_t_2 = PyNumber_And(__pyx_t_1, __pyx_int_64); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22220 __Pyx_GOTREF(__pyx_t_2);
22221 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22222 __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_int_0, Py_NE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22223 __Pyx_GOTREF(__pyx_t_1);
22224 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22225 __pyx_r = __pyx_t_1;
22229 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
22232 __Pyx_XDECREF(__pyx_t_1);
22233 __Pyx_XDECREF(__pyx_t_2);
22234 __Pyx_AddTraceback("csamtools.AlignedRead.is_read1.__get__");
22237 __Pyx_XGIVEREF(__pyx_r);
22238 __Pyx_TraceReturn(__pyx_r);
22239 __Pyx_RefNannyFinishContext();
22243 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2459
22244 * """true if this is read1"""
22245 * def __get__(self): return (self.flag & BAM_FREAD1) != 0
22246 * def __set__(self,val): # <<<<<<<<<<<<<<
22247 * if val: self._delegate.core.flag |= BAM_FREAD1
22248 * else: self._delegate.core.flag &= ~BAM_FREAD1
22251 static int __pyx_pf_9csamtools_11AlignedRead_8is_read1___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/
22252 static int __pyx_pf_9csamtools_11AlignedRead_8is_read1___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) {
22255 __Pyx_TraceDeclarations
22256 __Pyx_RefNannySetupContext("__set__");
22257 __Pyx_TraceCall("__set__", __pyx_f[0], 2459);
22259 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2460
22260 * def __get__(self): return (self.flag & BAM_FREAD1) != 0
22261 * def __set__(self,val):
22262 * if val: self._delegate.core.flag |= BAM_FREAD1 # <<<<<<<<<<<<<<
22263 * else: self._delegate.core.flag &= ~BAM_FREAD1
22264 * property is_read2:
22266 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_val); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22268 ((struct __pyx_obj_9csamtools_AlignedRead *)__pyx_v_self)->_delegate->core.flag |= 64;
22273 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2461
22274 * def __set__(self,val):
22275 * if val: self._delegate.core.flag |= BAM_FREAD1
22276 * else: self._delegate.core.flag &= ~BAM_FREAD1 # <<<<<<<<<<<<<<
22277 * property is_read2:
22278 * """true if this is read2"""
22280 ((struct __pyx_obj_9csamtools_AlignedRead *)__pyx_v_self)->_delegate->core.flag &= (~64);
22287 __Pyx_AddTraceback("csamtools.AlignedRead.is_read1.__set__");
22290 __Pyx_TraceReturn(Py_None);
22291 __Pyx_RefNannyFinishContext();
22295 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2464
22296 * property is_read2:
22297 * """true if this is read2"""
22298 * def __get__(self): return (self.flag & BAM_FREAD2) != 0 # <<<<<<<<<<<<<<
22299 * def __set__(self,val):
22300 * if val: self._delegate.core.flag |= BAM_FREAD2
22303 static PyObject *__pyx_pf_9csamtools_11AlignedRead_8is_read2___get__(PyObject *__pyx_v_self); /*proto*/
22304 static PyObject *__pyx_pf_9csamtools_11AlignedRead_8is_read2___get__(PyObject *__pyx_v_self) {
22305 PyObject *__pyx_r = NULL;
22306 PyObject *__pyx_t_1 = NULL;
22307 PyObject *__pyx_t_2 = NULL;
22308 __Pyx_TraceDeclarations
22309 __Pyx_RefNannySetupContext("__get__");
22310 __Pyx_TraceCall("__get__", __pyx_f[0], 2464);
22311 __Pyx_XDECREF(__pyx_r);
22312 __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__flag); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2464; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22313 __Pyx_GOTREF(__pyx_t_1);
22314 __pyx_t_2 = PyNumber_And(__pyx_t_1, __pyx_int_128); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2464; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22315 __Pyx_GOTREF(__pyx_t_2);
22316 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22317 __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_int_0, Py_NE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2464; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22318 __Pyx_GOTREF(__pyx_t_1);
22319 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22320 __pyx_r = __pyx_t_1;
22324 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
22327 __Pyx_XDECREF(__pyx_t_1);
22328 __Pyx_XDECREF(__pyx_t_2);
22329 __Pyx_AddTraceback("csamtools.AlignedRead.is_read2.__get__");
22332 __Pyx_XGIVEREF(__pyx_r);
22333 __Pyx_TraceReturn(__pyx_r);
22334 __Pyx_RefNannyFinishContext();
22338 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2465
22339 * """true if this is read2"""
22340 * def __get__(self): return (self.flag & BAM_FREAD2) != 0
22341 * def __set__(self,val): # <<<<<<<<<<<<<<
22342 * if val: self._delegate.core.flag |= BAM_FREAD2
22343 * else: self._delegate.core.flag &= ~BAM_FREAD2
22346 static int __pyx_pf_9csamtools_11AlignedRead_8is_read2___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/
22347 static int __pyx_pf_9csamtools_11AlignedRead_8is_read2___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) {
22350 __Pyx_TraceDeclarations
22351 __Pyx_RefNannySetupContext("__set__");
22352 __Pyx_TraceCall("__set__", __pyx_f[0], 2465);
22354 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2466
22355 * def __get__(self): return (self.flag & BAM_FREAD2) != 0
22356 * def __set__(self,val):
22357 * if val: self._delegate.core.flag |= BAM_FREAD2 # <<<<<<<<<<<<<<
22358 * else: self._delegate.core.flag &= ~BAM_FREAD2
22359 * property is_secondary:
22361 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_val); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22363 ((struct __pyx_obj_9csamtools_AlignedRead *)__pyx_v_self)->_delegate->core.flag |= 128;
22368 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2467
22369 * def __set__(self,val):
22370 * if val: self._delegate.core.flag |= BAM_FREAD2
22371 * else: self._delegate.core.flag &= ~BAM_FREAD2 # <<<<<<<<<<<<<<
22372 * property is_secondary:
22373 * """true if not primary alignment"""
22375 ((struct __pyx_obj_9csamtools_AlignedRead *)__pyx_v_self)->_delegate->core.flag &= (~128);
22382 __Pyx_AddTraceback("csamtools.AlignedRead.is_read2.__set__");
22385 __Pyx_TraceReturn(Py_None);
22386 __Pyx_RefNannyFinishContext();
22390 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2470
22391 * property is_secondary:
22392 * """true if not primary alignment"""
22393 * def __get__(self): return (self.flag & BAM_FSECONDARY) != 0 # <<<<<<<<<<<<<<
22394 * def __set__(self,val):
22395 * if val: self._delegate.core.flag |= BAM_FSECONDARY
22398 static PyObject *__pyx_pf_9csamtools_11AlignedRead_12is_secondary___get__(PyObject *__pyx_v_self); /*proto*/
22399 static PyObject *__pyx_pf_9csamtools_11AlignedRead_12is_secondary___get__(PyObject *__pyx_v_self) {
22400 PyObject *__pyx_r = NULL;
22401 PyObject *__pyx_t_1 = NULL;
22402 PyObject *__pyx_t_2 = NULL;
22403 __Pyx_TraceDeclarations
22404 __Pyx_RefNannySetupContext("__get__");
22405 __Pyx_TraceCall("__get__", __pyx_f[0], 2470);
22406 __Pyx_XDECREF(__pyx_r);
22407 __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__flag); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2470; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22408 __Pyx_GOTREF(__pyx_t_1);
22409 __pyx_t_2 = PyNumber_And(__pyx_t_1, __pyx_int_256); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2470; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22410 __Pyx_GOTREF(__pyx_t_2);
22411 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22412 __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_int_0, Py_NE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2470; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22413 __Pyx_GOTREF(__pyx_t_1);
22414 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22415 __pyx_r = __pyx_t_1;
22419 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
22422 __Pyx_XDECREF(__pyx_t_1);
22423 __Pyx_XDECREF(__pyx_t_2);
22424 __Pyx_AddTraceback("csamtools.AlignedRead.is_secondary.__get__");
22427 __Pyx_XGIVEREF(__pyx_r);
22428 __Pyx_TraceReturn(__pyx_r);
22429 __Pyx_RefNannyFinishContext();
22433 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2471
22434 * """true if not primary alignment"""
22435 * def __get__(self): return (self.flag & BAM_FSECONDARY) != 0
22436 * def __set__(self,val): # <<<<<<<<<<<<<<
22437 * if val: self._delegate.core.flag |= BAM_FSECONDARY
22438 * else: self._delegate.core.flag &= ~BAM_FSECONDARY
22441 static int __pyx_pf_9csamtools_11AlignedRead_12is_secondary___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/
22442 static int __pyx_pf_9csamtools_11AlignedRead_12is_secondary___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) {
22445 __Pyx_TraceDeclarations
22446 __Pyx_RefNannySetupContext("__set__");
22447 __Pyx_TraceCall("__set__", __pyx_f[0], 2471);
22449 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2472
22450 * def __get__(self): return (self.flag & BAM_FSECONDARY) != 0
22451 * def __set__(self,val):
22452 * if val: self._delegate.core.flag |= BAM_FSECONDARY # <<<<<<<<<<<<<<
22453 * else: self._delegate.core.flag &= ~BAM_FSECONDARY
22454 * property is_qcfail:
22456 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_val); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2472; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22458 ((struct __pyx_obj_9csamtools_AlignedRead *)__pyx_v_self)->_delegate->core.flag |= 256;
22463 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2473
22464 * def __set__(self,val):
22465 * if val: self._delegate.core.flag |= BAM_FSECONDARY
22466 * else: self._delegate.core.flag &= ~BAM_FSECONDARY # <<<<<<<<<<<<<<
22467 * property is_qcfail:
22468 * """true if QC failure"""
22470 ((struct __pyx_obj_9csamtools_AlignedRead *)__pyx_v_self)->_delegate->core.flag &= (~256);
22477 __Pyx_AddTraceback("csamtools.AlignedRead.is_secondary.__set__");
22480 __Pyx_TraceReturn(Py_None);
22481 __Pyx_RefNannyFinishContext();
22485 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2476
22486 * property is_qcfail:
22487 * """true if QC failure"""
22488 * def __get__(self): return (self.flag & BAM_FQCFAIL) != 0 # <<<<<<<<<<<<<<
22489 * def __set__(self,val):
22490 * if val: self._delegate.core.flag |= BAM_FQCFAIL
22493 static PyObject *__pyx_pf_9csamtools_11AlignedRead_9is_qcfail___get__(PyObject *__pyx_v_self); /*proto*/
22494 static PyObject *__pyx_pf_9csamtools_11AlignedRead_9is_qcfail___get__(PyObject *__pyx_v_self) {
22495 PyObject *__pyx_r = NULL;
22496 PyObject *__pyx_t_1 = NULL;
22497 PyObject *__pyx_t_2 = NULL;
22498 __Pyx_TraceDeclarations
22499 __Pyx_RefNannySetupContext("__get__");
22500 __Pyx_TraceCall("__get__", __pyx_f[0], 2476);
22501 __Pyx_XDECREF(__pyx_r);
22502 __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__flag); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2476; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22503 __Pyx_GOTREF(__pyx_t_1);
22504 __pyx_t_2 = PyNumber_And(__pyx_t_1, __pyx_int_512); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2476; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22505 __Pyx_GOTREF(__pyx_t_2);
22506 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22507 __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_int_0, Py_NE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2476; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22508 __Pyx_GOTREF(__pyx_t_1);
22509 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22510 __pyx_r = __pyx_t_1;
22514 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
22517 __Pyx_XDECREF(__pyx_t_1);
22518 __Pyx_XDECREF(__pyx_t_2);
22519 __Pyx_AddTraceback("csamtools.AlignedRead.is_qcfail.__get__");
22522 __Pyx_XGIVEREF(__pyx_r);
22523 __Pyx_TraceReturn(__pyx_r);
22524 __Pyx_RefNannyFinishContext();
22528 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2477
22529 * """true if QC failure"""
22530 * def __get__(self): return (self.flag & BAM_FQCFAIL) != 0
22531 * def __set__(self,val): # <<<<<<<<<<<<<<
22532 * if val: self._delegate.core.flag |= BAM_FQCFAIL
22533 * else: self._delegate.core.flag &= ~BAM_FQCFAIL
22536 static int __pyx_pf_9csamtools_11AlignedRead_9is_qcfail___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/
22537 static int __pyx_pf_9csamtools_11AlignedRead_9is_qcfail___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) {
22540 __Pyx_TraceDeclarations
22541 __Pyx_RefNannySetupContext("__set__");
22542 __Pyx_TraceCall("__set__", __pyx_f[0], 2477);
22544 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2478
22545 * def __get__(self): return (self.flag & BAM_FQCFAIL) != 0
22546 * def __set__(self,val):
22547 * if val: self._delegate.core.flag |= BAM_FQCFAIL # <<<<<<<<<<<<<<
22548 * else: self._delegate.core.flag &= ~BAM_FQCFAIL
22549 * property is_duplicate:
22551 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_val); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22553 ((struct __pyx_obj_9csamtools_AlignedRead *)__pyx_v_self)->_delegate->core.flag |= 512;
22558 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2479
22559 * def __set__(self,val):
22560 * if val: self._delegate.core.flag |= BAM_FQCFAIL
22561 * else: self._delegate.core.flag &= ~BAM_FQCFAIL # <<<<<<<<<<<<<<
22562 * property is_duplicate:
22563 * """true if optical or PCR duplicate"""
22565 ((struct __pyx_obj_9csamtools_AlignedRead *)__pyx_v_self)->_delegate->core.flag &= (~512);
22572 __Pyx_AddTraceback("csamtools.AlignedRead.is_qcfail.__set__");
22575 __Pyx_TraceReturn(Py_None);
22576 __Pyx_RefNannyFinishContext();
22580 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2482
22581 * property is_duplicate:
22582 * """true if optical or PCR duplicate"""
22583 * def __get__(self): return (self.flag & BAM_FDUP) != 0 # <<<<<<<<<<<<<<
22584 * def __set__(self,val):
22585 * if val: self._delegate.core.flag |= BAM_FDUP
22588 static PyObject *__pyx_pf_9csamtools_11AlignedRead_12is_duplicate___get__(PyObject *__pyx_v_self); /*proto*/
22589 static PyObject *__pyx_pf_9csamtools_11AlignedRead_12is_duplicate___get__(PyObject *__pyx_v_self) {
22590 PyObject *__pyx_r = NULL;
22591 PyObject *__pyx_t_1 = NULL;
22592 PyObject *__pyx_t_2 = NULL;
22593 __Pyx_TraceDeclarations
22594 __Pyx_RefNannySetupContext("__get__");
22595 __Pyx_TraceCall("__get__", __pyx_f[0], 2482);
22596 __Pyx_XDECREF(__pyx_r);
22597 __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__flag); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22598 __Pyx_GOTREF(__pyx_t_1);
22599 __pyx_t_2 = PyNumber_And(__pyx_t_1, __pyx_int_1024); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22600 __Pyx_GOTREF(__pyx_t_2);
22601 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22602 __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_int_0, Py_NE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22603 __Pyx_GOTREF(__pyx_t_1);
22604 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22605 __pyx_r = __pyx_t_1;
22609 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
22612 __Pyx_XDECREF(__pyx_t_1);
22613 __Pyx_XDECREF(__pyx_t_2);
22614 __Pyx_AddTraceback("csamtools.AlignedRead.is_duplicate.__get__");
22617 __Pyx_XGIVEREF(__pyx_r);
22618 __Pyx_TraceReturn(__pyx_r);
22619 __Pyx_RefNannyFinishContext();
22623 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2483
22624 * """true if optical or PCR duplicate"""
22625 * def __get__(self): return (self.flag & BAM_FDUP) != 0
22626 * def __set__(self,val): # <<<<<<<<<<<<<<
22627 * if val: self._delegate.core.flag |= BAM_FDUP
22628 * else: self._delegate.core.flag &= ~BAM_FDUP
22631 static int __pyx_pf_9csamtools_11AlignedRead_12is_duplicate___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/
22632 static int __pyx_pf_9csamtools_11AlignedRead_12is_duplicate___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) {
22635 __Pyx_TraceDeclarations
22636 __Pyx_RefNannySetupContext("__set__");
22637 __Pyx_TraceCall("__set__", __pyx_f[0], 2483);
22639 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2484
22640 * def __get__(self): return (self.flag & BAM_FDUP) != 0
22641 * def __set__(self,val):
22642 * if val: self._delegate.core.flag |= BAM_FDUP # <<<<<<<<<<<<<<
22643 * else: self._delegate.core.flag &= ~BAM_FDUP
22644 * property positions:
22646 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_val); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2484; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22648 ((struct __pyx_obj_9csamtools_AlignedRead *)__pyx_v_self)->_delegate->core.flag |= 1024;
22653 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2485
22654 * def __set__(self,val):
22655 * if val: self._delegate.core.flag |= BAM_FDUP
22656 * else: self._delegate.core.flag &= ~BAM_FDUP # <<<<<<<<<<<<<<
22657 * property positions:
22658 * """a list of reference positions that this read aligns to."""
22660 ((struct __pyx_obj_9csamtools_AlignedRead *)__pyx_v_self)->_delegate->core.flag &= (~1024);
22667 __Pyx_AddTraceback("csamtools.AlignedRead.is_duplicate.__set__");
22670 __Pyx_TraceReturn(Py_None);
22671 __Pyx_RefNannyFinishContext();
22675 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2488
22676 * property positions:
22677 * """a list of reference positions that this read aligns to."""
22678 * def __get__(self): # <<<<<<<<<<<<<<
22679 * cdef uint32_t k, i, pos
22683 static PyObject *__pyx_pf_9csamtools_11AlignedRead_9positions___get__(PyObject *__pyx_v_self); /*proto*/
22684 static PyObject *__pyx_pf_9csamtools_11AlignedRead_9positions___get__(PyObject *__pyx_v_self) {
22685 uint32_t __pyx_v_k;
22686 uint32_t __pyx_v_i;
22687 uint32_t __pyx_v_pos;
22689 uint32_t *__pyx_v_cigar_p;
22690 bam1_t *__pyx_v_src;
22691 PyObject *__pyx_v_result;
22692 PyObject *__pyx_v_l;
22693 PyObject *__pyx_r = NULL;
22694 PyObject *__pyx_t_1 = NULL;
22696 uint32_t __pyx_t_3;
22697 PyObject *__pyx_t_4 = NULL;
22698 uint32_t __pyx_t_5;
22700 __Pyx_TraceDeclarations
22701 __Pyx_RefNannySetupContext("__get__");
22702 __Pyx_TraceCall("__get__", __pyx_f[0], 2488);
22703 __pyx_v_result = ((PyObject *)Py_None); __Pyx_INCREF(Py_None);
22704 __pyx_v_l = Py_None; __Pyx_INCREF(Py_None);
22706 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2494
22707 * cdef bam1_t * src
22709 * result = [] # <<<<<<<<<<<<<<
22710 * src = self._delegate
22711 * if src.core.n_cigar == 0: return []
22713 __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2494; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22714 __Pyx_GOTREF(((PyObject *)__pyx_t_1));
22715 __Pyx_DECREF(((PyObject *)__pyx_v_result));
22716 __pyx_v_result = __pyx_t_1;
22719 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2495
22722 * src = self._delegate # <<<<<<<<<<<<<<
22723 * if src.core.n_cigar == 0: return []
22726 __pyx_v_src = ((struct __pyx_obj_9csamtools_AlignedRead *)__pyx_v_self)->_delegate;
22728 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2496
22730 * src = self._delegate
22731 * if src.core.n_cigar == 0: return [] # <<<<<<<<<<<<<<
22733 * pos = src.core.pos
22735 __pyx_t_2 = (__pyx_v_src->core.n_cigar == 0);
22737 __Pyx_XDECREF(__pyx_r);
22738 __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22739 __Pyx_GOTREF(((PyObject *)__pyx_t_1));
22740 __pyx_r = ((PyObject *)__pyx_t_1);
22747 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2498
22748 * if src.core.n_cigar == 0: return []
22750 * pos = src.core.pos # <<<<<<<<<<<<<<
22752 * cigar_p = bam1_cigar(src)
22754 __pyx_v_pos = __pyx_v_src->core.pos;
22756 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2500
22757 * pos = src.core.pos
22759 * cigar_p = bam1_cigar(src) # <<<<<<<<<<<<<<
22760 * for k from 0 <= k < src.core.n_cigar:
22761 * op = cigar_p[k] & BAM_CIGAR_MASK
22763 __pyx_v_cigar_p = bam1_cigar(__pyx_v_src);
22765 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2501
22767 * cigar_p = bam1_cigar(src)
22768 * for k from 0 <= k < src.core.n_cigar: # <<<<<<<<<<<<<<
22769 * op = cigar_p[k] & BAM_CIGAR_MASK
22770 * l = cigar_p[k] >> BAM_CIGAR_SHIFT
22772 __pyx_t_3 = __pyx_v_src->core.n_cigar;
22773 for (__pyx_v_k = 0; __pyx_v_k < __pyx_t_3; __pyx_v_k++) {
22775 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2502
22776 * cigar_p = bam1_cigar(src)
22777 * for k from 0 <= k < src.core.n_cigar:
22778 * op = cigar_p[k] & BAM_CIGAR_MASK # <<<<<<<<<<<<<<
22779 * l = cigar_p[k] >> BAM_CIGAR_SHIFT
22780 * if op == BAM_CMATCH:
22782 __pyx_v_op = ((__pyx_v_cigar_p[__pyx_v_k]) & 15);
22784 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2503
22785 * for k from 0 <= k < src.core.n_cigar:
22786 * op = cigar_p[k] & BAM_CIGAR_MASK
22787 * l = cigar_p[k] >> BAM_CIGAR_SHIFT # <<<<<<<<<<<<<<
22788 * if op == BAM_CMATCH:
22789 * for i from pos <= i < pos + l:
22791 __pyx_t_1 = PyInt_FromLong(((__pyx_v_cigar_p[__pyx_v_k]) >> 4)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22792 __Pyx_GOTREF(__pyx_t_1);
22793 __Pyx_DECREF(__pyx_v_l);
22794 __pyx_v_l = __pyx_t_1;
22797 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2504
22798 * op = cigar_p[k] & BAM_CIGAR_MASK
22799 * l = cigar_p[k] >> BAM_CIGAR_SHIFT
22800 * if op == BAM_CMATCH: # <<<<<<<<<<<<<<
22801 * for i from pos <= i < pos + l:
22802 * result.append( i )
22804 __pyx_t_2 = (__pyx_v_op == 0);
22807 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2505
22808 * l = cigar_p[k] >> BAM_CIGAR_SHIFT
22809 * if op == BAM_CMATCH:
22810 * for i from pos <= i < pos + l: # <<<<<<<<<<<<<<
22811 * result.append( i )
22814 __pyx_t_1 = __Pyx_PyInt_to_py_uint32_t(__pyx_v_pos); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22815 __Pyx_GOTREF(__pyx_t_1);
22816 __pyx_t_4 = PyNumber_Add(__pyx_t_1, __pyx_v_l); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22817 __Pyx_GOTREF(__pyx_t_4);
22818 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22819 __pyx_t_5 = __Pyx_PyInt_from_py_uint32_t(__pyx_t_4); if (unlikely((__pyx_t_5 == (uint32_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22820 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22821 for (__pyx_v_i = __pyx_v_pos; __pyx_v_i < __pyx_t_5; __pyx_v_i++) {
22823 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2506
22824 * if op == BAM_CMATCH:
22825 * for i from pos <= i < pos + l:
22826 * result.append( i ) # <<<<<<<<<<<<<<
22828 * if op == BAM_CMATCH or op == BAM_CDEL or op == BAM_CREF_SKIP:
22830 if (unlikely(__pyx_v_result == Py_None)) {
22831 PyErr_SetString(PyExc_AttributeError, "'NoneType' object has no attribute 'append'"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22833 __pyx_t_4 = __Pyx_PyInt_to_py_uint32_t(__pyx_v_i); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22834 __Pyx_GOTREF(__pyx_t_4);
22835 __pyx_t_6 = PyList_Append(((PyObject *)__pyx_v_result), __pyx_t_4); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22836 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22842 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2508
22843 * result.append( i )
22845 * if op == BAM_CMATCH or op == BAM_CDEL or op == BAM_CREF_SKIP: # <<<<<<<<<<<<<<
22849 switch (__pyx_v_op) {
22854 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2509
22856 * if op == BAM_CMATCH or op == BAM_CDEL or op == BAM_CREF_SKIP:
22857 * pos += l # <<<<<<<<<<<<<<
22861 __pyx_t_5 = __Pyx_PyInt_from_py_uint32_t(__pyx_v_l); if (unlikely((__pyx_t_5 == (uint32_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2509; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22862 __pyx_v_pos += __pyx_t_5;
22867 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2511
22870 * return result # <<<<<<<<<<<<<<
22871 * def overlap( self, uint32_t start, uint32_t end ):
22872 * """return number of bases on reference overlapping *start* and *end*
22874 __Pyx_XDECREF(__pyx_r);
22875 __Pyx_INCREF(((PyObject *)__pyx_v_result));
22876 __pyx_r = ((PyObject *)__pyx_v_result);
22879 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
22882 __Pyx_XDECREF(__pyx_t_1);
22883 __Pyx_XDECREF(__pyx_t_4);
22884 __Pyx_AddTraceback("csamtools.AlignedRead.positions.__get__");
22887 __Pyx_DECREF(__pyx_v_result);
22888 __Pyx_DECREF(__pyx_v_l);
22889 __Pyx_XGIVEREF(__pyx_r);
22890 __Pyx_TraceReturn(__pyx_r);
22891 __Pyx_RefNannyFinishContext();
22895 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2512
22898 * def overlap( self, uint32_t start, uint32_t end ): # <<<<<<<<<<<<<<
22899 * """return number of bases on reference overlapping *start* and *end*
22903 static PyObject *__pyx_pf_9csamtools_11AlignedRead_overlap(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
22904 static char __pyx_doc_9csamtools_11AlignedRead_overlap[] = "AlignedRead.overlap(self, uint32_t start, uint32_t end)\nreturn number of bases on reference overlapping *start* and *end*\n ";
22905 static PyObject *__pyx_pf_9csamtools_11AlignedRead_overlap(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
22906 uint32_t __pyx_v_start;
22907 uint32_t __pyx_v_end;
22908 uint32_t __pyx_v_k;
22909 uint32_t __pyx_v_pos;
22910 uint32_t __pyx_v_overlap;
22913 uint32_t *__pyx_v_cigar_p;
22914 bam1_t *__pyx_v_src;
22915 PyObject *__pyx_v_l;
22916 PyObject *__pyx_r = NULL;
22918 uint32_t __pyx_t_2;
22919 PyObject *__pyx_t_3 = NULL;
22920 uint32_t __pyx_t_4;
22921 PyObject *__pyx_t_5 = NULL;
22922 PyObject *__pyx_t_6 = NULL;
22923 PyObject *__pyx_t_7 = NULL;
22924 uint32_t __pyx_t_8;
22925 uint32_t __pyx_t_9;
22927 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__start,&__pyx_n_s__end,0};
22928 __Pyx_TraceDeclarations
22929 __Pyx_RefNannySetupContext("overlap");
22930 __Pyx_TraceCall("overlap", __pyx_f[0], 2512);
22931 if (unlikely(__pyx_kwds)) {
22932 Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
22933 PyObject* values[2] = {0,0};
22934 switch (PyTuple_GET_SIZE(__pyx_args)) {
22935 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
22936 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
22938 default: goto __pyx_L5_argtuple_error;
22940 switch (PyTuple_GET_SIZE(__pyx_args)) {
22942 values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__start);
22943 if (likely(values[0])) kw_args--;
22944 else goto __pyx_L5_argtuple_error;
22946 values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__end);
22947 if (likely(values[1])) kw_args--;
22949 __Pyx_RaiseArgtupleInvalid("overlap", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2512; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
22952 if (unlikely(kw_args > 0)) {
22953 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "overlap") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2512; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
22955 __pyx_v_start = __Pyx_PyInt_from_py_uint32_t(values[0]); if (unlikely((__pyx_v_start == (uint32_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2512; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
22956 __pyx_v_end = __Pyx_PyInt_from_py_uint32_t(values[1]); if (unlikely((__pyx_v_end == (uint32_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2512; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
22957 } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
22958 goto __pyx_L5_argtuple_error;
22960 __pyx_v_start = __Pyx_PyInt_from_py_uint32_t(PyTuple_GET_ITEM(__pyx_args, 0)); if (unlikely((__pyx_v_start == (uint32_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2512; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
22961 __pyx_v_end = __Pyx_PyInt_from_py_uint32_t(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely((__pyx_v_end == (uint32_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2512; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
22963 goto __pyx_L4_argument_unpacking_done;
22964 __pyx_L5_argtuple_error:;
22965 __Pyx_RaiseArgtupleInvalid("overlap", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2512; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
22967 __Pyx_AddTraceback("csamtools.AlignedRead.overlap");
22968 __Pyx_RefNannyFinishContext();
22970 __pyx_L4_argument_unpacking_done:;
22971 __pyx_v_l = Py_None; __Pyx_INCREF(Py_None);
22973 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2520
22974 * cdef bam1_t * src
22976 * overlap = 0 # <<<<<<<<<<<<<<
22978 * src = self._delegate
22980 __pyx_v_overlap = 0;
22982 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2522
22985 * src = self._delegate # <<<<<<<<<<<<<<
22986 * if src.core.n_cigar == 0: return 0
22987 * pos = src.core.pos
22989 __pyx_v_src = ((struct __pyx_obj_9csamtools_AlignedRead *)__pyx_v_self)->_delegate;
22991 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2523
22993 * src = self._delegate
22994 * if src.core.n_cigar == 0: return 0 # <<<<<<<<<<<<<<
22995 * pos = src.core.pos
22998 __pyx_t_1 = (__pyx_v_src->core.n_cigar == 0);
23000 __Pyx_XDECREF(__pyx_r);
23001 __Pyx_INCREF(__pyx_int_0);
23002 __pyx_r = __pyx_int_0;
23008 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2524
23009 * src = self._delegate
23010 * if src.core.n_cigar == 0: return 0
23011 * pos = src.core.pos # <<<<<<<<<<<<<<
23015 __pyx_v_pos = __pyx_v_src->core.pos;
23017 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2525
23018 * if src.core.n_cigar == 0: return 0
23019 * pos = src.core.pos
23020 * o = 0 # <<<<<<<<<<<<<<
23022 * cigar_p = bam1_cigar(src)
23026 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2527
23029 * cigar_p = bam1_cigar(src) # <<<<<<<<<<<<<<
23030 * for k from 0 <= k < src.core.n_cigar:
23031 * op = cigar_p[k] & BAM_CIGAR_MASK
23033 __pyx_v_cigar_p = bam1_cigar(__pyx_v_src);
23035 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2528
23037 * cigar_p = bam1_cigar(src)
23038 * for k from 0 <= k < src.core.n_cigar: # <<<<<<<<<<<<<<
23039 * op = cigar_p[k] & BAM_CIGAR_MASK
23040 * l = cigar_p[k] >> BAM_CIGAR_SHIFT
23042 __pyx_t_2 = __pyx_v_src->core.n_cigar;
23043 for (__pyx_v_k = 0; __pyx_v_k < __pyx_t_2; __pyx_v_k++) {
23045 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2529
23046 * cigar_p = bam1_cigar(src)
23047 * for k from 0 <= k < src.core.n_cigar:
23048 * op = cigar_p[k] & BAM_CIGAR_MASK # <<<<<<<<<<<<<<
23049 * l = cigar_p[k] >> BAM_CIGAR_SHIFT
23052 __pyx_v_op = ((__pyx_v_cigar_p[__pyx_v_k]) & 15);
23054 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2530
23055 * for k from 0 <= k < src.core.n_cigar:
23056 * op = cigar_p[k] & BAM_CIGAR_MASK
23057 * l = cigar_p[k] >> BAM_CIGAR_SHIFT # <<<<<<<<<<<<<<
23059 * if op == BAM_CMATCH:
23061 __pyx_t_3 = PyInt_FromLong(((__pyx_v_cigar_p[__pyx_v_k]) >> 4)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2530; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23062 __Pyx_GOTREF(__pyx_t_3);
23063 __Pyx_DECREF(__pyx_v_l);
23064 __pyx_v_l = __pyx_t_3;
23067 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2532
23068 * l = cigar_p[k] >> BAM_CIGAR_SHIFT
23070 * if op == BAM_CMATCH: # <<<<<<<<<<<<<<
23071 * o = min( pos + l, end) - max( pos, start )
23072 * if o > 0: overlap += o
23074 __pyx_t_1 = (__pyx_v_op == 0);
23077 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2533
23079 * if op == BAM_CMATCH:
23080 * o = min( pos + l, end) - max( pos, start ) # <<<<<<<<<<<<<<
23081 * if o > 0: overlap += o
23084 __pyx_t_4 = __pyx_v_end;
23085 __pyx_t_3 = __Pyx_PyInt_to_py_uint32_t(__pyx_v_pos); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23086 __Pyx_GOTREF(__pyx_t_3);
23087 __pyx_t_5 = PyNumber_Add(__pyx_t_3, __pyx_v_l); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23088 __Pyx_GOTREF(__pyx_t_5);
23089 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23090 __pyx_t_6 = __Pyx_PyInt_to_py_uint32_t(__pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23091 __Pyx_GOTREF(__pyx_t_6);
23092 __pyx_t_7 = PyObject_RichCompare(__pyx_t_6, __pyx_t_5, Py_LT); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23093 __Pyx_GOTREF(__pyx_t_7);
23094 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
23095 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23096 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
23098 __pyx_t_7 = __Pyx_PyInt_to_py_uint32_t(__pyx_t_4); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23099 __Pyx_GOTREF(__pyx_t_7);
23100 __pyx_t_3 = __pyx_t_7;
23103 __Pyx_INCREF(__pyx_t_5);
23104 __pyx_t_3 = __pyx_t_5;
23106 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
23107 __pyx_t_4 = __pyx_v_start;
23108 __pyx_t_8 = __pyx_v_pos;
23109 if ((__pyx_t_4 > __pyx_t_8)) {
23110 __pyx_t_9 = __pyx_t_4;
23112 __pyx_t_9 = __pyx_t_8;
23114 __pyx_t_5 = __Pyx_PyInt_to_py_uint32_t(__pyx_t_9); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23115 __Pyx_GOTREF(__pyx_t_5);
23116 __pyx_t_7 = PyNumber_Subtract(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23117 __Pyx_GOTREF(__pyx_t_7);
23118 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23119 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
23120 __pyx_t_10 = __Pyx_PyInt_AsInt(__pyx_t_7); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23121 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
23122 __pyx_v_o = __pyx_t_10;
23124 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2534
23125 * if op == BAM_CMATCH:
23126 * o = min( pos + l, end) - max( pos, start )
23127 * if o > 0: overlap += o # <<<<<<<<<<<<<<
23129 * if op == BAM_CMATCH or op == BAM_CDEL or op == BAM_CREF_SKIP:
23131 __pyx_t_1 = (__pyx_v_o > 0);
23133 __pyx_v_overlap += __pyx_v_o;
23141 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2536
23142 * if o > 0: overlap += o
23144 * if op == BAM_CMATCH or op == BAM_CDEL or op == BAM_CREF_SKIP: # <<<<<<<<<<<<<<
23148 switch (__pyx_v_op) {
23153 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2537
23155 * if op == BAM_CMATCH or op == BAM_CDEL or op == BAM_CREF_SKIP:
23156 * pos += l # <<<<<<<<<<<<<<
23160 __pyx_t_9 = __Pyx_PyInt_from_py_uint32_t(__pyx_v_l); if (unlikely((__pyx_t_9 == (uint32_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2537; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23161 __pyx_v_pos += __pyx_t_9;
23166 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2539
23169 * return overlap # <<<<<<<<<<<<<<
23171 * def opt(self, tag):
23173 __Pyx_XDECREF(__pyx_r);
23174 __pyx_t_7 = __Pyx_PyInt_to_py_uint32_t(__pyx_v_overlap); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2539; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23175 __Pyx_GOTREF(__pyx_t_7);
23176 __pyx_r = __pyx_t_7;
23180 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
23183 __Pyx_XDECREF(__pyx_t_3);
23184 __Pyx_XDECREF(__pyx_t_5);
23185 __Pyx_XDECREF(__pyx_t_6);
23186 __Pyx_XDECREF(__pyx_t_7);
23187 __Pyx_AddTraceback("csamtools.AlignedRead.overlap");
23190 __Pyx_DECREF(__pyx_v_l);
23191 __Pyx_XGIVEREF(__pyx_r);
23192 __Pyx_TraceReturn(__pyx_r);
23193 __Pyx_RefNannyFinishContext();
23197 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2541
23200 * def opt(self, tag): # <<<<<<<<<<<<<<
23201 * """retrieves optional data given a two-letter *tag*"""
23202 * #see bam_aux.c: bam_aux_get() and bam_aux2i() etc
23205 static PyObject *__pyx_pf_9csamtools_11AlignedRead_opt(PyObject *__pyx_v_self, PyObject *__pyx_v_tag); /*proto*/
23206 static char __pyx_doc_9csamtools_11AlignedRead_opt[] = "AlignedRead.opt(self, tag)\nretrieves optional data given a two-letter *tag*";
23207 static PyObject *__pyx_pf_9csamtools_11AlignedRead_opt(PyObject *__pyx_v_self, PyObject *__pyx_v_tag) {
23208 uint8_t *__pyx_v_v;
23209 PyObject *__pyx_v_type;
23210 PyObject *__pyx_r = NULL;
23213 PyObject *__pyx_t_3 = NULL;
23214 PyObject *__pyx_t_4 = NULL;
23219 __Pyx_TraceDeclarations
23220 __Pyx_RefNannySetupContext("opt");
23221 __Pyx_TraceCall("opt", __pyx_f[0], 2541);
23222 __pyx_v_type = Py_None; __Pyx_INCREF(Py_None);
23224 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2545
23225 * #see bam_aux.c: bam_aux_get() and bam_aux2i() etc
23227 * v = bam_aux_get(self._delegate, tag) # <<<<<<<<<<<<<<
23228 * if v == NULL: raise KeyError( "tag '%s' not present" % tag )
23231 __pyx_t_1 = PyBytes_AsString(__pyx_v_tag); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2545; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23232 __pyx_v_v = bam_aux_get(((struct __pyx_obj_9csamtools_AlignedRead *)__pyx_v_self)->_delegate, __pyx_t_1);
23234 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2546
23236 * v = bam_aux_get(self._delegate, tag)
23237 * if v == NULL: raise KeyError( "tag '%s' not present" % tag ) # <<<<<<<<<<<<<<
23239 * if type == 'c' or type == 'C' or type == 's' or type == 'S':
23241 __pyx_t_2 = (__pyx_v_v == NULL);
23243 __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_75), __pyx_v_tag); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23244 __Pyx_GOTREF(((PyObject *)__pyx_t_3));
23245 __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23246 __Pyx_GOTREF(__pyx_t_4);
23247 PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_3));
23248 __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
23250 __pyx_t_3 = PyObject_Call(__pyx_builtin_KeyError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23251 __Pyx_GOTREF(__pyx_t_3);
23252 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
23253 __Pyx_Raise(__pyx_t_3, 0, 0);
23254 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23255 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23260 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2547
23261 * v = bam_aux_get(self._delegate, tag)
23262 * if v == NULL: raise KeyError( "tag '%s' not present" % tag )
23263 * type = chr(v[0]) # <<<<<<<<<<<<<<
23264 * if type == 'c' or type == 'C' or type == 's' or type == 'S':
23265 * return <int>bam_aux2i(v)
23267 __pyx_t_3 = __Pyx_PyInt_to_py_uint8_t((__pyx_v_v[0])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2547; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23268 __Pyx_GOTREF(__pyx_t_3);
23269 __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2547; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23270 __Pyx_GOTREF(__pyx_t_4);
23271 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
23272 __Pyx_GIVEREF(__pyx_t_3);
23274 __pyx_t_3 = PyObject_Call(__pyx_builtin_chr, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2547; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23275 __Pyx_GOTREF(__pyx_t_3);
23276 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
23277 __Pyx_DECREF(__pyx_v_type);
23278 __pyx_v_type = __pyx_t_3;
23281 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2548
23282 * if v == NULL: raise KeyError( "tag '%s' not present" % tag )
23284 * if type == 'c' or type == 'C' or type == 's' or type == 'S': # <<<<<<<<<<<<<<
23285 * return <int>bam_aux2i(v)
23286 * elif type == 'i' or type == 'I':
23288 __pyx_t_3 = PyObject_RichCompare(__pyx_v_type, ((PyObject *)__pyx_n_s__c), Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2548; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23289 __Pyx_GOTREF(__pyx_t_3);
23290 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2548; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23291 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23293 __pyx_t_3 = PyObject_RichCompare(__pyx_v_type, ((PyObject *)__pyx_n_s__C), Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2548; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23294 __Pyx_GOTREF(__pyx_t_3);
23295 __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2548; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23296 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23298 __pyx_t_3 = PyObject_RichCompare(__pyx_v_type, ((PyObject *)__pyx_n_s__s), Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2548; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23299 __Pyx_GOTREF(__pyx_t_3);
23300 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2548; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23301 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23303 __pyx_t_3 = PyObject_RichCompare(__pyx_v_type, ((PyObject *)__pyx_n_s__S), Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2548; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23304 __Pyx_GOTREF(__pyx_t_3);
23305 __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2548; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23306 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23307 __pyx_t_8 = __pyx_t_7;
23309 __pyx_t_8 = __pyx_t_6;
23311 __pyx_t_6 = __pyx_t_8;
23313 __pyx_t_6 = __pyx_t_5;
23315 __pyx_t_5 = __pyx_t_6;
23317 __pyx_t_5 = __pyx_t_2;
23321 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2549
23323 * if type == 'c' or type == 'C' or type == 's' or type == 'S':
23324 * return <int>bam_aux2i(v) # <<<<<<<<<<<<<<
23325 * elif type == 'i' or type == 'I':
23326 * return <int32_t>bam_aux2i(v)
23328 __Pyx_XDECREF(__pyx_r);
23329 __pyx_t_3 = PyInt_FromLong(((int)bam_aux2i(__pyx_v_v))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2549; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23330 __Pyx_GOTREF(__pyx_t_3);
23331 __pyx_r = __pyx_t_3;
23337 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2550
23338 * if type == 'c' or type == 'C' or type == 's' or type == 'S':
23339 * return <int>bam_aux2i(v)
23340 * elif type == 'i' or type == 'I': # <<<<<<<<<<<<<<
23341 * return <int32_t>bam_aux2i(v)
23342 * elif type == 'f' or type == 'F':
23344 __pyx_t_3 = PyObject_RichCompare(__pyx_v_type, ((PyObject *)__pyx_n_s__i), Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2550; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23345 __Pyx_GOTREF(__pyx_t_3);
23346 __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2550; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23347 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23349 __pyx_t_3 = PyObject_RichCompare(__pyx_v_type, ((PyObject *)__pyx_n_s__I), Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2550; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23350 __Pyx_GOTREF(__pyx_t_3);
23351 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2550; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23352 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23353 __pyx_t_6 = __pyx_t_2;
23355 __pyx_t_6 = __pyx_t_5;
23359 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2551
23360 * return <int>bam_aux2i(v)
23361 * elif type == 'i' or type == 'I':
23362 * return <int32_t>bam_aux2i(v) # <<<<<<<<<<<<<<
23363 * elif type == 'f' or type == 'F':
23364 * return <float>bam_aux2f(v)
23366 __Pyx_XDECREF(__pyx_r);
23367 __pyx_t_3 = __Pyx_PyInt_to_py_int32_t(bam_aux2i(__pyx_v_v)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2551; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23368 __Pyx_GOTREF(__pyx_t_3);
23369 __pyx_r = __pyx_t_3;
23375 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2552
23376 * elif type == 'i' or type == 'I':
23377 * return <int32_t>bam_aux2i(v)
23378 * elif type == 'f' or type == 'F': # <<<<<<<<<<<<<<
23379 * return <float>bam_aux2f(v)
23380 * elif type == 'd' or type == 'D':
23382 __pyx_t_3 = PyObject_RichCompare(__pyx_v_type, ((PyObject *)__pyx_n_s__f), Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2552; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23383 __Pyx_GOTREF(__pyx_t_3);
23384 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2552; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23385 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23387 __pyx_t_3 = PyObject_RichCompare(__pyx_v_type, ((PyObject *)__pyx_n_s__F), Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2552; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23388 __Pyx_GOTREF(__pyx_t_3);
23389 __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2552; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23390 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23391 __pyx_t_2 = __pyx_t_5;
23393 __pyx_t_2 = __pyx_t_6;
23397 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2553
23398 * return <int32_t>bam_aux2i(v)
23399 * elif type == 'f' or type == 'F':
23400 * return <float>bam_aux2f(v) # <<<<<<<<<<<<<<
23401 * elif type == 'd' or type == 'D':
23402 * return <double>bam_aux2d(v)
23404 __Pyx_XDECREF(__pyx_r);
23405 __pyx_t_3 = PyFloat_FromDouble(bam_aux2f(__pyx_v_v)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23406 __Pyx_GOTREF(__pyx_t_3);
23407 __pyx_r = __pyx_t_3;
23413 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2554
23414 * elif type == 'f' or type == 'F':
23415 * return <float>bam_aux2f(v)
23416 * elif type == 'd' or type == 'D': # <<<<<<<<<<<<<<
23417 * return <double>bam_aux2d(v)
23418 * elif type == 'A':
23420 __pyx_t_3 = PyObject_RichCompare(__pyx_v_type, ((PyObject *)__pyx_n_s__d), Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23421 __Pyx_GOTREF(__pyx_t_3);
23422 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23423 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23425 __pyx_t_3 = PyObject_RichCompare(__pyx_v_type, ((PyObject *)__pyx_n_s__D), Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23426 __Pyx_GOTREF(__pyx_t_3);
23427 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23428 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23429 __pyx_t_5 = __pyx_t_6;
23431 __pyx_t_5 = __pyx_t_2;
23435 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2555
23436 * return <float>bam_aux2f(v)
23437 * elif type == 'd' or type == 'D':
23438 * return <double>bam_aux2d(v) # <<<<<<<<<<<<<<
23439 * elif type == 'A':
23440 * # there might a more efficient way
23442 __Pyx_XDECREF(__pyx_r);
23443 __pyx_t_3 = PyFloat_FromDouble(bam_aux2d(__pyx_v_v)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2555; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23444 __Pyx_GOTREF(__pyx_t_3);
23445 __pyx_r = __pyx_t_3;
23451 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2556
23452 * elif type == 'd' or type == 'D':
23453 * return <double>bam_aux2d(v)
23454 * elif type == 'A': # <<<<<<<<<<<<<<
23455 * # there might a more efficient way
23456 * # to convert a char into a string
23458 __pyx_t_3 = PyObject_RichCompare(__pyx_v_type, ((PyObject *)__pyx_n_s__A), Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2556; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23459 __Pyx_GOTREF(__pyx_t_3);
23460 __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2556; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23461 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23464 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2559
23465 * # there might a more efficient way
23466 * # to convert a char into a string
23467 * return '%c' % <char>bam_aux2A(v) # <<<<<<<<<<<<<<
23468 * elif type == 'Z':
23469 * return <char*>bam_aux2Z(v)
23471 __Pyx_XDECREF(__pyx_r);
23472 __pyx_t_3 = PyInt_FromLong(bam_aux2A(__pyx_v_v)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23473 __Pyx_GOTREF(__pyx_t_3);
23474 __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_62), __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23475 __Pyx_GOTREF(((PyObject *)__pyx_t_4));
23476 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23477 __pyx_r = ((PyObject *)__pyx_t_4);
23483 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2560
23484 * # to convert a char into a string
23485 * return '%c' % <char>bam_aux2A(v)
23486 * elif type == 'Z': # <<<<<<<<<<<<<<
23487 * return <char*>bam_aux2Z(v)
23490 __pyx_t_4 = PyObject_RichCompare(__pyx_v_type, ((PyObject *)__pyx_n_s__Z), Py_EQ); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2560; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23491 __Pyx_GOTREF(__pyx_t_4);
23492 __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2560; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23493 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
23496 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2561
23497 * return '%c' % <char>bam_aux2A(v)
23498 * elif type == 'Z':
23499 * return <char*>bam_aux2Z(v) # <<<<<<<<<<<<<<
23501 * def fancy_str (self):
23503 __Pyx_XDECREF(__pyx_r);
23504 __pyx_t_4 = PyBytes_FromString(bam_aux2Z(__pyx_v_v)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23505 __Pyx_GOTREF(((PyObject *)__pyx_t_4));
23506 __pyx_r = ((PyObject *)__pyx_t_4);
23513 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
23516 __Pyx_XDECREF(__pyx_t_3);
23517 __Pyx_XDECREF(__pyx_t_4);
23518 __Pyx_AddTraceback("csamtools.AlignedRead.opt");
23521 __Pyx_DECREF(__pyx_v_type);
23522 __Pyx_XGIVEREF(__pyx_r);
23523 __Pyx_TraceReturn(__pyx_r);
23524 __Pyx_RefNannyFinishContext();
23528 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2563
23529 * return <char*>bam_aux2Z(v)
23531 * def fancy_str (self): # <<<<<<<<<<<<<<
23532 * """returns list of fieldnames/values in pretty format for debugging
23536 static PyObject *__pyx_pf_9csamtools_11AlignedRead_fancy_str(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
23537 static char __pyx_doc_9csamtools_11AlignedRead_fancy_str[] = "AlignedRead.fancy_str(self)\nreturns list of fieldnames/values in pretty format for debugging\n ";
23538 static PyObject *__pyx_pf_9csamtools_11AlignedRead_fancy_str(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
23539 PyObject *__pyx_v_ret_string;
23540 PyObject *__pyx_v_field_names;
23541 PyObject *__pyx_v_fields_names_in_order;
23542 PyObject *__pyx_v_f;
23543 PyObject *__pyx_r = NULL;
23544 PyObject *__pyx_t_1 = NULL;
23545 Py_ssize_t __pyx_t_2;
23546 PyObject *__pyx_t_3 = NULL;
23549 PyObject *__pyx_t_6 = NULL;
23550 PyObject *__pyx_t_7 = NULL;
23551 PyObject *__pyx_t_8 = NULL;
23552 PyObject *__pyx_t_9 = NULL;
23554 __Pyx_TraceDeclarations
23555 __Pyx_RefNannySetupContext("fancy_str");
23556 __Pyx_TraceCall("fancy_str", __pyx_f[0], 2563);
23557 __pyx_v_ret_string = ((PyObject *)Py_None); __Pyx_INCREF(Py_None);
23558 __pyx_v_field_names = ((PyObject *)Py_None); __Pyx_INCREF(Py_None);
23559 __pyx_v_fields_names_in_order = ((PyObject *)Py_None); __Pyx_INCREF(Py_None);
23560 __pyx_v_f = Py_None; __Pyx_INCREF(Py_None);
23562 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2566
23563 * """returns list of fieldnames/values in pretty format for debugging
23565 * ret_string = [] # <<<<<<<<<<<<<<
23567 * "tid": "Contig index",
23569 __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2566; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23570 __Pyx_GOTREF(((PyObject *)__pyx_t_1));
23571 __Pyx_DECREF(((PyObject *)__pyx_v_ret_string));
23572 __pyx_v_ret_string = __pyx_t_1;
23575 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2567
23578 * field_names = { # <<<<<<<<<<<<<<
23579 * "tid": "Contig index",
23580 * "pos": "Mapped position on contig",
23582 __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2567; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23583 __Pyx_GOTREF(((PyObject *)__pyx_t_1));
23584 if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__tid), ((PyObject *)__pyx_kp_s_76)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2567; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23585 if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__pos), ((PyObject *)__pyx_kp_s_77)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2567; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23586 if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__mtid), ((PyObject *)__pyx_kp_s_78)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2567; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23587 if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__mpos), ((PyObject *)__pyx_kp_s_79)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2567; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23588 if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__isize), ((PyObject *)__pyx_kp_s_80)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2567; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23589 if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__flag), ((PyObject *)__pyx_kp_s_81)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2567; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23590 if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__n_cigar), ((PyObject *)__pyx_kp_s_82)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2567; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23591 if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__cigar), ((PyObject *)__pyx_kp_s_83)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2567; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23592 if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__qual), ((PyObject *)__pyx_kp_s_84)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2567; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23593 if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__bin), ((PyObject *)__pyx_kp_s_85)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2567; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23594 if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__l_qname), ((PyObject *)__pyx_kp_s_86)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2567; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23595 if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__qname), ((PyObject *)__pyx_kp_s_87)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2567; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23596 if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__l_qseq), ((PyObject *)__pyx_kp_s_88)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2567; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23597 if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__qseq), ((PyObject *)__pyx_kp_s_89)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2567; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23598 if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__bqual), ((PyObject *)__pyx_kp_s_90)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2567; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23599 if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__l_aux), ((PyObject *)__pyx_kp_s_91)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2567; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23600 if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__m_data), ((PyObject *)__pyx_kp_s_92)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2567; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23601 if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__data_len), ((PyObject *)__pyx_kp_s_93)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2567; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23602 __Pyx_DECREF(((PyObject *)__pyx_v_field_names));
23603 __pyx_v_field_names = __pyx_t_1;
23606 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2587
23607 * "data_len": "Current data length",
23609 * fields_names_in_order = ["tid", "pos", "mtid", "mpos", "isize", "flag", # <<<<<<<<<<<<<<
23610 * "n_cigar", "cigar", "qual", "bin", "l_qname", "qname",
23611 * "l_qseq", "qseq", "bqual", "l_aux", "m_data", "data_len"]
23613 __pyx_t_1 = PyList_New(18); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2587; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23614 __Pyx_GOTREF(((PyObject *)__pyx_t_1));
23615 __Pyx_INCREF(((PyObject *)__pyx_n_s__tid));
23616 PyList_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_n_s__tid));
23617 __Pyx_GIVEREF(((PyObject *)__pyx_n_s__tid));
23618 __Pyx_INCREF(((PyObject *)__pyx_n_s__pos));
23619 PyList_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_n_s__pos));
23620 __Pyx_GIVEREF(((PyObject *)__pyx_n_s__pos));
23621 __Pyx_INCREF(((PyObject *)__pyx_n_s__mtid));
23622 PyList_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_n_s__mtid));
23623 __Pyx_GIVEREF(((PyObject *)__pyx_n_s__mtid));
23624 __Pyx_INCREF(((PyObject *)__pyx_n_s__mpos));
23625 PyList_SET_ITEM(__pyx_t_1, 3, ((PyObject *)__pyx_n_s__mpos));
23626 __Pyx_GIVEREF(((PyObject *)__pyx_n_s__mpos));
23627 __Pyx_INCREF(((PyObject *)__pyx_n_s__isize));
23628 PyList_SET_ITEM(__pyx_t_1, 4, ((PyObject *)__pyx_n_s__isize));
23629 __Pyx_GIVEREF(((PyObject *)__pyx_n_s__isize));
23630 __Pyx_INCREF(((PyObject *)__pyx_n_s__flag));
23631 PyList_SET_ITEM(__pyx_t_1, 5, ((PyObject *)__pyx_n_s__flag));
23632 __Pyx_GIVEREF(((PyObject *)__pyx_n_s__flag));
23633 __Pyx_INCREF(((PyObject *)__pyx_n_s__n_cigar));
23634 PyList_SET_ITEM(__pyx_t_1, 6, ((PyObject *)__pyx_n_s__n_cigar));
23635 __Pyx_GIVEREF(((PyObject *)__pyx_n_s__n_cigar));
23636 __Pyx_INCREF(((PyObject *)__pyx_n_s__cigar));
23637 PyList_SET_ITEM(__pyx_t_1, 7, ((PyObject *)__pyx_n_s__cigar));
23638 __Pyx_GIVEREF(((PyObject *)__pyx_n_s__cigar));
23639 __Pyx_INCREF(((PyObject *)__pyx_n_s__qual));
23640 PyList_SET_ITEM(__pyx_t_1, 8, ((PyObject *)__pyx_n_s__qual));
23641 __Pyx_GIVEREF(((PyObject *)__pyx_n_s__qual));
23642 __Pyx_INCREF(((PyObject *)__pyx_n_s__bin));
23643 PyList_SET_ITEM(__pyx_t_1, 9, ((PyObject *)__pyx_n_s__bin));
23644 __Pyx_GIVEREF(((PyObject *)__pyx_n_s__bin));
23645 __Pyx_INCREF(((PyObject *)__pyx_n_s__l_qname));
23646 PyList_SET_ITEM(__pyx_t_1, 10, ((PyObject *)__pyx_n_s__l_qname));
23647 __Pyx_GIVEREF(((PyObject *)__pyx_n_s__l_qname));
23648 __Pyx_INCREF(((PyObject *)__pyx_n_s__qname));
23649 PyList_SET_ITEM(__pyx_t_1, 11, ((PyObject *)__pyx_n_s__qname));
23650 __Pyx_GIVEREF(((PyObject *)__pyx_n_s__qname));
23651 __Pyx_INCREF(((PyObject *)__pyx_n_s__l_qseq));
23652 PyList_SET_ITEM(__pyx_t_1, 12, ((PyObject *)__pyx_n_s__l_qseq));
23653 __Pyx_GIVEREF(((PyObject *)__pyx_n_s__l_qseq));
23654 __Pyx_INCREF(((PyObject *)__pyx_n_s__qseq));
23655 PyList_SET_ITEM(__pyx_t_1, 13, ((PyObject *)__pyx_n_s__qseq));
23656 __Pyx_GIVEREF(((PyObject *)__pyx_n_s__qseq));
23657 __Pyx_INCREF(((PyObject *)__pyx_n_s__bqual));
23658 PyList_SET_ITEM(__pyx_t_1, 14, ((PyObject *)__pyx_n_s__bqual));
23659 __Pyx_GIVEREF(((PyObject *)__pyx_n_s__bqual));
23660 __Pyx_INCREF(((PyObject *)__pyx_n_s__l_aux));
23661 PyList_SET_ITEM(__pyx_t_1, 15, ((PyObject *)__pyx_n_s__l_aux));
23662 __Pyx_GIVEREF(((PyObject *)__pyx_n_s__l_aux));
23663 __Pyx_INCREF(((PyObject *)__pyx_n_s__m_data));
23664 PyList_SET_ITEM(__pyx_t_1, 16, ((PyObject *)__pyx_n_s__m_data));
23665 __Pyx_GIVEREF(((PyObject *)__pyx_n_s__m_data));
23666 __Pyx_INCREF(((PyObject *)__pyx_n_s__data_len));
23667 PyList_SET_ITEM(__pyx_t_1, 17, ((PyObject *)__pyx_n_s__data_len));
23668 __Pyx_GIVEREF(((PyObject *)__pyx_n_s__data_len));
23669 __Pyx_DECREF(((PyObject *)__pyx_v_fields_names_in_order));
23670 __pyx_v_fields_names_in_order = __pyx_t_1;
23673 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2591
23674 * "l_qseq", "qseq", "bqual", "l_aux", "m_data", "data_len"]
23676 * for f in fields_names_in_order: # <<<<<<<<<<<<<<
23677 * if not f in self.__dict__:
23680 if (likely(((PyObject *)__pyx_v_fields_names_in_order) != Py_None)) {
23681 __pyx_t_2 = 0; __pyx_t_1 = ((PyObject *)__pyx_v_fields_names_in_order); __Pyx_INCREF(__pyx_t_1);
23683 PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2591; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23686 if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
23687 __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++;
23688 __Pyx_DECREF(__pyx_v_f);
23689 __pyx_v_f = __pyx_t_3;
23692 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2592
23694 * for f in fields_names_in_order:
23695 * if not f in self.__dict__: # <<<<<<<<<<<<<<
23697 * ret_string.append("%-30s %-10s= %s" % (field_names[f], "(" + f + ")", self.__getattribute__(f)))
23699 __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s____dict__); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2592; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23700 __Pyx_GOTREF(__pyx_t_3);
23701 __pyx_t_4 = ((PySequence_Contains(__pyx_t_3, __pyx_v_f))); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2592; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23702 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23703 __pyx_t_5 = (!__pyx_t_4);
23706 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2593
23707 * for f in fields_names_in_order:
23708 * if not f in self.__dict__:
23709 * continue # <<<<<<<<<<<<<<
23710 * ret_string.append("%-30s %-10s= %s" % (field_names[f], "(" + f + ")", self.__getattribute__(f)))
23713 goto __pyx_L5_continue;
23718 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2594
23719 * if not f in self.__dict__:
23721 * ret_string.append("%-30s %-10s= %s" % (field_names[f], "(" + f + ")", self.__getattribute__(f))) # <<<<<<<<<<<<<<
23723 * for f in self.__dict__:
23725 if (unlikely(__pyx_v_ret_string == Py_None)) {
23726 PyErr_SetString(PyExc_AttributeError, "'NoneType' object has no attribute 'append'"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23728 __pyx_t_3 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_field_names), __pyx_v_f); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23729 __Pyx_GOTREF(__pyx_t_3);
23730 __pyx_t_6 = PyNumber_Add(((PyObject *)__pyx_kp_s_95), __pyx_v_f); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23731 __Pyx_GOTREF(__pyx_t_6);
23732 __pyx_t_7 = PyNumber_Add(__pyx_t_6, ((PyObject *)__pyx_kp_s_96)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23733 __Pyx_GOTREF(__pyx_t_7);
23734 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
23735 __pyx_t_6 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s____getattribute__); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23736 __Pyx_GOTREF(__pyx_t_6);
23737 __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23738 __Pyx_GOTREF(__pyx_t_8);
23739 __Pyx_INCREF(__pyx_v_f);
23740 PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_f);
23741 __Pyx_GIVEREF(__pyx_v_f);
23742 __pyx_t_9 = PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23743 __Pyx_GOTREF(__pyx_t_9);
23744 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
23745 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
23746 __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23747 __Pyx_GOTREF(__pyx_t_8);
23748 PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_3);
23749 __Pyx_GIVEREF(__pyx_t_3);
23750 PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_7);
23751 __Pyx_GIVEREF(__pyx_t_7);
23752 PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_9);
23753 __Pyx_GIVEREF(__pyx_t_9);
23757 __pyx_t_9 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_94), __pyx_t_8); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23758 __Pyx_GOTREF(((PyObject *)__pyx_t_9));
23759 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
23760 __pyx_t_10 = PyList_Append(((PyObject *)__pyx_v_ret_string), ((PyObject *)__pyx_t_9)); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23761 __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
23762 __pyx_L5_continue:;
23764 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23766 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2596
23767 * ret_string.append("%-30s %-10s= %s" % (field_names[f], "(" + f + ")", self.__getattribute__(f)))
23769 * for f in self.__dict__: # <<<<<<<<<<<<<<
23770 * if not f in field_names:
23771 * ret_string.append("%-30s %-10s= %s" % (f, "", self.__getattribute__(f)))
23773 __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s____dict__); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2596; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23774 __Pyx_GOTREF(__pyx_t_1);
23775 if (PyList_CheckExact(__pyx_t_1) || PyTuple_CheckExact(__pyx_t_1)) {
23776 __pyx_t_2 = 0; __pyx_t_9 = __pyx_t_1; __Pyx_INCREF(__pyx_t_9);
23778 __pyx_t_2 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2596; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23779 __Pyx_GOTREF(__pyx_t_9);
23781 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23783 if (likely(PyList_CheckExact(__pyx_t_9))) {
23784 if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_9)) break;
23785 __pyx_t_1 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_2); __Pyx_INCREF(__pyx_t_1); __pyx_t_2++;
23786 } else if (likely(PyTuple_CheckExact(__pyx_t_9))) {
23787 if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_9)) break;
23788 __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_2); __Pyx_INCREF(__pyx_t_1); __pyx_t_2++;
23790 __pyx_t_1 = PyIter_Next(__pyx_t_9);
23792 if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2596; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23795 __Pyx_GOTREF(__pyx_t_1);
23797 __Pyx_DECREF(__pyx_v_f);
23798 __pyx_v_f = __pyx_t_1;
23801 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2597
23803 * for f in self.__dict__:
23804 * if not f in field_names: # <<<<<<<<<<<<<<
23805 * ret_string.append("%-30s %-10s= %s" % (f, "", self.__getattribute__(f)))
23806 * return ret_string
23808 if (unlikely(((PyObject *)__pyx_v_field_names) == Py_None)) {
23809 __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2597; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23811 __pyx_t_5 = ((PyDict_Contains(((PyObject *)__pyx_v_field_names), __pyx_v_f))); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2597; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23813 __pyx_t_4 = (!__pyx_t_5);
23816 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2598
23817 * for f in self.__dict__:
23818 * if not f in field_names:
23819 * ret_string.append("%-30s %-10s= %s" % (f, "", self.__getattribute__(f))) # <<<<<<<<<<<<<<
23820 * return ret_string
23823 if (unlikely(__pyx_v_ret_string == Py_None)) {
23824 PyErr_SetString(PyExc_AttributeError, "'NoneType' object has no attribute 'append'"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2598; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23826 __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s____getattribute__); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2598; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23827 __Pyx_GOTREF(__pyx_t_1);
23828 __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2598; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23829 __Pyx_GOTREF(__pyx_t_8);
23830 __Pyx_INCREF(__pyx_v_f);
23831 PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_f);
23832 __Pyx_GIVEREF(__pyx_v_f);
23833 __pyx_t_7 = PyObject_Call(__pyx_t_1, __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2598; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23834 __Pyx_GOTREF(__pyx_t_7);
23835 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23836 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
23837 __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2598; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23838 __Pyx_GOTREF(__pyx_t_8);
23839 __Pyx_INCREF(__pyx_v_f);
23840 PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_f);
23841 __Pyx_GIVEREF(__pyx_v_f);
23842 __Pyx_INCREF(((PyObject *)__pyx_kp_s_8));
23843 PyTuple_SET_ITEM(__pyx_t_8, 1, ((PyObject *)__pyx_kp_s_8));
23844 __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_8));
23845 PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7);
23846 __Pyx_GIVEREF(__pyx_t_7);
23848 __pyx_t_7 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_94), __pyx_t_8); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2598; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23849 __Pyx_GOTREF(((PyObject *)__pyx_t_7));
23850 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
23851 __pyx_t_10 = PyList_Append(((PyObject *)__pyx_v_ret_string), ((PyObject *)__pyx_t_7)); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2598; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23852 __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
23857 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
23859 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2599
23860 * if not f in field_names:
23861 * ret_string.append("%-30s %-10s= %s" % (f, "", self.__getattribute__(f)))
23862 * return ret_string # <<<<<<<<<<<<<<
23864 * cdef class PileupProxy:
23866 __Pyx_XDECREF(__pyx_r);
23867 __Pyx_INCREF(((PyObject *)__pyx_v_ret_string));
23868 __pyx_r = ((PyObject *)__pyx_v_ret_string);
23871 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
23874 __Pyx_XDECREF(__pyx_t_1);
23875 __Pyx_XDECREF(__pyx_t_3);
23876 __Pyx_XDECREF(__pyx_t_6);
23877 __Pyx_XDECREF(__pyx_t_7);
23878 __Pyx_XDECREF(__pyx_t_8);
23879 __Pyx_XDECREF(__pyx_t_9);
23880 __Pyx_AddTraceback("csamtools.AlignedRead.fancy_str");
23883 __Pyx_DECREF(__pyx_v_ret_string);
23884 __Pyx_DECREF(__pyx_v_field_names);
23885 __Pyx_DECREF(__pyx_v_fields_names_in_order);
23886 __Pyx_DECREF(__pyx_v_f);
23887 __Pyx_XGIVEREF(__pyx_r);
23888 __Pyx_TraceReturn(__pyx_r);
23889 __Pyx_RefNannyFinishContext();
23893 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2623
23896 * def __init__(self): # <<<<<<<<<<<<<<
23897 * raise TypeError("This class cannot be instantiated from Python")
23901 static int __pyx_pf_9csamtools_11PileupProxy___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
23902 static int __pyx_pf_9csamtools_11PileupProxy___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
23904 PyObject *__pyx_t_1 = NULL;
23905 PyObject *__pyx_t_2 = NULL;
23906 __Pyx_TraceDeclarations
23907 __Pyx_RefNannySetupContext("__init__");
23908 __Pyx_TraceCall("__init__", __pyx_f[0], 2623);
23909 if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
23910 __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
23911 if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1;
23913 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2624
23915 * def __init__(self):
23916 * raise TypeError("This class cannot be instantiated from Python") # <<<<<<<<<<<<<<
23918 * def __str__(self):
23920 __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2624; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23921 __Pyx_GOTREF(__pyx_t_1);
23922 __Pyx_INCREF(((PyObject *)__pyx_kp_s_97));
23923 PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_kp_s_97));
23924 __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_97));
23925 __pyx_t_2 = PyObject_Call(__pyx_builtin_TypeError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2624; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23926 __Pyx_GOTREF(__pyx_t_2);
23927 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23928 __Pyx_Raise(__pyx_t_2, 0, 0);
23929 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23930 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2624; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23935 __Pyx_XDECREF(__pyx_t_1);
23936 __Pyx_XDECREF(__pyx_t_2);
23937 __Pyx_AddTraceback("csamtools.PileupProxy.__init__");
23940 __Pyx_TraceReturn(Py_None);
23941 __Pyx_RefNannyFinishContext();
23945 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2626
23946 * raise TypeError("This class cannot be instantiated from Python")
23948 * def __str__(self): # <<<<<<<<<<<<<<
23949 * return "\t".join( map(str, (self.tid, self.pos, self.n))) +\
23953 static PyObject *__pyx_pf_9csamtools_11PileupProxy___str__(PyObject *__pyx_v_self); /*proto*/
23954 static PyObject *__pyx_pf_9csamtools_11PileupProxy___str__(PyObject *__pyx_v_self) {
23955 PyObject *__pyx_r = NULL;
23956 PyObject *__pyx_t_1 = NULL;
23957 PyObject *__pyx_t_2 = NULL;
23958 PyObject *__pyx_t_3 = NULL;
23959 PyObject *__pyx_t_4 = NULL;
23960 PyObject *__pyx_t_5 = NULL;
23961 __Pyx_TraceDeclarations
23962 __Pyx_RefNannySetupContext("__str__");
23963 __Pyx_TraceCall("__str__", __pyx_f[0], 2626);
23965 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2627
23967 * def __str__(self):
23968 * return "\t".join( map(str, (self.tid, self.pos, self.n))) +\ # <<<<<<<<<<<<<<
23970 * "\n".join( map(str, self.pileups) )
23972 __Pyx_XDECREF(__pyx_r);
23974 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2628
23975 * def __str__(self):
23976 * return "\t".join( map(str, (self.tid, self.pos, self.n))) +\
23977 * "\n" +\ # <<<<<<<<<<<<<<
23978 * "\n".join( map(str, self.pileups) )
23981 __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 = 2627; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23982 __Pyx_GOTREF(__pyx_t_1);
23984 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2627
23986 * def __str__(self):
23987 * return "\t".join( map(str, (self.tid, self.pos, self.n))) +\ # <<<<<<<<<<<<<<
23989 * "\n".join( map(str, self.pileups) )
23991 __pyx_t_2 = PyInt_FromLong(((struct __pyx_obj_9csamtools_PileupProxy *)__pyx_v_self)->tid); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2627; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23992 __Pyx_GOTREF(__pyx_t_2);
23993 __pyx_t_3 = PyInt_FromLong(((struct __pyx_obj_9csamtools_PileupProxy *)__pyx_v_self)->pos); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2627; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23994 __Pyx_GOTREF(__pyx_t_3);
23995 __pyx_t_4 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__n); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2627; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23996 __Pyx_GOTREF(__pyx_t_4);
23997 __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2627; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23998 __Pyx_GOTREF(__pyx_t_5);
23999 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
24000 __Pyx_GIVEREF(__pyx_t_2);
24001 PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3);
24002 __Pyx_GIVEREF(__pyx_t_3);
24003 PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_4);
24004 __Pyx_GIVEREF(__pyx_t_4);
24008 __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2627; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24009 __Pyx_GOTREF(__pyx_t_4);
24010 __Pyx_INCREF(((PyObject *)((PyObject*)&PyString_Type)));
24011 PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)((PyObject*)&PyString_Type)));
24012 __Pyx_GIVEREF(((PyObject *)((PyObject*)&PyString_Type)));
24013 PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_5);
24014 __Pyx_GIVEREF(__pyx_t_5);
24016 __pyx_t_5 = PyObject_Call(__pyx_builtin_map, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2627; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24017 __Pyx_GOTREF(__pyx_t_5);
24018 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
24019 __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2627; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24020 __Pyx_GOTREF(__pyx_t_4);
24021 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
24022 __Pyx_GIVEREF(__pyx_t_5);
24024 __pyx_t_5 = PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2627; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24025 __Pyx_GOTREF(__pyx_t_5);
24026 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24027 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
24028 __pyx_t_4 = PyNumber_Add(__pyx_t_5, ((PyObject *)__pyx_kp_s_2)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2627; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24029 __Pyx_GOTREF(__pyx_t_4);
24030 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
24032 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2629
24033 * return "\t".join( map(str, (self.tid, self.pos, self.n))) +\
24035 * "\n".join( map(str, self.pileups) ) # <<<<<<<<<<<<<<
24039 __pyx_t_5 = PyObject_GetAttr(((PyObject *)__pyx_kp_s_2), __pyx_n_s__join); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2629; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24040 __Pyx_GOTREF(__pyx_t_5);
24041 __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__pileups); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2629; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24042 __Pyx_GOTREF(__pyx_t_1);
24043 __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2629; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24044 __Pyx_GOTREF(__pyx_t_3);
24045 __Pyx_INCREF(((PyObject *)((PyObject*)&PyString_Type)));
24046 PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)((PyObject*)&PyString_Type)));
24047 __Pyx_GIVEREF(((PyObject *)((PyObject*)&PyString_Type)));
24048 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
24049 __Pyx_GIVEREF(__pyx_t_1);
24051 __pyx_t_1 = PyObject_Call(__pyx_builtin_map, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2629; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24052 __Pyx_GOTREF(__pyx_t_1);
24053 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
24054 __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2629; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24055 __Pyx_GOTREF(__pyx_t_3);
24056 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
24057 __Pyx_GIVEREF(__pyx_t_1);
24059 __pyx_t_1 = PyObject_Call(__pyx_t_5, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2629; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24060 __Pyx_GOTREF(__pyx_t_1);
24061 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
24062 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
24063 __pyx_t_3 = PyNumber_Add(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2628; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24064 __Pyx_GOTREF(__pyx_t_3);
24065 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
24066 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24067 __pyx_r = __pyx_t_3;
24071 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
24074 __Pyx_XDECREF(__pyx_t_1);
24075 __Pyx_XDECREF(__pyx_t_2);
24076 __Pyx_XDECREF(__pyx_t_3);
24077 __Pyx_XDECREF(__pyx_t_4);
24078 __Pyx_XDECREF(__pyx_t_5);
24079 __Pyx_AddTraceback("csamtools.PileupProxy.__str__");
24082 __Pyx_XGIVEREF(__pyx_r);
24083 __Pyx_TraceReturn(__pyx_r);
24084 __Pyx_RefNannyFinishContext();
24088 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2633
24090 * '''the chromosome ID as is defined in the header'''
24091 * def __get__(self): return self.tid # <<<<<<<<<<<<<<
24096 static PyObject *__pyx_pf_9csamtools_11PileupProxy_3tid___get__(PyObject *__pyx_v_self); /*proto*/
24097 static PyObject *__pyx_pf_9csamtools_11PileupProxy_3tid___get__(PyObject *__pyx_v_self) {
24098 PyObject *__pyx_r = NULL;
24099 PyObject *__pyx_t_1 = NULL;
24100 __Pyx_TraceDeclarations
24101 __Pyx_RefNannySetupContext("__get__");
24102 __Pyx_TraceCall("__get__", __pyx_f[0], 2633);
24103 __Pyx_XDECREF(__pyx_r);
24104 __pyx_t_1 = PyInt_FromLong(((struct __pyx_obj_9csamtools_PileupProxy *)__pyx_v_self)->tid); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2633; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24105 __Pyx_GOTREF(__pyx_t_1);
24106 __pyx_r = __pyx_t_1;
24110 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
24113 __Pyx_XDECREF(__pyx_t_1);
24114 __Pyx_AddTraceback("csamtools.PileupProxy.tid.__get__");
24117 __Pyx_XGIVEREF(__pyx_r);
24118 __Pyx_TraceReturn(__pyx_r);
24119 __Pyx_RefNannyFinishContext();
24123 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2637
24125 * '''number of reads mapping to this column.'''
24126 * def __get__(self): return self.n_pu # <<<<<<<<<<<<<<
24127 * def __set__(self, n): self.n_pu = n
24131 static PyObject *__pyx_pf_9csamtools_11PileupProxy_1n___get__(PyObject *__pyx_v_self); /*proto*/
24132 static PyObject *__pyx_pf_9csamtools_11PileupProxy_1n___get__(PyObject *__pyx_v_self) {
24133 PyObject *__pyx_r = NULL;
24134 PyObject *__pyx_t_1 = NULL;
24135 __Pyx_TraceDeclarations
24136 __Pyx_RefNannySetupContext("__get__");
24137 __Pyx_TraceCall("__get__", __pyx_f[0], 2637);
24138 __Pyx_XDECREF(__pyx_r);
24139 __pyx_t_1 = PyInt_FromLong(((struct __pyx_obj_9csamtools_PileupProxy *)__pyx_v_self)->n_pu); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2637; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24140 __Pyx_GOTREF(__pyx_t_1);
24141 __pyx_r = __pyx_t_1;
24145 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
24148 __Pyx_XDECREF(__pyx_t_1);
24149 __Pyx_AddTraceback("csamtools.PileupProxy.n.__get__");
24152 __Pyx_XGIVEREF(__pyx_r);
24153 __Pyx_TraceReturn(__pyx_r);
24154 __Pyx_RefNannyFinishContext();
24158 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2638
24159 * '''number of reads mapping to this column.'''
24160 * def __get__(self): return self.n_pu
24161 * def __set__(self, n): self.n_pu = n # <<<<<<<<<<<<<<
24166 static int __pyx_pf_9csamtools_11PileupProxy_1n___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_n); /*proto*/
24167 static int __pyx_pf_9csamtools_11PileupProxy_1n___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_n) {
24170 __Pyx_TraceDeclarations
24171 __Pyx_RefNannySetupContext("__set__");
24172 __Pyx_TraceCall("__set__", __pyx_f[0], 2638);
24173 __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_n); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24174 ((struct __pyx_obj_9csamtools_PileupProxy *)__pyx_v_self)->n_pu = __pyx_t_1;
24179 __Pyx_AddTraceback("csamtools.PileupProxy.n.__set__");
24182 __Pyx_TraceReturn(Py_None);
24183 __Pyx_RefNannyFinishContext();
24187 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2641
24190 * def __get__(self): return self.pos # <<<<<<<<<<<<<<
24192 * property pileups:
24195 static PyObject *__pyx_pf_9csamtools_11PileupProxy_3pos___get__(PyObject *__pyx_v_self); /*proto*/
24196 static PyObject *__pyx_pf_9csamtools_11PileupProxy_3pos___get__(PyObject *__pyx_v_self) {
24197 PyObject *__pyx_r = NULL;
24198 PyObject *__pyx_t_1 = NULL;
24199 __Pyx_TraceDeclarations
24200 __Pyx_RefNannySetupContext("__get__");
24201 __Pyx_TraceCall("__get__", __pyx_f[0], 2641);
24202 __Pyx_XDECREF(__pyx_r);
24203 __pyx_t_1 = PyInt_FromLong(((struct __pyx_obj_9csamtools_PileupProxy *)__pyx_v_self)->pos); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2641; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24204 __Pyx_GOTREF(__pyx_t_1);
24205 __pyx_r = __pyx_t_1;
24209 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
24212 __Pyx_XDECREF(__pyx_t_1);
24213 __Pyx_AddTraceback("csamtools.PileupProxy.pos.__get__");
24216 __Pyx_XGIVEREF(__pyx_r);
24217 __Pyx_TraceReturn(__pyx_r);
24218 __Pyx_RefNannyFinishContext();
24222 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2645
24223 * property pileups:
24224 * '''list of reads (:class:`pysam.PileupRead`) aligned to this column'''
24225 * def __get__(self): # <<<<<<<<<<<<<<
24230 static PyObject *__pyx_pf_9csamtools_11PileupProxy_7pileups___get__(PyObject *__pyx_v_self); /*proto*/
24231 static PyObject *__pyx_pf_9csamtools_11PileupProxy_7pileups___get__(PyObject *__pyx_v_self) {
24233 PyObject *__pyx_v_pileups;
24234 PyObject *__pyx_r = NULL;
24235 PyObject *__pyx_t_1 = NULL;
24238 __Pyx_TraceDeclarations
24239 __Pyx_RefNannySetupContext("__get__");
24240 __Pyx_TraceCall("__get__", __pyx_f[0], 2645);
24241 __pyx_v_pileups = ((PyObject *)Py_None); __Pyx_INCREF(Py_None);
24243 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2647
24244 * def __get__(self):
24246 * pileups = [] # <<<<<<<<<<<<<<
24247 * # warning: there could be problems if self.n and self.buf are
24250 __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2647; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24251 __Pyx_GOTREF(((PyObject *)__pyx_t_1));
24252 __Pyx_DECREF(((PyObject *)__pyx_v_pileups));
24253 __pyx_v_pileups = __pyx_t_1;
24256 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2650
24257 * # warning: there could be problems if self.n and self.buf are
24259 * for x from 0 <= x < self.n_pu: # <<<<<<<<<<<<<<
24260 * pileups.append( makePileupRead( &(self.plp[x])) )
24263 __pyx_t_2 = ((struct __pyx_obj_9csamtools_PileupProxy *)__pyx_v_self)->n_pu;
24264 for (__pyx_v_x = 0; __pyx_v_x < __pyx_t_2; __pyx_v_x++) {
24266 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2651
24268 * for x from 0 <= x < self.n_pu:
24269 * pileups.append( makePileupRead( &(self.plp[x])) ) # <<<<<<<<<<<<<<
24273 if (unlikely(__pyx_v_pileups == Py_None)) {
24274 PyErr_SetString(PyExc_AttributeError, "'NoneType' object has no attribute 'append'"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2651; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24276 __pyx_t_1 = __pyx_f_9csamtools_makePileupRead((&(((struct __pyx_obj_9csamtools_PileupProxy *)__pyx_v_self)->plp[__pyx_v_x]))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2651; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24277 __Pyx_GOTREF(__pyx_t_1);
24278 __pyx_t_3 = PyList_Append(((PyObject *)__pyx_v_pileups), __pyx_t_1); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2651; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24279 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24282 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2652
24283 * for x from 0 <= x < self.n_pu:
24284 * pileups.append( makePileupRead( &(self.plp[x])) )
24285 * return pileups # <<<<<<<<<<<<<<
24287 * cdef class PileupRead:
24289 __Pyx_XDECREF(__pyx_r);
24290 __Pyx_INCREF(((PyObject *)__pyx_v_pileups));
24291 __pyx_r = ((PyObject *)__pyx_v_pileups);
24294 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
24297 __Pyx_XDECREF(__pyx_t_1);
24298 __Pyx_AddTraceback("csamtools.PileupProxy.pileups.__get__");
24301 __Pyx_DECREF(__pyx_v_pileups);
24302 __Pyx_XGIVEREF(__pyx_r);
24303 __Pyx_TraceReturn(__pyx_r);
24304 __Pyx_RefNannyFinishContext();
24308 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2667
24309 * uint32_t _is_tail
24311 * def __init__(self): # <<<<<<<<<<<<<<
24312 * raise TypeError("This class cannot be instantiated from Python")
24316 static int __pyx_pf_9csamtools_10PileupRead___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
24317 static int __pyx_pf_9csamtools_10PileupRead___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
24319 PyObject *__pyx_t_1 = NULL;
24320 PyObject *__pyx_t_2 = NULL;
24321 __Pyx_TraceDeclarations
24322 __Pyx_RefNannySetupContext("__init__");
24323 __Pyx_TraceCall("__init__", __pyx_f[0], 2667);
24324 if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
24325 __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
24326 if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1;
24328 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2668
24330 * def __init__(self):
24331 * raise TypeError("This class cannot be instantiated from Python") # <<<<<<<<<<<<<<
24333 * def __str__(self):
24335 __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2668; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24336 __Pyx_GOTREF(__pyx_t_1);
24337 __Pyx_INCREF(((PyObject *)__pyx_kp_s_97));
24338 PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_kp_s_97));
24339 __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_97));
24340 __pyx_t_2 = PyObject_Call(__pyx_builtin_TypeError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2668; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24341 __Pyx_GOTREF(__pyx_t_2);
24342 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24343 __Pyx_Raise(__pyx_t_2, 0, 0);
24344 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
24345 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2668; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24350 __Pyx_XDECREF(__pyx_t_1);
24351 __Pyx_XDECREF(__pyx_t_2);
24352 __Pyx_AddTraceback("csamtools.PileupRead.__init__");
24355 __Pyx_TraceReturn(Py_None);
24356 __Pyx_RefNannyFinishContext();
24360 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2670
24361 * raise TypeError("This class cannot be instantiated from Python")
24363 * def __str__(self): # <<<<<<<<<<<<<<
24364 * return "\t".join( map(str, (self.alignment, self.qpos, self.indel, self.level, self.is_del, self.is_head, self.is_tail ) ) )
24368 static PyObject *__pyx_pf_9csamtools_10PileupRead___str__(PyObject *__pyx_v_self); /*proto*/
24369 static PyObject *__pyx_pf_9csamtools_10PileupRead___str__(PyObject *__pyx_v_self) {
24370 PyObject *__pyx_r = NULL;
24371 PyObject *__pyx_t_1 = NULL;
24372 PyObject *__pyx_t_2 = NULL;
24373 PyObject *__pyx_t_3 = NULL;
24374 PyObject *__pyx_t_4 = NULL;
24375 PyObject *__pyx_t_5 = NULL;
24376 PyObject *__pyx_t_6 = NULL;
24377 PyObject *__pyx_t_7 = NULL;
24378 PyObject *__pyx_t_8 = NULL;
24379 PyObject *__pyx_t_9 = NULL;
24380 __Pyx_TraceDeclarations
24381 __Pyx_RefNannySetupContext("__str__");
24382 __Pyx_TraceCall("__str__", __pyx_f[0], 2670);
24384 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2671
24386 * def __str__(self):
24387 * return "\t".join( map(str, (self.alignment, self.qpos, self.indel, self.level, self.is_del, self.is_head, self.is_tail ) ) ) # <<<<<<<<<<<<<<
24389 * property alignment:
24391 __Pyx_XDECREF(__pyx_r);
24392 __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 = 2671; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24393 __Pyx_GOTREF(__pyx_t_1);
24394 __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__alignment); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2671; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24395 __Pyx_GOTREF(__pyx_t_2);
24396 __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__qpos); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2671; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24397 __Pyx_GOTREF(__pyx_t_3);
24398 __pyx_t_4 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__indel); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2671; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24399 __Pyx_GOTREF(__pyx_t_4);
24400 __pyx_t_5 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__level); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2671; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24401 __Pyx_GOTREF(__pyx_t_5);
24402 __pyx_t_6 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__is_del); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2671; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24403 __Pyx_GOTREF(__pyx_t_6);
24404 __pyx_t_7 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__is_head); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2671; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24405 __Pyx_GOTREF(__pyx_t_7);
24406 __pyx_t_8 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__is_tail); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2671; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24407 __Pyx_GOTREF(__pyx_t_8);
24408 __pyx_t_9 = PyTuple_New(7); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2671; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24409 __Pyx_GOTREF(__pyx_t_9);
24410 PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_2);
24411 __Pyx_GIVEREF(__pyx_t_2);
24412 PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_3);
24413 __Pyx_GIVEREF(__pyx_t_3);
24414 PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_t_4);
24415 __Pyx_GIVEREF(__pyx_t_4);
24416 PyTuple_SET_ITEM(__pyx_t_9, 3, __pyx_t_5);
24417 __Pyx_GIVEREF(__pyx_t_5);
24418 PyTuple_SET_ITEM(__pyx_t_9, 4, __pyx_t_6);
24419 __Pyx_GIVEREF(__pyx_t_6);
24420 PyTuple_SET_ITEM(__pyx_t_9, 5, __pyx_t_7);
24421 __Pyx_GIVEREF(__pyx_t_7);
24422 PyTuple_SET_ITEM(__pyx_t_9, 6, __pyx_t_8);
24423 __Pyx_GIVEREF(__pyx_t_8);
24431 __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2671; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24432 __Pyx_GOTREF(__pyx_t_8);
24433 __Pyx_INCREF(((PyObject *)((PyObject*)&PyString_Type)));
24434 PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)((PyObject*)&PyString_Type)));
24435 __Pyx_GIVEREF(((PyObject *)((PyObject*)&PyString_Type)));
24436 PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_9);
24437 __Pyx_GIVEREF(__pyx_t_9);
24439 __pyx_t_9 = PyObject_Call(__pyx_builtin_map, __pyx_t_8, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2671; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24440 __Pyx_GOTREF(__pyx_t_9);
24441 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
24442 __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2671; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24443 __Pyx_GOTREF(__pyx_t_8);
24444 PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_9);
24445 __Pyx_GIVEREF(__pyx_t_9);
24447 __pyx_t_9 = PyObject_Call(__pyx_t_1, __pyx_t_8, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2671; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24448 __Pyx_GOTREF(__pyx_t_9);
24449 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24450 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
24451 __pyx_r = __pyx_t_9;
24455 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
24458 __Pyx_XDECREF(__pyx_t_1);
24459 __Pyx_XDECREF(__pyx_t_2);
24460 __Pyx_XDECREF(__pyx_t_3);
24461 __Pyx_XDECREF(__pyx_t_4);
24462 __Pyx_XDECREF(__pyx_t_5);
24463 __Pyx_XDECREF(__pyx_t_6);
24464 __Pyx_XDECREF(__pyx_t_7);
24465 __Pyx_XDECREF(__pyx_t_8);
24466 __Pyx_XDECREF(__pyx_t_9);
24467 __Pyx_AddTraceback("csamtools.PileupRead.__str__");
24470 __Pyx_XGIVEREF(__pyx_r);
24471 __Pyx_TraceReturn(__pyx_r);
24472 __Pyx_RefNannyFinishContext();
24476 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2675
24477 * property alignment:
24478 * """a :class:`pysam.AlignedRead` object of the aligned read"""
24479 * def __get__(self): # <<<<<<<<<<<<<<
24480 * return self._alignment
24484 static PyObject *__pyx_pf_9csamtools_10PileupRead_9alignment___get__(PyObject *__pyx_v_self); /*proto*/
24485 static PyObject *__pyx_pf_9csamtools_10PileupRead_9alignment___get__(PyObject *__pyx_v_self) {
24486 PyObject *__pyx_r = NULL;
24487 __Pyx_TraceDeclarations
24488 __Pyx_RefNannySetupContext("__get__");
24489 __Pyx_TraceCall("__get__", __pyx_f[0], 2675);
24491 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2676
24492 * """a :class:`pysam.AlignedRead` object of the aligned read"""
24493 * def __get__(self):
24494 * return self._alignment # <<<<<<<<<<<<<<
24496 * """position of the read base at the pileup site, 0-based"""
24498 __Pyx_XDECREF(__pyx_r);
24499 __Pyx_INCREF(((PyObject *)((struct __pyx_obj_9csamtools_PileupRead *)__pyx_v_self)->_alignment));
24500 __pyx_r = ((PyObject *)((struct __pyx_obj_9csamtools_PileupRead *)__pyx_v_self)->_alignment);
24503 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
24505 __Pyx_XGIVEREF(__pyx_r);
24506 __Pyx_TraceReturn(__pyx_r);
24507 __Pyx_RefNannyFinishContext();
24511 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2679
24513 * """position of the read base at the pileup site, 0-based"""
24514 * def __get__(self): # <<<<<<<<<<<<<<
24515 * return self._qpos
24519 static PyObject *__pyx_pf_9csamtools_10PileupRead_4qpos___get__(PyObject *__pyx_v_self); /*proto*/
24520 static PyObject *__pyx_pf_9csamtools_10PileupRead_4qpos___get__(PyObject *__pyx_v_self) {
24521 PyObject *__pyx_r = NULL;
24522 PyObject *__pyx_t_1 = NULL;
24523 __Pyx_TraceDeclarations
24524 __Pyx_RefNannySetupContext("__get__");
24525 __Pyx_TraceCall("__get__", __pyx_f[0], 2679);
24527 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2680
24528 * """position of the read base at the pileup site, 0-based"""
24529 * def __get__(self):
24530 * return self._qpos # <<<<<<<<<<<<<<
24532 * """indel length; 0 for no indel, positive for ins and negative for del"""
24534 __Pyx_XDECREF(__pyx_r);
24535 __pyx_t_1 = __Pyx_PyInt_to_py_int32_t(((struct __pyx_obj_9csamtools_PileupRead *)__pyx_v_self)->_qpos); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2680; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24536 __Pyx_GOTREF(__pyx_t_1);
24537 __pyx_r = __pyx_t_1;
24541 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
24544 __Pyx_XDECREF(__pyx_t_1);
24545 __Pyx_AddTraceback("csamtools.PileupRead.qpos.__get__");
24548 __Pyx_XGIVEREF(__pyx_r);
24549 __Pyx_TraceReturn(__pyx_r);
24550 __Pyx_RefNannyFinishContext();
24554 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2683
24556 * """indel length; 0 for no indel, positive for ins and negative for del"""
24557 * def __get__(self): # <<<<<<<<<<<<<<
24558 * return self._indel
24562 static PyObject *__pyx_pf_9csamtools_10PileupRead_5indel___get__(PyObject *__pyx_v_self); /*proto*/
24563 static PyObject *__pyx_pf_9csamtools_10PileupRead_5indel___get__(PyObject *__pyx_v_self) {
24564 PyObject *__pyx_r = NULL;
24565 PyObject *__pyx_t_1 = NULL;
24566 __Pyx_TraceDeclarations
24567 __Pyx_RefNannySetupContext("__get__");
24568 __Pyx_TraceCall("__get__", __pyx_f[0], 2683);
24570 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2684
24571 * """indel length; 0 for no indel, positive for ins and negative for del"""
24572 * def __get__(self):
24573 * return self._indel # <<<<<<<<<<<<<<
24575 * """1 iff the base on the padded read is a deletion"""
24577 __Pyx_XDECREF(__pyx_r);
24578 __pyx_t_1 = PyInt_FromLong(((struct __pyx_obj_9csamtools_PileupRead *)__pyx_v_self)->_indel); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2684; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24579 __Pyx_GOTREF(__pyx_t_1);
24580 __pyx_r = __pyx_t_1;
24584 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
24587 __Pyx_XDECREF(__pyx_t_1);
24588 __Pyx_AddTraceback("csamtools.PileupRead.indel.__get__");
24591 __Pyx_XGIVEREF(__pyx_r);
24592 __Pyx_TraceReturn(__pyx_r);
24593 __Pyx_RefNannyFinishContext();
24597 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2687
24599 * """1 iff the base on the padded read is a deletion"""
24600 * def __get__(self): # <<<<<<<<<<<<<<
24601 * return self._is_del
24602 * property is_head:
24605 static PyObject *__pyx_pf_9csamtools_10PileupRead_6is_del___get__(PyObject *__pyx_v_self); /*proto*/
24606 static PyObject *__pyx_pf_9csamtools_10PileupRead_6is_del___get__(PyObject *__pyx_v_self) {
24607 PyObject *__pyx_r = NULL;
24608 PyObject *__pyx_t_1 = NULL;
24609 __Pyx_TraceDeclarations
24610 __Pyx_RefNannySetupContext("__get__");
24611 __Pyx_TraceCall("__get__", __pyx_f[0], 2687);
24613 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2688
24614 * """1 iff the base on the padded read is a deletion"""
24615 * def __get__(self):
24616 * return self._is_del # <<<<<<<<<<<<<<
24617 * property is_head:
24618 * def __get__(self):
24620 __Pyx_XDECREF(__pyx_r);
24621 __pyx_t_1 = __Pyx_PyInt_to_py_uint32_t(((struct __pyx_obj_9csamtools_PileupRead *)__pyx_v_self)->_is_del); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2688; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24622 __Pyx_GOTREF(__pyx_t_1);
24623 __pyx_r = __pyx_t_1;
24627 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
24630 __Pyx_XDECREF(__pyx_t_1);
24631 __Pyx_AddTraceback("csamtools.PileupRead.is_del.__get__");
24634 __Pyx_XGIVEREF(__pyx_r);
24635 __Pyx_TraceReturn(__pyx_r);
24636 __Pyx_RefNannyFinishContext();
24640 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2690
24641 * return self._is_del
24642 * property is_head:
24643 * def __get__(self): # <<<<<<<<<<<<<<
24644 * return self._is_head
24645 * property is_tail:
24648 static PyObject *__pyx_pf_9csamtools_10PileupRead_7is_head___get__(PyObject *__pyx_v_self); /*proto*/
24649 static PyObject *__pyx_pf_9csamtools_10PileupRead_7is_head___get__(PyObject *__pyx_v_self) {
24650 PyObject *__pyx_r = NULL;
24651 PyObject *__pyx_t_1 = NULL;
24652 __Pyx_TraceDeclarations
24653 __Pyx_RefNannySetupContext("__get__");
24654 __Pyx_TraceCall("__get__", __pyx_f[0], 2690);
24656 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2691
24657 * property is_head:
24658 * def __get__(self):
24659 * return self._is_head # <<<<<<<<<<<<<<
24660 * property is_tail:
24661 * def __get__(self):
24663 __Pyx_XDECREF(__pyx_r);
24664 __pyx_t_1 = __Pyx_PyInt_to_py_uint32_t(((struct __pyx_obj_9csamtools_PileupRead *)__pyx_v_self)->_is_head); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2691; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24665 __Pyx_GOTREF(__pyx_t_1);
24666 __pyx_r = __pyx_t_1;
24670 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
24673 __Pyx_XDECREF(__pyx_t_1);
24674 __Pyx_AddTraceback("csamtools.PileupRead.is_head.__get__");
24677 __Pyx_XGIVEREF(__pyx_r);
24678 __Pyx_TraceReturn(__pyx_r);
24679 __Pyx_RefNannyFinishContext();
24683 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2693
24684 * return self._is_head
24685 * property is_tail:
24686 * def __get__(self): # <<<<<<<<<<<<<<
24687 * return self._is_tail
24691 static PyObject *__pyx_pf_9csamtools_10PileupRead_7is_tail___get__(PyObject *__pyx_v_self); /*proto*/
24692 static PyObject *__pyx_pf_9csamtools_10PileupRead_7is_tail___get__(PyObject *__pyx_v_self) {
24693 PyObject *__pyx_r = NULL;
24694 PyObject *__pyx_t_1 = NULL;
24695 __Pyx_TraceDeclarations
24696 __Pyx_RefNannySetupContext("__get__");
24697 __Pyx_TraceCall("__get__", __pyx_f[0], 2693);
24699 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2694
24700 * property is_tail:
24701 * def __get__(self):
24702 * return self._is_tail # <<<<<<<<<<<<<<
24704 * def __get__(self):
24706 __Pyx_XDECREF(__pyx_r);
24707 __pyx_t_1 = __Pyx_PyInt_to_py_uint32_t(((struct __pyx_obj_9csamtools_PileupRead *)__pyx_v_self)->_is_tail); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2694; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24708 __Pyx_GOTREF(__pyx_t_1);
24709 __pyx_r = __pyx_t_1;
24713 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
24716 __Pyx_XDECREF(__pyx_t_1);
24717 __Pyx_AddTraceback("csamtools.PileupRead.is_tail.__get__");
24720 __Pyx_XGIVEREF(__pyx_r);
24721 __Pyx_TraceReturn(__pyx_r);
24722 __Pyx_RefNannyFinishContext();
24726 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2696
24727 * return self._is_tail
24729 * def __get__(self): # <<<<<<<<<<<<<<
24730 * return self._level
24734 static PyObject *__pyx_pf_9csamtools_10PileupRead_5level___get__(PyObject *__pyx_v_self); /*proto*/
24735 static PyObject *__pyx_pf_9csamtools_10PileupRead_5level___get__(PyObject *__pyx_v_self) {
24736 PyObject *__pyx_r = NULL;
24737 PyObject *__pyx_t_1 = NULL;
24738 __Pyx_TraceDeclarations
24739 __Pyx_RefNannySetupContext("__get__");
24740 __Pyx_TraceCall("__get__", __pyx_f[0], 2696);
24742 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2697
24744 * def __get__(self):
24745 * return self._level # <<<<<<<<<<<<<<
24749 __Pyx_XDECREF(__pyx_r);
24750 __pyx_t_1 = PyInt_FromLong(((struct __pyx_obj_9csamtools_PileupRead *)__pyx_v_self)->_level); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2697; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24751 __Pyx_GOTREF(__pyx_t_1);
24752 __pyx_r = __pyx_t_1;
24756 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
24759 __Pyx_XDECREF(__pyx_t_1);
24760 __Pyx_AddTraceback("csamtools.PileupRead.level.__get__");
24763 __Pyx_XGIVEREF(__pyx_r);
24764 __Pyx_TraceReturn(__pyx_r);
24765 __Pyx_RefNannyFinishContext();
24769 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2701
24771 * '''http://mail.python.org/pipermail/python-list/2000-June/038406.html'''
24772 * def __init__(self, id = 1): # <<<<<<<<<<<<<<
24773 * self.streams = []
24777 static PyObject *__pyx_pf_9csamtools_4Outs___init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
24778 static char __pyx_doc_9csamtools_4Outs___init__[] = "Outs.__init__(self, id=1)";
24779 static PyMethodDef __pyx_mdef_9csamtools_4Outs___init__ = {__Pyx_NAMESTR("__init__"), (PyCFunction)__pyx_pf_9csamtools_4Outs___init__, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_9csamtools_4Outs___init__)};
24780 static PyObject *__pyx_pf_9csamtools_4Outs___init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
24781 PyObject *__pyx_v_self = 0;
24782 PyObject *__pyx_v_id = 0;
24783 PyObject *__pyx_r = NULL;
24784 PyObject *__pyx_t_1 = NULL;
24785 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__id,0};
24786 __Pyx_TraceDeclarations
24787 __Pyx_RefNannySetupContext("__init__");
24788 __Pyx_TraceCall("__init__", __pyx_f[0], 2701);
24789 __pyx_self = __pyx_self;
24790 if (unlikely(__pyx_kwds)) {
24791 Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
24792 PyObject* values[2] = {0,0};
24793 values[1] = ((PyObject *)__pyx_int_1);
24794 switch (PyTuple_GET_SIZE(__pyx_args)) {
24795 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
24796 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
24798 default: goto __pyx_L5_argtuple_error;
24800 switch (PyTuple_GET_SIZE(__pyx_args)) {
24802 values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self);
24803 if (likely(values[0])) kw_args--;
24804 else goto __pyx_L5_argtuple_error;
24807 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__id);
24808 if (value) { values[1] = value; kw_args--; }
24811 if (unlikely(kw_args > 0)) {
24812 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2701; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
24814 __pyx_v_self = values[0];
24815 __pyx_v_id = values[1];
24817 __pyx_v_id = ((PyObject *)__pyx_int_1);
24818 switch (PyTuple_GET_SIZE(__pyx_args)) {
24819 case 2: __pyx_v_id = PyTuple_GET_ITEM(__pyx_args, 1);
24820 case 1: __pyx_v_self = PyTuple_GET_ITEM(__pyx_args, 0);
24822 default: goto __pyx_L5_argtuple_error;
24825 goto __pyx_L4_argument_unpacking_done;
24826 __pyx_L5_argtuple_error:;
24827 __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2701; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
24829 __Pyx_AddTraceback("csamtools.Outs.__init__");
24830 __Pyx_RefNannyFinishContext();
24832 __pyx_L4_argument_unpacking_done:;
24834 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2702
24835 * '''http://mail.python.org/pipermail/python-list/2000-June/038406.html'''
24836 * def __init__(self, id = 1):
24837 * self.streams = [] # <<<<<<<<<<<<<<
24841 __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2702; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24842 __Pyx_GOTREF(((PyObject *)__pyx_t_1));
24843 if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__streams, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2702; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24844 __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
24846 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2703
24847 * def __init__(self, id = 1):
24848 * self.streams = []
24849 * self.id = id # <<<<<<<<<<<<<<
24851 * def setdevice(self, filename):
24853 if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__id, __pyx_v_id) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24855 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
24858 __Pyx_XDECREF(__pyx_t_1);
24859 __Pyx_AddTraceback("csamtools.Outs.__init__");
24862 __Pyx_XGIVEREF(__pyx_r);
24863 __Pyx_TraceReturn(__pyx_r);
24864 __Pyx_RefNannyFinishContext();
24868 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2705
24871 * def setdevice(self, filename): # <<<<<<<<<<<<<<
24872 * '''open an existing file, like "/dev/null"'''
24873 * fd = os.open(filename, os.O_WRONLY)
24876 static PyObject *__pyx_pf_9csamtools_4Outs_setdevice(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
24877 static char __pyx_doc_9csamtools_4Outs_setdevice[] = "Outs.setdevice(self, filename)\nopen an existing file, like \"/dev/null\"";
24878 static PyMethodDef __pyx_mdef_9csamtools_4Outs_setdevice = {__Pyx_NAMESTR("setdevice"), (PyCFunction)__pyx_pf_9csamtools_4Outs_setdevice, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_9csamtools_4Outs_setdevice)};
24879 static PyObject *__pyx_pf_9csamtools_4Outs_setdevice(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
24880 PyObject *__pyx_v_self = 0;
24881 PyObject *__pyx_v_filename = 0;
24882 PyObject *__pyx_v_fd;
24883 PyObject *__pyx_r = NULL;
24884 PyObject *__pyx_t_1 = NULL;
24885 PyObject *__pyx_t_2 = NULL;
24886 PyObject *__pyx_t_3 = NULL;
24887 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__filename,0};
24888 __Pyx_TraceDeclarations
24889 __Pyx_RefNannySetupContext("setdevice");
24890 __Pyx_TraceCall("setdevice", __pyx_f[0], 2705);
24891 __pyx_self = __pyx_self;
24892 if (unlikely(__pyx_kwds)) {
24893 Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
24894 PyObject* values[2] = {0,0};
24895 switch (PyTuple_GET_SIZE(__pyx_args)) {
24896 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
24897 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
24899 default: goto __pyx_L5_argtuple_error;
24901 switch (PyTuple_GET_SIZE(__pyx_args)) {
24903 values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self);
24904 if (likely(values[0])) kw_args--;
24905 else goto __pyx_L5_argtuple_error;
24907 values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__filename);
24908 if (likely(values[1])) kw_args--;
24910 __Pyx_RaiseArgtupleInvalid("setdevice", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2705; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
24913 if (unlikely(kw_args > 0)) {
24914 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "setdevice") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2705; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
24916 __pyx_v_self = values[0];
24917 __pyx_v_filename = values[1];
24918 } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
24919 goto __pyx_L5_argtuple_error;
24921 __pyx_v_self = PyTuple_GET_ITEM(__pyx_args, 0);
24922 __pyx_v_filename = PyTuple_GET_ITEM(__pyx_args, 1);
24924 goto __pyx_L4_argument_unpacking_done;
24925 __pyx_L5_argtuple_error:;
24926 __Pyx_RaiseArgtupleInvalid("setdevice", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2705; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
24928 __Pyx_AddTraceback("csamtools.Outs.setdevice");
24929 __Pyx_RefNannyFinishContext();
24931 __pyx_L4_argument_unpacking_done:;
24932 __pyx_v_fd = Py_None; __Pyx_INCREF(Py_None);
24934 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2707
24935 * def setdevice(self, filename):
24936 * '''open an existing file, like "/dev/null"'''
24937 * fd = os.open(filename, os.O_WRONLY) # <<<<<<<<<<<<<<
24941 __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__os); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2707; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24942 __Pyx_GOTREF(__pyx_t_1);
24943 __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__open); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2707; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24944 __Pyx_GOTREF(__pyx_t_2);
24945 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24946 __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__os); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2707; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24947 __Pyx_GOTREF(__pyx_t_1);
24948 __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__O_WRONLY); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2707; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24949 __Pyx_GOTREF(__pyx_t_3);
24950 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24951 __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2707; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24952 __Pyx_GOTREF(__pyx_t_1);
24953 __Pyx_INCREF(__pyx_v_filename);
24954 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_filename);
24955 __Pyx_GIVEREF(__pyx_v_filename);
24956 PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3);
24957 __Pyx_GIVEREF(__pyx_t_3);
24959 __pyx_t_3 = PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2707; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24960 __Pyx_GOTREF(__pyx_t_3);
24961 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
24962 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24963 __Pyx_DECREF(__pyx_v_fd);
24964 __pyx_v_fd = __pyx_t_3;
24967 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2708
24968 * '''open an existing file, like "/dev/null"'''
24969 * fd = os.open(filename, os.O_WRONLY)
24970 * self.setfd(fd) # <<<<<<<<<<<<<<
24972 * def setfile(self, filename):
24974 __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__setfd); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2708; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24975 __Pyx_GOTREF(__pyx_t_3);
24976 __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2708; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24977 __Pyx_GOTREF(__pyx_t_1);
24978 __Pyx_INCREF(__pyx_v_fd);
24979 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_fd);
24980 __Pyx_GIVEREF(__pyx_v_fd);
24981 __pyx_t_2 = PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2708; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24982 __Pyx_GOTREF(__pyx_t_2);
24983 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
24984 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24985 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
24987 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
24990 __Pyx_XDECREF(__pyx_t_1);
24991 __Pyx_XDECREF(__pyx_t_2);
24992 __Pyx_XDECREF(__pyx_t_3);
24993 __Pyx_AddTraceback("csamtools.Outs.setdevice");
24996 __Pyx_DECREF(__pyx_v_fd);
24997 __Pyx_XGIVEREF(__pyx_r);
24998 __Pyx_TraceReturn(__pyx_r);
24999 __Pyx_RefNannyFinishContext();
25003 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2710
25006 * def setfile(self, filename): # <<<<<<<<<<<<<<
25007 * '''open a new file.'''
25008 * fd = os.open(filename, os.O_WRONLY|os.O_CREAT, 0660);
25011 static PyObject *__pyx_pf_9csamtools_4Outs_setfile(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
25012 static char __pyx_doc_9csamtools_4Outs_setfile[] = "Outs.setfile(self, filename)\nopen a new file.";
25013 static PyMethodDef __pyx_mdef_9csamtools_4Outs_setfile = {__Pyx_NAMESTR("setfile"), (PyCFunction)__pyx_pf_9csamtools_4Outs_setfile, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_9csamtools_4Outs_setfile)};
25014 static PyObject *__pyx_pf_9csamtools_4Outs_setfile(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
25015 PyObject *__pyx_v_self = 0;
25016 PyObject *__pyx_v_filename = 0;
25017 PyObject *__pyx_v_fd;
25018 PyObject *__pyx_r = NULL;
25019 PyObject *__pyx_t_1 = NULL;
25020 PyObject *__pyx_t_2 = NULL;
25021 PyObject *__pyx_t_3 = NULL;
25022 PyObject *__pyx_t_4 = NULL;
25023 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__filename,0};
25024 __Pyx_TraceDeclarations
25025 __Pyx_RefNannySetupContext("setfile");
25026 __Pyx_TraceCall("setfile", __pyx_f[0], 2710);
25027 __pyx_self = __pyx_self;
25028 if (unlikely(__pyx_kwds)) {
25029 Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
25030 PyObject* values[2] = {0,0};
25031 switch (PyTuple_GET_SIZE(__pyx_args)) {
25032 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
25033 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
25035 default: goto __pyx_L5_argtuple_error;
25037 switch (PyTuple_GET_SIZE(__pyx_args)) {
25039 values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self);
25040 if (likely(values[0])) kw_args--;
25041 else goto __pyx_L5_argtuple_error;
25043 values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__filename);
25044 if (likely(values[1])) kw_args--;
25046 __Pyx_RaiseArgtupleInvalid("setfile", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2710; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
25049 if (unlikely(kw_args > 0)) {
25050 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "setfile") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2710; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
25052 __pyx_v_self = values[0];
25053 __pyx_v_filename = values[1];
25054 } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
25055 goto __pyx_L5_argtuple_error;
25057 __pyx_v_self = PyTuple_GET_ITEM(__pyx_args, 0);
25058 __pyx_v_filename = PyTuple_GET_ITEM(__pyx_args, 1);
25060 goto __pyx_L4_argument_unpacking_done;
25061 __pyx_L5_argtuple_error:;
25062 __Pyx_RaiseArgtupleInvalid("setfile", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2710; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
25064 __Pyx_AddTraceback("csamtools.Outs.setfile");
25065 __Pyx_RefNannyFinishContext();
25067 __pyx_L4_argument_unpacking_done:;
25068 __pyx_v_fd = Py_None; __Pyx_INCREF(Py_None);
25070 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2712
25071 * def setfile(self, filename):
25072 * '''open a new file.'''
25073 * fd = os.open(filename, os.O_WRONLY|os.O_CREAT, 0660); # <<<<<<<<<<<<<<
25077 __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__os); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2712; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25078 __Pyx_GOTREF(__pyx_t_1);
25079 __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__open); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2712; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25080 __Pyx_GOTREF(__pyx_t_2);
25081 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25082 __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__os); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2712; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25083 __Pyx_GOTREF(__pyx_t_1);
25084 __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__O_WRONLY); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2712; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25085 __Pyx_GOTREF(__pyx_t_3);
25086 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25087 __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__os); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2712; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25088 __Pyx_GOTREF(__pyx_t_1);
25089 __pyx_t_4 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__O_CREAT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2712; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25090 __Pyx_GOTREF(__pyx_t_4);
25091 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25092 __pyx_t_1 = PyNumber_Or(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2712; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25093 __Pyx_GOTREF(__pyx_t_1);
25094 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
25095 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
25096 __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2712; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25097 __Pyx_GOTREF(__pyx_t_4);
25098 __Pyx_INCREF(__pyx_v_filename);
25099 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_filename);
25100 __Pyx_GIVEREF(__pyx_v_filename);
25101 PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
25102 __Pyx_GIVEREF(__pyx_t_1);
25103 __Pyx_INCREF(__pyx_int_0660);
25104 PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_int_0660);
25105 __Pyx_GIVEREF(__pyx_int_0660);
25107 __pyx_t_1 = PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2712; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25108 __Pyx_GOTREF(__pyx_t_1);
25109 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25110 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
25111 __Pyx_DECREF(__pyx_v_fd);
25112 __pyx_v_fd = __pyx_t_1;
25115 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2713
25116 * '''open a new file.'''
25117 * fd = os.open(filename, os.O_WRONLY|os.O_CREAT, 0660);
25118 * self.setfd(fd) # <<<<<<<<<<<<<<
25120 * def setfd(self, fd):
25122 __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__setfd); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2713; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25123 __Pyx_GOTREF(__pyx_t_1);
25124 __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2713; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25125 __Pyx_GOTREF(__pyx_t_4);
25126 __Pyx_INCREF(__pyx_v_fd);
25127 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_fd);
25128 __Pyx_GIVEREF(__pyx_v_fd);
25129 __pyx_t_2 = PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2713; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25130 __Pyx_GOTREF(__pyx_t_2);
25131 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25132 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
25133 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25135 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
25138 __Pyx_XDECREF(__pyx_t_1);
25139 __Pyx_XDECREF(__pyx_t_2);
25140 __Pyx_XDECREF(__pyx_t_3);
25141 __Pyx_XDECREF(__pyx_t_4);
25142 __Pyx_AddTraceback("csamtools.Outs.setfile");
25145 __Pyx_DECREF(__pyx_v_fd);
25146 __Pyx_XGIVEREF(__pyx_r);
25147 __Pyx_TraceReturn(__pyx_r);
25148 __Pyx_RefNannyFinishContext();
25152 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2715
25155 * def setfd(self, fd): # <<<<<<<<<<<<<<
25156 * ofd = os.dup(self.id) # Save old stream on new unit.
25157 * self.streams.append(ofd)
25160 static PyObject *__pyx_pf_9csamtools_4Outs_setfd(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
25161 static char __pyx_doc_9csamtools_4Outs_setfd[] = "Outs.setfd(self, fd)";
25162 static PyMethodDef __pyx_mdef_9csamtools_4Outs_setfd = {__Pyx_NAMESTR("setfd"), (PyCFunction)__pyx_pf_9csamtools_4Outs_setfd, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_9csamtools_4Outs_setfd)};
25163 static PyObject *__pyx_pf_9csamtools_4Outs_setfd(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
25164 PyObject *__pyx_v_self = 0;
25165 PyObject *__pyx_v_fd = 0;
25166 PyObject *__pyx_v_ofd;
25167 PyObject *__pyx_r = NULL;
25168 PyObject *__pyx_t_1 = NULL;
25169 PyObject *__pyx_t_2 = NULL;
25170 PyObject *__pyx_t_3 = NULL;
25171 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__fd,0};
25172 __Pyx_TraceDeclarations
25173 __Pyx_RefNannySetupContext("setfd");
25174 __Pyx_TraceCall("setfd", __pyx_f[0], 2715);
25175 __pyx_self = __pyx_self;
25176 if (unlikely(__pyx_kwds)) {
25177 Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
25178 PyObject* values[2] = {0,0};
25179 switch (PyTuple_GET_SIZE(__pyx_args)) {
25180 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
25181 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
25183 default: goto __pyx_L5_argtuple_error;
25185 switch (PyTuple_GET_SIZE(__pyx_args)) {
25187 values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self);
25188 if (likely(values[0])) kw_args--;
25189 else goto __pyx_L5_argtuple_error;
25191 values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__fd);
25192 if (likely(values[1])) kw_args--;
25194 __Pyx_RaiseArgtupleInvalid("setfd", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2715; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
25197 if (unlikely(kw_args > 0)) {
25198 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "setfd") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2715; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
25200 __pyx_v_self = values[0];
25201 __pyx_v_fd = values[1];
25202 } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
25203 goto __pyx_L5_argtuple_error;
25205 __pyx_v_self = PyTuple_GET_ITEM(__pyx_args, 0);
25206 __pyx_v_fd = PyTuple_GET_ITEM(__pyx_args, 1);
25208 goto __pyx_L4_argument_unpacking_done;
25209 __pyx_L5_argtuple_error:;
25210 __Pyx_RaiseArgtupleInvalid("setfd", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2715; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
25212 __Pyx_AddTraceback("csamtools.Outs.setfd");
25213 __Pyx_RefNannyFinishContext();
25215 __pyx_L4_argument_unpacking_done:;
25216 __pyx_v_ofd = Py_None; __Pyx_INCREF(Py_None);
25218 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2716
25220 * def setfd(self, fd):
25221 * ofd = os.dup(self.id) # Save old stream on new unit. # <<<<<<<<<<<<<<
25222 * self.streams.append(ofd)
25223 * sys.stdout.flush() # Buffered data goes to old stream.
25225 __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__os); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2716; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25226 __Pyx_GOTREF(__pyx_t_1);
25227 __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__dup); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2716; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25228 __Pyx_GOTREF(__pyx_t_2);
25229 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25230 __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__id); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2716; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25231 __Pyx_GOTREF(__pyx_t_1);
25232 __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2716; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25233 __Pyx_GOTREF(__pyx_t_3);
25234 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
25235 __Pyx_GIVEREF(__pyx_t_1);
25237 __pyx_t_1 = PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2716; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25238 __Pyx_GOTREF(__pyx_t_1);
25239 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25240 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
25241 __Pyx_DECREF(__pyx_v_ofd);
25242 __pyx_v_ofd = __pyx_t_1;
25245 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2717
25246 * def setfd(self, fd):
25247 * ofd = os.dup(self.id) # Save old stream on new unit.
25248 * self.streams.append(ofd) # <<<<<<<<<<<<<<
25249 * sys.stdout.flush() # Buffered data goes to old stream.
25250 * sys.stderr.flush() # Buffered data goes to old stream.
25252 __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__streams); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25253 __Pyx_GOTREF(__pyx_t_1);
25254 __pyx_t_3 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_v_ofd); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25255 __Pyx_GOTREF(__pyx_t_3);
25256 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25257 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
25259 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2718
25260 * ofd = os.dup(self.id) # Save old stream on new unit.
25261 * self.streams.append(ofd)
25262 * sys.stdout.flush() # Buffered data goes to old stream. # <<<<<<<<<<<<<<
25263 * sys.stderr.flush() # Buffered data goes to old stream.
25264 * os.dup2(fd, self.id) # Open unit 1 on new stream.
25266 __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__sys); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25267 __Pyx_GOTREF(__pyx_t_3);
25268 __pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__stdout); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25269 __Pyx_GOTREF(__pyx_t_1);
25270 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
25271 __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__flush); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25272 __Pyx_GOTREF(__pyx_t_3);
25273 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25274 __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 = 2718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25275 __Pyx_GOTREF(__pyx_t_1);
25276 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
25277 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25279 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2719
25280 * self.streams.append(ofd)
25281 * sys.stdout.flush() # Buffered data goes to old stream.
25282 * sys.stderr.flush() # Buffered data goes to old stream. # <<<<<<<<<<<<<<
25283 * os.dup2(fd, self.id) # Open unit 1 on new stream.
25284 * os.close(fd) # Close other unit (look out, caller.)
25286 __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__sys); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25287 __Pyx_GOTREF(__pyx_t_1);
25288 __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__stderr); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25289 __Pyx_GOTREF(__pyx_t_3);
25290 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25291 __pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__flush); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25292 __Pyx_GOTREF(__pyx_t_1);
25293 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
25294 __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 = 2719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25295 __Pyx_GOTREF(__pyx_t_3);
25296 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25297 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
25299 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2720
25300 * sys.stdout.flush() # Buffered data goes to old stream.
25301 * sys.stderr.flush() # Buffered data goes to old stream.
25302 * os.dup2(fd, self.id) # Open unit 1 on new stream. # <<<<<<<<<<<<<<
25303 * os.close(fd) # Close other unit (look out, caller.)
25306 __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__os); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2720; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25307 __Pyx_GOTREF(__pyx_t_3);
25308 __pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__dup2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2720; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25309 __Pyx_GOTREF(__pyx_t_1);
25310 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
25311 __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__id); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2720; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25312 __Pyx_GOTREF(__pyx_t_3);
25313 __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2720; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25314 __Pyx_GOTREF(__pyx_t_2);
25315 __Pyx_INCREF(__pyx_v_fd);
25316 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_fd);
25317 __Pyx_GIVEREF(__pyx_v_fd);
25318 PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
25319 __Pyx_GIVEREF(__pyx_t_3);
25321 __pyx_t_3 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2720; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25322 __Pyx_GOTREF(__pyx_t_3);
25323 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25324 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25325 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
25327 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2721
25328 * sys.stderr.flush() # Buffered data goes to old stream.
25329 * os.dup2(fd, self.id) # Open unit 1 on new stream.
25330 * os.close(fd) # Close other unit (look out, caller.) # <<<<<<<<<<<<<<
25332 * def restore(self):
25334 __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__os); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2721; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25335 __Pyx_GOTREF(__pyx_t_3);
25336 __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__close); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2721; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25337 __Pyx_GOTREF(__pyx_t_2);
25338 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
25339 __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2721; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25340 __Pyx_GOTREF(__pyx_t_3);
25341 __Pyx_INCREF(__pyx_v_fd);
25342 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_fd);
25343 __Pyx_GIVEREF(__pyx_v_fd);
25344 __pyx_t_1 = PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2721; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25345 __Pyx_GOTREF(__pyx_t_1);
25346 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25347 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
25348 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25350 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
25353 __Pyx_XDECREF(__pyx_t_1);
25354 __Pyx_XDECREF(__pyx_t_2);
25355 __Pyx_XDECREF(__pyx_t_3);
25356 __Pyx_AddTraceback("csamtools.Outs.setfd");
25359 __Pyx_DECREF(__pyx_v_ofd);
25360 __Pyx_XGIVEREF(__pyx_r);
25361 __Pyx_TraceReturn(__pyx_r);
25362 __Pyx_RefNannyFinishContext();
25366 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2723
25367 * os.close(fd) # Close other unit (look out, caller.)
25369 * def restore(self): # <<<<<<<<<<<<<<
25370 * '''restore previous output stream'''
25374 static PyObject *__pyx_pf_9csamtools_4Outs_restore(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
25375 static char __pyx_doc_9csamtools_4Outs_restore[] = "Outs.restore(self)\nrestore previous output stream";
25376 static PyMethodDef __pyx_mdef_9csamtools_4Outs_restore = {__Pyx_NAMESTR("restore"), (PyCFunction)__pyx_pf_9csamtools_4Outs_restore, METH_O, __Pyx_DOCSTR(__pyx_doc_9csamtools_4Outs_restore)};
25377 static PyObject *__pyx_pf_9csamtools_4Outs_restore(PyObject *__pyx_self, PyObject *__pyx_v_self) {
25378 PyObject *__pyx_r = NULL;
25379 PyObject *__pyx_t_1 = NULL;
25381 PyObject *__pyx_t_3 = NULL;
25382 PyObject *__pyx_t_4 = NULL;
25383 PyObject *__pyx_t_5 = NULL;
25384 __Pyx_TraceDeclarations
25385 __Pyx_RefNannySetupContext("restore");
25386 __Pyx_TraceCall("restore", __pyx_f[0], 2723);
25387 __pyx_self = __pyx_self;
25389 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2725
25390 * def restore(self):
25391 * '''restore previous output stream'''
25392 * if self.streams: # <<<<<<<<<<<<<<
25393 * # the following was not sufficient, hence flush both stderr and stdout
25394 * # os.fsync( self.id )
25396 __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__streams); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2725; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25397 __Pyx_GOTREF(__pyx_t_1);
25398 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2725; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25399 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25402 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2728
25403 * # the following was not sufficient, hence flush both stderr and stdout
25404 * # os.fsync( self.id )
25405 * sys.stdout.flush() # <<<<<<<<<<<<<<
25406 * sys.stderr.flush()
25407 * os.dup2(self.streams[-1], self.id)
25409 __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__sys); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2728; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25410 __Pyx_GOTREF(__pyx_t_1);
25411 __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__stdout); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2728; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25412 __Pyx_GOTREF(__pyx_t_3);
25413 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25414 __pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__flush); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2728; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25415 __Pyx_GOTREF(__pyx_t_1);
25416 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
25417 __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 = 2728; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25418 __Pyx_GOTREF(__pyx_t_3);
25419 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25420 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
25422 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2729
25423 * # os.fsync( self.id )
25424 * sys.stdout.flush()
25425 * sys.stderr.flush() # <<<<<<<<<<<<<<
25426 * os.dup2(self.streams[-1], self.id)
25427 * os.close(self.streams[-1])
25429 __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__sys); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2729; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25430 __Pyx_GOTREF(__pyx_t_3);
25431 __pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__stderr); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2729; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25432 __Pyx_GOTREF(__pyx_t_1);
25433 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
25434 __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__flush); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2729; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25435 __Pyx_GOTREF(__pyx_t_3);
25436 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25437 __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 = 2729; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25438 __Pyx_GOTREF(__pyx_t_1);
25439 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
25440 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25442 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2730
25443 * sys.stdout.flush()
25444 * sys.stderr.flush()
25445 * os.dup2(self.streams[-1], self.id) # <<<<<<<<<<<<<<
25446 * os.close(self.streams[-1])
25447 * del self.streams[-1]
25449 __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__os); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2730; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25450 __Pyx_GOTREF(__pyx_t_1);
25451 __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__dup2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2730; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25452 __Pyx_GOTREF(__pyx_t_3);
25453 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25454 __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__streams); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2730; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25455 __Pyx_GOTREF(__pyx_t_1);
25456 __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2730; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25457 __Pyx_GOTREF(__pyx_t_4);
25458 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25459 __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__id); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2730; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25460 __Pyx_GOTREF(__pyx_t_1);
25461 __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2730; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25462 __Pyx_GOTREF(__pyx_t_5);
25463 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
25464 __Pyx_GIVEREF(__pyx_t_4);
25465 PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
25466 __Pyx_GIVEREF(__pyx_t_1);
25469 __pyx_t_1 = PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2730; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25470 __Pyx_GOTREF(__pyx_t_1);
25471 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
25472 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
25473 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25475 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2731
25476 * sys.stderr.flush()
25477 * os.dup2(self.streams[-1], self.id)
25478 * os.close(self.streams[-1]) # <<<<<<<<<<<<<<
25479 * del self.streams[-1]
25482 __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__os); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2731; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25483 __Pyx_GOTREF(__pyx_t_1);
25484 __pyx_t_5 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__close); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2731; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25485 __Pyx_GOTREF(__pyx_t_5);
25486 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25487 __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__streams); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2731; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25488 __Pyx_GOTREF(__pyx_t_1);
25489 __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2731; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25490 __Pyx_GOTREF(__pyx_t_3);
25491 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25492 __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2731; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25493 __Pyx_GOTREF(__pyx_t_1);
25494 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
25495 __Pyx_GIVEREF(__pyx_t_3);
25497 __pyx_t_3 = PyObject_Call(__pyx_t_5, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2731; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25498 __Pyx_GOTREF(__pyx_t_3);
25499 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
25500 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25501 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
25503 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2732
25504 * os.dup2(self.streams[-1], self.id)
25505 * os.close(self.streams[-1])
25506 * del self.streams[-1] # <<<<<<<<<<<<<<
25508 * def _samtools_dispatch( method,
25510 __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__streams); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2732; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25511 __Pyx_GOTREF(__pyx_t_3);
25512 if (__Pyx_DelItemInt(__pyx_t_3, -1, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2732; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25513 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
25518 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
25521 __Pyx_XDECREF(__pyx_t_1);
25522 __Pyx_XDECREF(__pyx_t_3);
25523 __Pyx_XDECREF(__pyx_t_4);
25524 __Pyx_XDECREF(__pyx_t_5);
25525 __Pyx_AddTraceback("csamtools.Outs.restore");
25528 __Pyx_XGIVEREF(__pyx_r);
25529 __Pyx_TraceReturn(__pyx_r);
25530 __Pyx_RefNannyFinishContext();
25534 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2734
25535 * del self.streams[-1]
25537 * def _samtools_dispatch( method, # <<<<<<<<<<<<<<
25539 * catch_stdout = True,
25542 static PyObject *__pyx_pf_9csamtools__samtools_dispatch(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
25543 static char __pyx_doc_9csamtools__samtools_dispatch[] = "_samtools_dispatch(method, args=(), catch_stdout=True, catch_stderr=False)\ncall ``method`` in samtools providing arguments in args.\n \n .. note:: \n This method redirects stdout and stderr to capture it \n from samtools. If for some reason stdout/stderr disappears\n the reason might be in this method.\n\n .. note::\n The current implementation might only work on linux.\n \n .. note:: \n This method captures stdout and stderr using temporary files, \n which are then read into memory in their entirety. This method\n is slow and might cause large memory overhead. \n\n See http://bytes.com/topic/c/answers/487231-how-capture-stdout-temporarily\n on the topic of redirecting stderr/stdout.\n ";
25544 static PyObject *__pyx_pf_9csamtools__samtools_dispatch(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
25545 PyObject *__pyx_v_method = 0;
25546 PyObject *__pyx_v_args = 0;
25547 PyObject *__pyx_v_catch_stdout = 0;
25548 PyObject *__pyx_v_catch_stderr = 0;
25549 PyObject *__pyx_v_stderr_h;
25550 PyObject *__pyx_v_stderr_f;
25551 PyObject *__pyx_v_stderr_save;
25552 PyObject *__pyx_v_stdout_h;
25553 PyObject *__pyx_v_stdout_f;
25554 PyObject *__pyx_v_stdout_save;
25555 char **__pyx_v_cargs;
25558 int __pyx_v_retval;
25559 PyObject *__pyx_v_out_stdout;
25560 PyObject *__pyx_v_out_stderr;
25561 PyObject *__pyx_r = NULL;
25562 PyObject *__pyx_t_1 = NULL;
25564 PyObject *__pyx_t_3 = NULL;
25565 PyObject *__pyx_t_4 = NULL;
25567 PyObject *__pyx_t_6 = NULL;
25568 Py_ssize_t __pyx_t_7;
25571 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__method,&__pyx_n_s__args,&__pyx_n_s__catch_stdout,&__pyx_n_s__catch_stderr,0};
25572 __Pyx_TraceDeclarations
25573 __Pyx_RefNannySetupContext("_samtools_dispatch");
25574 __Pyx_TraceCall("_samtools_dispatch", __pyx_f[0], 2734);
25575 __pyx_self = __pyx_self;
25576 if (unlikely(__pyx_kwds)) {
25577 Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
25578 PyObject* values[4] = {0,0,0,0};
25580 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2735
25582 * def _samtools_dispatch( method,
25583 * args = (), # <<<<<<<<<<<<<<
25584 * catch_stdout = True,
25585 * catch_stderr = False,
25587 values[1] = ((PyObject *)__pyx_empty_tuple);
25588 values[2] = __pyx_k_98;
25589 values[3] = __pyx_k_99;
25590 switch (PyTuple_GET_SIZE(__pyx_args)) {
25591 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
25592 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
25593 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
25594 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
25596 default: goto __pyx_L5_argtuple_error;
25598 switch (PyTuple_GET_SIZE(__pyx_args)) {
25600 values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__method);
25601 if (likely(values[0])) kw_args--;
25602 else goto __pyx_L5_argtuple_error;
25605 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__args);
25606 if (value) { values[1] = value; kw_args--; }
25610 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__catch_stdout);
25611 if (value) { values[2] = value; kw_args--; }
25615 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__catch_stderr);
25616 if (value) { values[3] = value; kw_args--; }
25619 if (unlikely(kw_args > 0)) {
25620 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "_samtools_dispatch") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2734; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
25622 __pyx_v_method = values[0];
25623 __pyx_v_args = values[1];
25624 __pyx_v_catch_stdout = values[2];
25625 __pyx_v_catch_stderr = values[3];
25627 __pyx_v_args = ((PyObject *)__pyx_empty_tuple);
25628 __pyx_v_catch_stdout = __pyx_k_98;
25629 __pyx_v_catch_stderr = __pyx_k_99;
25630 switch (PyTuple_GET_SIZE(__pyx_args)) {
25631 case 4: __pyx_v_catch_stderr = PyTuple_GET_ITEM(__pyx_args, 3);
25632 case 3: __pyx_v_catch_stdout = PyTuple_GET_ITEM(__pyx_args, 2);
25633 case 2: __pyx_v_args = PyTuple_GET_ITEM(__pyx_args, 1);
25634 case 1: __pyx_v_method = PyTuple_GET_ITEM(__pyx_args, 0);
25636 default: goto __pyx_L5_argtuple_error;
25639 goto __pyx_L4_argument_unpacking_done;
25640 __pyx_L5_argtuple_error:;
25641 __Pyx_RaiseArgtupleInvalid("_samtools_dispatch", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2734; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
25643 __Pyx_AddTraceback("csamtools._samtools_dispatch");
25644 __Pyx_RefNannyFinishContext();
25646 __pyx_L4_argument_unpacking_done:;
25647 __Pyx_INCREF(__pyx_v_args);
25648 __pyx_v_stderr_h = Py_None; __Pyx_INCREF(Py_None);
25649 __pyx_v_stderr_f = Py_None; __Pyx_INCREF(Py_None);
25650 __pyx_v_stderr_save = Py_None; __Pyx_INCREF(Py_None);
25651 __pyx_v_stdout_h = Py_None; __Pyx_INCREF(Py_None);
25652 __pyx_v_stdout_f = Py_None; __Pyx_INCREF(Py_None);
25653 __pyx_v_stdout_save = Py_None; __Pyx_INCREF(Py_None);
25654 __pyx_v_out_stdout = Py_None; __Pyx_INCREF(Py_None);
25655 __pyx_v_out_stderr = Py_None; __Pyx_INCREF(Py_None);
25657 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2762
25659 * # some special cases
25660 * if method == "index": # <<<<<<<<<<<<<<
25661 * if not os.path.exists( args[0] ):
25662 * raise IOError( "No such file or directory: '%s'" % args[0] )
25664 __pyx_t_1 = PyObject_RichCompare(__pyx_v_method, ((PyObject *)__pyx_n_s__index), Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2762; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25665 __Pyx_GOTREF(__pyx_t_1);
25666 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2762; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25667 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25670 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2763
25671 * # some special cases
25672 * if method == "index":
25673 * if not os.path.exists( args[0] ): # <<<<<<<<<<<<<<
25674 * raise IOError( "No such file or directory: '%s'" % args[0] )
25677 __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__os); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2763; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25678 __Pyx_GOTREF(__pyx_t_1);
25679 __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__path); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2763; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25680 __Pyx_GOTREF(__pyx_t_3);
25681 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25682 __pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__exists); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2763; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25683 __Pyx_GOTREF(__pyx_t_1);
25684 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
25685 __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_args, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2763; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25686 __Pyx_GOTREF(__pyx_t_3);
25687 __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2763; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25688 __Pyx_GOTREF(__pyx_t_4);
25689 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
25690 __Pyx_GIVEREF(__pyx_t_3);
25692 __pyx_t_3 = PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2763; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25693 __Pyx_GOTREF(__pyx_t_3);
25694 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25695 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
25696 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2763; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25697 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
25698 __pyx_t_5 = (!__pyx_t_2);
25701 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2764
25702 * if method == "index":
25703 * if not os.path.exists( args[0] ):
25704 * raise IOError( "No such file or directory: '%s'" % args[0] ) # <<<<<<<<<<<<<<
25706 * # redirect stderr and stdout to file
25708 __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_args, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2764; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25709 __Pyx_GOTREF(__pyx_t_3);
25710 __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_100), __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2764; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25711 __Pyx_GOTREF(((PyObject *)__pyx_t_4));
25712 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
25713 __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2764; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25714 __Pyx_GOTREF(__pyx_t_3);
25715 PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_4));
25716 __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
25718 __pyx_t_4 = PyObject_Call(__pyx_builtin_IOError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2764; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25719 __Pyx_GOTREF(__pyx_t_4);
25720 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
25721 __Pyx_Raise(__pyx_t_4, 0, 0);
25722 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
25723 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2764; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25731 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2767
25733 * # redirect stderr and stdout to file
25734 * if catch_stderr: # <<<<<<<<<<<<<<
25735 * stderr_h, stderr_f = tempfile.mkstemp()
25736 * stderr_save = Outs( sys.stderr.fileno() )
25738 __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_catch_stderr); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2767; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25741 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2768
25742 * # redirect stderr and stdout to file
25744 * stderr_h, stderr_f = tempfile.mkstemp() # <<<<<<<<<<<<<<
25745 * stderr_save = Outs( sys.stderr.fileno() )
25746 * stderr_save.setfd( stderr_h )
25748 __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__tempfile); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2768; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25749 __Pyx_GOTREF(__pyx_t_4);
25750 __pyx_t_3 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__mkstemp); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2768; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25751 __Pyx_GOTREF(__pyx_t_3);
25752 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
25753 __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 = 2768; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25754 __Pyx_GOTREF(__pyx_t_4);
25755 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
25756 if (PyTuple_CheckExact(__pyx_t_4) && likely(PyTuple_GET_SIZE(__pyx_t_4) == 2)) {
25757 PyObject* tuple = __pyx_t_4;
25758 __pyx_t_3 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_3);
25759 __pyx_t_1 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_1);
25760 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
25761 __Pyx_DECREF(__pyx_v_stderr_h);
25762 __pyx_v_stderr_h = __pyx_t_3;
25764 __Pyx_DECREF(__pyx_v_stderr_f);
25765 __pyx_v_stderr_f = __pyx_t_1;
25768 __pyx_t_6 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2768; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25769 __Pyx_GOTREF(__pyx_t_6);
25770 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
25771 __pyx_t_3 = __Pyx_UnpackItem(__pyx_t_6, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2768; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25772 __Pyx_GOTREF(__pyx_t_3);
25773 __pyx_t_1 = __Pyx_UnpackItem(__pyx_t_6, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2768; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25774 __Pyx_GOTREF(__pyx_t_1);
25775 if (__Pyx_EndUnpack(__pyx_t_6, 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2768; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25776 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
25777 __Pyx_DECREF(__pyx_v_stderr_h);
25778 __pyx_v_stderr_h = __pyx_t_3;
25780 __Pyx_DECREF(__pyx_v_stderr_f);
25781 __pyx_v_stderr_f = __pyx_t_1;
25785 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2769
25787 * stderr_h, stderr_f = tempfile.mkstemp()
25788 * stderr_save = Outs( sys.stderr.fileno() ) # <<<<<<<<<<<<<<
25789 * stderr_save.setfd( stderr_h )
25792 __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__Outs); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2769; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25793 __Pyx_GOTREF(__pyx_t_4);
25794 __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__sys); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2769; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25795 __Pyx_GOTREF(__pyx_t_1);
25796 __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__stderr); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2769; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25797 __Pyx_GOTREF(__pyx_t_3);
25798 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25799 __pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__fileno); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2769; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25800 __Pyx_GOTREF(__pyx_t_1);
25801 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
25802 __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 = 2769; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25803 __Pyx_GOTREF(__pyx_t_3);
25804 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25805 __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2769; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25806 __Pyx_GOTREF(__pyx_t_1);
25807 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
25808 __Pyx_GIVEREF(__pyx_t_3);
25810 __pyx_t_3 = PyObject_Call(__pyx_t_4, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2769; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25811 __Pyx_GOTREF(__pyx_t_3);
25812 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
25813 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25814 __Pyx_DECREF(__pyx_v_stderr_save);
25815 __pyx_v_stderr_save = __pyx_t_3;
25818 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2770
25819 * stderr_h, stderr_f = tempfile.mkstemp()
25820 * stderr_save = Outs( sys.stderr.fileno() )
25821 * stderr_save.setfd( stderr_h ) # <<<<<<<<<<<<<<
25825 __pyx_t_3 = PyObject_GetAttr(__pyx_v_stderr_save, __pyx_n_s__setfd); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25826 __Pyx_GOTREF(__pyx_t_3);
25827 __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25828 __Pyx_GOTREF(__pyx_t_1);
25829 __Pyx_INCREF(__pyx_v_stderr_h);
25830 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_stderr_h);
25831 __Pyx_GIVEREF(__pyx_v_stderr_h);
25832 __pyx_t_4 = PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25833 __Pyx_GOTREF(__pyx_t_4);
25834 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
25835 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25836 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
25841 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2772
25842 * stderr_save.setfd( stderr_h )
25844 * if catch_stdout: # <<<<<<<<<<<<<<
25845 * stdout_h, stdout_f = tempfile.mkstemp()
25846 * stdout_save = Outs( sys.stdout.fileno() )
25848 __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_catch_stdout); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25851 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2773
25854 * stdout_h, stdout_f = tempfile.mkstemp() # <<<<<<<<<<<<<<
25855 * stdout_save = Outs( sys.stdout.fileno() )
25856 * stdout_save.setfd( stdout_h )
25858 __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__tempfile); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25859 __Pyx_GOTREF(__pyx_t_4);
25860 __pyx_t_1 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__mkstemp); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25861 __Pyx_GOTREF(__pyx_t_1);
25862 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
25863 __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25864 __Pyx_GOTREF(__pyx_t_4);
25865 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25866 if (PyTuple_CheckExact(__pyx_t_4) && likely(PyTuple_GET_SIZE(__pyx_t_4) == 2)) {
25867 PyObject* tuple = __pyx_t_4;
25868 __pyx_t_1 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_1);
25869 __pyx_t_3 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_3);
25870 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
25871 __Pyx_DECREF(__pyx_v_stdout_h);
25872 __pyx_v_stdout_h = __pyx_t_1;
25874 __Pyx_DECREF(__pyx_v_stdout_f);
25875 __pyx_v_stdout_f = __pyx_t_3;
25878 __pyx_t_6 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25879 __Pyx_GOTREF(__pyx_t_6);
25880 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
25881 __pyx_t_1 = __Pyx_UnpackItem(__pyx_t_6, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25882 __Pyx_GOTREF(__pyx_t_1);
25883 __pyx_t_3 = __Pyx_UnpackItem(__pyx_t_6, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25884 __Pyx_GOTREF(__pyx_t_3);
25885 if (__Pyx_EndUnpack(__pyx_t_6, 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25886 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
25887 __Pyx_DECREF(__pyx_v_stdout_h);
25888 __pyx_v_stdout_h = __pyx_t_1;
25890 __Pyx_DECREF(__pyx_v_stdout_f);
25891 __pyx_v_stdout_f = __pyx_t_3;
25895 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2774
25897 * stdout_h, stdout_f = tempfile.mkstemp()
25898 * stdout_save = Outs( sys.stdout.fileno() ) # <<<<<<<<<<<<<<
25899 * stdout_save.setfd( stdout_h )
25902 __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__Outs); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2774; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25903 __Pyx_GOTREF(__pyx_t_4);
25904 __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__sys); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2774; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25905 __Pyx_GOTREF(__pyx_t_3);
25906 __pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__stdout); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2774; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25907 __Pyx_GOTREF(__pyx_t_1);
25908 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
25909 __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__fileno); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2774; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25910 __Pyx_GOTREF(__pyx_t_3);
25911 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25912 __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 = 2774; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25913 __Pyx_GOTREF(__pyx_t_1);
25914 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
25915 __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2774; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25916 __Pyx_GOTREF(__pyx_t_3);
25917 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
25918 __Pyx_GIVEREF(__pyx_t_1);
25920 __pyx_t_1 = PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2774; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25921 __Pyx_GOTREF(__pyx_t_1);
25922 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
25923 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
25924 __Pyx_DECREF(__pyx_v_stdout_save);
25925 __pyx_v_stdout_save = __pyx_t_1;
25928 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2775
25929 * stdout_h, stdout_f = tempfile.mkstemp()
25930 * stdout_save = Outs( sys.stdout.fileno() )
25931 * stdout_save.setfd( stdout_h ) # <<<<<<<<<<<<<<
25933 * # patch for `samtools view`
25935 __pyx_t_1 = PyObject_GetAttr(__pyx_v_stdout_save, __pyx_n_s__setfd); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2775; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25936 __Pyx_GOTREF(__pyx_t_1);
25937 __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2775; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25938 __Pyx_GOTREF(__pyx_t_3);
25939 __Pyx_INCREF(__pyx_v_stdout_h);
25940 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_stdout_h);
25941 __Pyx_GIVEREF(__pyx_v_stdout_h);
25942 __pyx_t_4 = PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2775; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25943 __Pyx_GOTREF(__pyx_t_4);
25944 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25945 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
25946 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
25948 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2780
25949 * # samtools `view` closes stdout, from which I can not
25950 * # recover. Thus redirect output to file with -o option.
25951 * if method == "view": # <<<<<<<<<<<<<<
25952 * if "-o" in args: raise ValueError("option -o is forbidden in samtools view")
25953 * args = ( "-o", stdout_f ) + args
25955 __pyx_t_4 = PyObject_RichCompare(__pyx_v_method, ((PyObject *)__pyx_n_s__view), Py_EQ); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2780; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25956 __Pyx_GOTREF(__pyx_t_4);
25957 __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2780; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25958 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
25961 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2781
25962 * # recover. Thus redirect output to file with -o option.
25963 * if method == "view":
25964 * if "-o" in args: raise ValueError("option -o is forbidden in samtools view") # <<<<<<<<<<<<<<
25965 * args = ( "-o", stdout_f ) + args
25968 __pyx_t_5 = ((PySequence_Contains(__pyx_v_args, ((PyObject *)__pyx_kp_s_101)))); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2781; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25970 __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2781; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25971 __Pyx_GOTREF(__pyx_t_4);
25972 __Pyx_INCREF(((PyObject *)__pyx_kp_s_102));
25973 PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_kp_s_102));
25974 __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_102));
25975 __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2781; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25976 __Pyx_GOTREF(__pyx_t_3);
25977 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
25978 __Pyx_Raise(__pyx_t_3, 0, 0);
25979 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
25980 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2781; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25985 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2782
25986 * if method == "view":
25987 * if "-o" in args: raise ValueError("option -o is forbidden in samtools view")
25988 * args = ( "-o", stdout_f ) + args # <<<<<<<<<<<<<<
25992 __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2782; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25993 __Pyx_GOTREF(__pyx_t_3);
25994 __Pyx_INCREF(((PyObject *)__pyx_kp_s_101));
25995 PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_s_101));
25996 __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_101));
25997 __Pyx_INCREF(__pyx_v_stdout_f);
25998 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_stdout_f);
25999 __Pyx_GIVEREF(__pyx_v_stdout_f);
26000 __pyx_t_4 = PyNumber_Add(__pyx_t_3, __pyx_v_args); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2782; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
26001 __Pyx_GOTREF(__pyx_t_4);
26002 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
26003 __Pyx_DECREF(__pyx_v_args);
26004 __pyx_v_args = __pyx_t_4;
26013 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2789
26014 * cdef int i, n, retval
26016 * n = len(args) # <<<<<<<<<<<<<<
26017 * # allocate two more for first (dummy) argument (contains command)
26018 * cargs = <char**>calloc( n+2, sizeof( char *) )
26020 __pyx_t_7 = PyObject_Length(__pyx_v_args); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2789; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
26021 __pyx_v_n = __pyx_t_7;
26023 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2791
26025 * # allocate two more for first (dummy) argument (contains command)
26026 * cargs = <char**>calloc( n+2, sizeof( char *) ) # <<<<<<<<<<<<<<
26027 * cargs[0] = "samtools"
26028 * cargs[1] = method
26030 __pyx_v_cargs = ((char **)calloc((__pyx_v_n + 2), (sizeof(char *))));
26032 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2792
26033 * # allocate two more for first (dummy) argument (contains command)
26034 * cargs = <char**>calloc( n+2, sizeof( char *) )
26035 * cargs[0] = "samtools" # <<<<<<<<<<<<<<
26036 * cargs[1] = method
26037 * for i from 0 <= i < n: cargs[i+2] = args[i]
26039 (__pyx_v_cargs[0]) = __pyx_k__samtools;
26041 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2793
26042 * cargs = <char**>calloc( n+2, sizeof( char *) )
26043 * cargs[0] = "samtools"
26044 * cargs[1] = method # <<<<<<<<<<<<<<
26045 * for i from 0 <= i < n: cargs[i+2] = args[i]
26046 * retval = pysam_dispatch(n+2, cargs)
26048 __pyx_t_8 = PyBytes_AsString(__pyx_v_method); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2793; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
26049 (__pyx_v_cargs[1]) = __pyx_t_8;
26051 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2794
26052 * cargs[0] = "samtools"
26053 * cargs[1] = method
26054 * for i from 0 <= i < n: cargs[i+2] = args[i] # <<<<<<<<<<<<<<
26055 * retval = pysam_dispatch(n+2, cargs)
26058 __pyx_t_9 = __pyx_v_n;
26059 for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_9; __pyx_v_i++) {
26060 __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_args, __pyx_v_i, sizeof(int), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
26061 __Pyx_GOTREF(__pyx_t_4);
26062 __pyx_t_8 = PyBytes_AsString(__pyx_t_4); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
26063 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
26064 (__pyx_v_cargs[(__pyx_v_i + 2)]) = __pyx_t_8;
26067 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2795
26068 * cargs[1] = method
26069 * for i from 0 <= i < n: cargs[i+2] = args[i]
26070 * retval = pysam_dispatch(n+2, cargs) # <<<<<<<<<<<<<<
26074 __pyx_v_retval = pysam_dispatch((__pyx_v_n + 2), __pyx_v_cargs);
26076 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2796
26077 * for i from 0 <= i < n: cargs[i+2] = args[i]
26078 * retval = pysam_dispatch(n+2, cargs)
26079 * free( cargs ) # <<<<<<<<<<<<<<
26081 * # restore stdout/stderr. This will also flush, so
26083 free(__pyx_v_cargs);
26085 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2800
26086 * # restore stdout/stderr. This will also flush, so
26087 * # needs to be before reading back the file contents
26088 * if catch_stdout: # <<<<<<<<<<<<<<
26089 * stdout_save.restore()
26090 * out_stdout = open( stdout_f, "r").readlines()
26092 __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_catch_stdout); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
26095 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2801
26096 * # needs to be before reading back the file contents
26098 * stdout_save.restore() # <<<<<<<<<<<<<<
26099 * out_stdout = open( stdout_f, "r").readlines()
26100 * os.remove( stdout_f )
26102 __pyx_t_4 = PyObject_GetAttr(__pyx_v_stdout_save, __pyx_n_s__restore); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2801; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
26103 __Pyx_GOTREF(__pyx_t_4);
26104 __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 = 2801; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
26105 __Pyx_GOTREF(__pyx_t_3);
26106 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
26107 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
26109 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2802
26111 * stdout_save.restore()
26112 * out_stdout = open( stdout_f, "r").readlines() # <<<<<<<<<<<<<<
26113 * os.remove( stdout_f )
26116 __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
26117 __Pyx_GOTREF(__pyx_t_3);
26118 __Pyx_INCREF(__pyx_v_stdout_f);
26119 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_stdout_f);
26120 __Pyx_GIVEREF(__pyx_v_stdout_f);
26121 __Pyx_INCREF(((PyObject *)__pyx_n_s__r));
26122 PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_n_s__r));
26123 __Pyx_GIVEREF(((PyObject *)__pyx_n_s__r));
26124 __pyx_t_4 = PyObject_Call(__pyx_builtin_open, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
26125 __Pyx_GOTREF(__pyx_t_4);
26126 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
26127 __pyx_t_3 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__readlines); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
26128 __Pyx_GOTREF(__pyx_t_3);
26129 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
26130 __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 = 2802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
26131 __Pyx_GOTREF(__pyx_t_4);
26132 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
26133 __Pyx_DECREF(__pyx_v_out_stdout);
26134 __pyx_v_out_stdout = __pyx_t_4;
26137 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2803
26138 * stdout_save.restore()
26139 * out_stdout = open( stdout_f, "r").readlines()
26140 * os.remove( stdout_f ) # <<<<<<<<<<<<<<
26144 __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__os); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
26145 __Pyx_GOTREF(__pyx_t_4);
26146 __pyx_t_3 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__remove); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
26147 __Pyx_GOTREF(__pyx_t_3);
26148 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
26149 __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
26150 __Pyx_GOTREF(__pyx_t_4);
26151 __Pyx_INCREF(__pyx_v_stdout_f);
26152 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_stdout_f);
26153 __Pyx_GIVEREF(__pyx_v_stdout_f);
26154 __pyx_t_1 = PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
26155 __Pyx_GOTREF(__pyx_t_1);
26156 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
26157 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
26158 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
26163 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2805
26164 * os.remove( stdout_f )
26166 * out_stdout = [] # <<<<<<<<<<<<<<
26170 __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2805; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
26171 __Pyx_GOTREF(((PyObject *)__pyx_t_1));
26172 __Pyx_DECREF(__pyx_v_out_stdout);
26173 __pyx_v_out_stdout = ((PyObject *)__pyx_t_1);
26178 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2807
26181 * if catch_stderr: # <<<<<<<<<<<<<<
26182 * stderr_save.restore()
26183 * out_stderr = open( stderr_f, "r").readlines()
26185 __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_catch_stderr); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2807; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
26188 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2808
26191 * stderr_save.restore() # <<<<<<<<<<<<<<
26192 * out_stderr = open( stderr_f, "r").readlines()
26193 * os.remove( stderr_f )
26195 __pyx_t_1 = PyObject_GetAttr(__pyx_v_stderr_save, __pyx_n_s__restore); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
26196 __Pyx_GOTREF(__pyx_t_1);
26197 __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
26198 __Pyx_GOTREF(__pyx_t_4);
26199 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
26200 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
26202 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2809
26204 * stderr_save.restore()
26205 * out_stderr = open( stderr_f, "r").readlines() # <<<<<<<<<<<<<<
26206 * os.remove( stderr_f )
26209 __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2809; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
26210 __Pyx_GOTREF(__pyx_t_4);
26211 __Pyx_INCREF(__pyx_v_stderr_f);
26212 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_stderr_f);
26213 __Pyx_GIVEREF(__pyx_v_stderr_f);
26214 __Pyx_INCREF(((PyObject *)__pyx_n_s__r));
26215 PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_n_s__r));
26216 __Pyx_GIVEREF(((PyObject *)__pyx_n_s__r));
26217 __pyx_t_1 = PyObject_Call(__pyx_builtin_open, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2809; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
26218 __Pyx_GOTREF(__pyx_t_1);
26219 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
26220 __pyx_t_4 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__readlines); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2809; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
26221 __Pyx_GOTREF(__pyx_t_4);
26222 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
26223 __pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2809; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
26224 __Pyx_GOTREF(__pyx_t_1);
26225 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
26226 __Pyx_DECREF(__pyx_v_out_stderr);
26227 __pyx_v_out_stderr = __pyx_t_1;
26230 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2810
26231 * stderr_save.restore()
26232 * out_stderr = open( stderr_f, "r").readlines()
26233 * os.remove( stderr_f ) # <<<<<<<<<<<<<<
26237 __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__os); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2810; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
26238 __Pyx_GOTREF(__pyx_t_1);
26239 __pyx_t_4 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__remove); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2810; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
26240 __Pyx_GOTREF(__pyx_t_4);
26241 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
26242 __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2810; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
26243 __Pyx_GOTREF(__pyx_t_1);
26244 __Pyx_INCREF(__pyx_v_stderr_f);
26245 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_stderr_f);
26246 __Pyx_GIVEREF(__pyx_v_stderr_f);
26247 __pyx_t_3 = PyObject_Call(__pyx_t_4, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2810; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
26248 __Pyx_GOTREF(__pyx_t_3);
26249 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
26250 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
26251 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
26256 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2812
26257 * os.remove( stderr_f )
26259 * out_stderr = [] # <<<<<<<<<<<<<<
26261 * return retval, out_stderr, out_stdout
26263 __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2812; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
26264 __Pyx_GOTREF(((PyObject *)__pyx_t_3));
26265 __Pyx_DECREF(__pyx_v_out_stderr);
26266 __pyx_v_out_stderr = ((PyObject *)__pyx_t_3);
26271 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2814
26274 * return retval, out_stderr, out_stdout # <<<<<<<<<<<<<<
26276 * cdef class SNPCall:
26278 __Pyx_XDECREF(__pyx_r);
26279 __pyx_t_3 = PyInt_FromLong(__pyx_v_retval); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2814; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
26280 __Pyx_GOTREF(__pyx_t_3);
26281 __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2814; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
26282 __Pyx_GOTREF(__pyx_t_1);
26283 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
26284 __Pyx_GIVEREF(__pyx_t_3);
26285 __Pyx_INCREF(__pyx_v_out_stderr);
26286 PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_out_stderr);
26287 __Pyx_GIVEREF(__pyx_v_out_stderr);
26288 __Pyx_INCREF(__pyx_v_out_stdout);
26289 PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_out_stdout);
26290 __Pyx_GIVEREF(__pyx_v_out_stdout);
26292 __pyx_r = __pyx_t_1;
26296 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
26299 __Pyx_XDECREF(__pyx_t_1);
26300 __Pyx_XDECREF(__pyx_t_3);
26301 __Pyx_XDECREF(__pyx_t_4);
26302 __Pyx_XDECREF(__pyx_t_6);
26303 __Pyx_AddTraceback("csamtools._samtools_dispatch");
26306 __Pyx_DECREF(__pyx_v_stderr_h);
26307 __Pyx_DECREF(__pyx_v_stderr_f);
26308 __Pyx_DECREF(__pyx_v_stderr_save);
26309 __Pyx_DECREF(__pyx_v_stdout_h);
26310 __Pyx_DECREF(__pyx_v_stdout_f);
26311 __Pyx_DECREF(__pyx_v_stdout_save);
26312 __Pyx_DECREF(__pyx_v_out_stdout);
26313 __Pyx_DECREF(__pyx_v_out_stderr);
26314 __Pyx_DECREF(__pyx_v_args);
26315 __Pyx_XGIVEREF(__pyx_r);
26316 __Pyx_TraceReturn(__pyx_r);
26317 __Pyx_RefNannyFinishContext();
26321 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2829
26323 * '''the chromosome ID as is defined in the header'''
26324 * def __get__(self): # <<<<<<<<<<<<<<
26329 static PyObject *__pyx_pf_9csamtools_7SNPCall_3tid___get__(PyObject *__pyx_v_self); /*proto*/
26330 static PyObject *__pyx_pf_9csamtools_7SNPCall_3tid___get__(PyObject *__pyx_v_self) {
26331 PyObject *__pyx_r = NULL;
26332 PyObject *__pyx_t_1 = NULL;
26333 __Pyx_TraceDeclarations
26334 __Pyx_RefNannySetupContext("__get__");
26335 __Pyx_TraceCall("__get__", __pyx_f[0], 2829);
26337 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2830
26338 * '''the chromosome ID as is defined in the header'''
26339 * def __get__(self):
26340 * return self._tid # <<<<<<<<<<<<<<
26344 __Pyx_XDECREF(__pyx_r);
26345 __pyx_t_1 = PyInt_FromLong(((struct __pyx_obj_9csamtools_SNPCall *)__pyx_v_self)->_tid); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
26346 __Pyx_GOTREF(__pyx_t_1);
26347 __pyx_r = __pyx_t_1;
26351 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
26354 __Pyx_XDECREF(__pyx_t_1);
26355 __Pyx_AddTraceback("csamtools.SNPCall.tid.__get__");
26358 __Pyx_XGIVEREF(__pyx_r);
26359 __Pyx_TraceReturn(__pyx_r);
26360 __Pyx_RefNannyFinishContext();
26364 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2834
26366 * '''nucleotide position of SNP.'''
26367 * def __get__(self): return self._pos # <<<<<<<<<<<<<<
26369 * property reference_base:
26372 static PyObject *__pyx_pf_9csamtools_7SNPCall_3pos___get__(PyObject *__pyx_v_self); /*proto*/
26373 static PyObject *__pyx_pf_9csamtools_7SNPCall_3pos___get__(PyObject *__pyx_v_self) {
26374 PyObject *__pyx_r = NULL;
26375 PyObject *__pyx_t_1 = NULL;
26376 __Pyx_TraceDeclarations
26377 __Pyx_RefNannySetupContext("__get__");
26378 __Pyx_TraceCall("__get__", __pyx_f[0], 2834);
26379 __Pyx_XDECREF(__pyx_r);
26380 __pyx_t_1 = PyInt_FromLong(((struct __pyx_obj_9csamtools_SNPCall *)__pyx_v_self)->_pos); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
26381 __Pyx_GOTREF(__pyx_t_1);
26382 __pyx_r = __pyx_t_1;
26386 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
26389 __Pyx_XDECREF(__pyx_t_1);
26390 __Pyx_AddTraceback("csamtools.SNPCall.pos.__get__");
26393 __Pyx_XGIVEREF(__pyx_r);
26394 __Pyx_TraceReturn(__pyx_r);
26395 __Pyx_RefNannyFinishContext();
26399 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2838
26400 * property reference_base:
26401 * '''reference base at pos. ``N`` if no reference sequence supplied.'''
26402 * def __get__(self): return PyString_FromStringAndSize( &self._reference_base, 1 ) # <<<<<<<<<<<<<<
26404 * property genotype:
26407 static PyObject *__pyx_pf_9csamtools_7SNPCall_14reference_base___get__(PyObject *__pyx_v_self); /*proto*/
26408 static PyObject *__pyx_pf_9csamtools_7SNPCall_14reference_base___get__(PyObject *__pyx_v_self) {
26409 PyObject *__pyx_r = NULL;
26410 PyObject *__pyx_t_1 = NULL;
26411 __Pyx_TraceDeclarations
26412 __Pyx_RefNannySetupContext("__get__");
26413 __Pyx_TraceCall("__get__", __pyx_f[0], 2838);
26414 __Pyx_XDECREF(__pyx_r);
26415 __pyx_t_1 = PyString_FromStringAndSize((&((struct __pyx_obj_9csamtools_SNPCall *)__pyx_v_self)->_reference_base), 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
26416 __Pyx_GOTREF(__pyx_t_1);
26417 __pyx_r = __pyx_t_1;
26421 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
26424 __Pyx_XDECREF(__pyx_t_1);
26425 __Pyx_AddTraceback("csamtools.SNPCall.reference_base.__get__");
26428 __Pyx_XGIVEREF(__pyx_r);
26429 __Pyx_TraceReturn(__pyx_r);
26430 __Pyx_RefNannyFinishContext();
26434 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2842
26435 * property genotype:
26436 * '''the genotype called.'''
26437 * def __get__(self): return PyString_FromStringAndSize( &self._genotype, 1 ) # <<<<<<<<<<<<<<
26439 * property consensus_quality:
26442 static PyObject *__pyx_pf_9csamtools_7SNPCall_8genotype___get__(PyObject *__pyx_v_self); /*proto*/
26443 static PyObject *__pyx_pf_9csamtools_7SNPCall_8genotype___get__(PyObject *__pyx_v_self) {
26444 PyObject *__pyx_r = NULL;
26445 PyObject *__pyx_t_1 = NULL;
26446 __Pyx_TraceDeclarations
26447 __Pyx_RefNannySetupContext("__get__");
26448 __Pyx_TraceCall("__get__", __pyx_f[0], 2842);
26449 __Pyx_XDECREF(__pyx_r);
26450 __pyx_t_1 = PyString_FromStringAndSize((&((struct __pyx_obj_9csamtools_SNPCall *)__pyx_v_self)->_genotype), 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
26451 __Pyx_GOTREF(__pyx_t_1);
26452 __pyx_r = __pyx_t_1;
26456 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
26459 __Pyx_XDECREF(__pyx_t_1);
26460 __Pyx_AddTraceback("csamtools.SNPCall.genotype.__get__");
26463 __Pyx_XGIVEREF(__pyx_r);
26464 __Pyx_TraceReturn(__pyx_r);
26465 __Pyx_RefNannyFinishContext();
26469 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2846
26470 * property consensus_quality:
26471 * '''the genotype quality (Phred-scaled).'''
26472 * def __get__(self): return self._consensus_quality # <<<<<<<<<<<<<<
26474 * property snp_quality:
26477 static PyObject *__pyx_pf_9csamtools_7SNPCall_17consensus_quality___get__(PyObject *__pyx_v_self); /*proto*/
26478 static PyObject *__pyx_pf_9csamtools_7SNPCall_17consensus_quality___get__(PyObject *__pyx_v_self) {
26479 PyObject *__pyx_r = NULL;
26480 PyObject *__pyx_t_1 = NULL;
26481 __Pyx_TraceDeclarations
26482 __Pyx_RefNannySetupContext("__get__");
26483 __Pyx_TraceCall("__get__", __pyx_f[0], 2846);
26484 __Pyx_XDECREF(__pyx_r);
26485 __pyx_t_1 = PyInt_FromLong(((struct __pyx_obj_9csamtools_SNPCall *)__pyx_v_self)->_consensus_quality); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2846; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
26486 __Pyx_GOTREF(__pyx_t_1);
26487 __pyx_r = __pyx_t_1;
26491 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
26494 __Pyx_XDECREF(__pyx_t_1);
26495 __Pyx_AddTraceback("csamtools.SNPCall.consensus_quality.__get__");
26498 __Pyx_XGIVEREF(__pyx_r);
26499 __Pyx_TraceReturn(__pyx_r);
26500 __Pyx_RefNannyFinishContext();
26504 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2850
26505 * property snp_quality:
26506 * '''the snp quality (Phred scaled) - probability of consensus being identical to reference sequence.'''
26507 * def __get__(self): return self._snp_quality # <<<<<<<<<<<<<<
26509 * property mapping_quality:
26512 static PyObject *__pyx_pf_9csamtools_7SNPCall_11snp_quality___get__(PyObject *__pyx_v_self); /*proto*/
26513 static PyObject *__pyx_pf_9csamtools_7SNPCall_11snp_quality___get__(PyObject *__pyx_v_self) {
26514 PyObject *__pyx_r = NULL;
26515 PyObject *__pyx_t_1 = NULL;
26516 __Pyx_TraceDeclarations
26517 __Pyx_RefNannySetupContext("__get__");
26518 __Pyx_TraceCall("__get__", __pyx_f[0], 2850);
26519 __Pyx_XDECREF(__pyx_r);
26520 __pyx_t_1 = PyInt_FromLong(((struct __pyx_obj_9csamtools_SNPCall *)__pyx_v_self)->_snp_quality); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2850; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
26521 __Pyx_GOTREF(__pyx_t_1);
26522 __pyx_r = __pyx_t_1;
26526 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
26529 __Pyx_XDECREF(__pyx_t_1);
26530 __Pyx_AddTraceback("csamtools.SNPCall.snp_quality.__get__");
26533 __Pyx_XGIVEREF(__pyx_r);
26534 __Pyx_TraceReturn(__pyx_r);
26535 __Pyx_RefNannyFinishContext();
26539 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2854
26540 * property mapping_quality:
26541 * '''the root mean square (rms) of the mapping quality of all reads involved in the call.'''
26542 * def __get__(self): return self._rms_mapping_quality # <<<<<<<<<<<<<<
26544 * property coverage:
26547 static PyObject *__pyx_pf_9csamtools_7SNPCall_15mapping_quality___get__(PyObject *__pyx_v_self); /*proto*/
26548 static PyObject *__pyx_pf_9csamtools_7SNPCall_15mapping_quality___get__(PyObject *__pyx_v_self) {
26549 PyObject *__pyx_r = NULL;
26550 PyObject *__pyx_t_1 = NULL;
26551 __Pyx_TraceDeclarations
26552 __Pyx_RefNannySetupContext("__get__");
26553 __Pyx_TraceCall("__get__", __pyx_f[0], 2854);
26554 __Pyx_XDECREF(__pyx_r);
26555 __pyx_t_1 = PyInt_FromLong(((struct __pyx_obj_9csamtools_SNPCall *)__pyx_v_self)->_rms_mapping_quality); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2854; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
26556 __Pyx_GOTREF(__pyx_t_1);
26557 __pyx_r = __pyx_t_1;
26561 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
26564 __Pyx_XDECREF(__pyx_t_1);
26565 __Pyx_AddTraceback("csamtools.SNPCall.mapping_quality.__get__");
26568 __Pyx_XGIVEREF(__pyx_r);
26569 __Pyx_TraceReturn(__pyx_r);
26570 __Pyx_RefNannyFinishContext();
26574 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2858
26575 * property coverage:
26576 * '''coverage or read depth - the number of reads involved in the call.'''
26577 * def __get__(self): return self._coverage # <<<<<<<<<<<<<<
26579 * def __str__(self):
26582 static PyObject *__pyx_pf_9csamtools_7SNPCall_8coverage___get__(PyObject *__pyx_v_self); /*proto*/
26583 static PyObject *__pyx_pf_9csamtools_7SNPCall_8coverage___get__(PyObject *__pyx_v_self) {
26584 PyObject *__pyx_r = NULL;
26585 PyObject *__pyx_t_1 = NULL;
26586 __Pyx_TraceDeclarations
26587 __Pyx_RefNannySetupContext("__get__");
26588 __Pyx_TraceCall("__get__", __pyx_f[0], 2858);
26589 __Pyx_XDECREF(__pyx_r);
26590 __pyx_t_1 = PyInt_FromLong(((struct __pyx_obj_9csamtools_SNPCall *)__pyx_v_self)->_coverage); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2858; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
26591 __Pyx_GOTREF(__pyx_t_1);
26592 __pyx_r = __pyx_t_1;
26596 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
26599 __Pyx_XDECREF(__pyx_t_1);
26600 __Pyx_AddTraceback("csamtools.SNPCall.coverage.__get__");
26603 __Pyx_XGIVEREF(__pyx_r);
26604 __Pyx_TraceReturn(__pyx_r);
26605 __Pyx_RefNannyFinishContext();
26609 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2860
26610 * def __get__(self): return self._coverage
26612 * def __str__(self): # <<<<<<<<<<<<<<
26614 * return "\t".join( map(str, (
26617 static PyObject *__pyx_pf_9csamtools_7SNPCall___str__(PyObject *__pyx_v_self); /*proto*/
26618 static PyObject *__pyx_pf_9csamtools_7SNPCall___str__(PyObject *__pyx_v_self) {
26619 PyObject *__pyx_r = NULL;
26620 PyObject *__pyx_t_1 = NULL;
26621 PyObject *__pyx_t_2 = NULL;
26622 PyObject *__pyx_t_3 = NULL;
26623 PyObject *__pyx_t_4 = NULL;
26624 PyObject *__pyx_t_5 = NULL;
26625 PyObject *__pyx_t_6 = NULL;
26626 PyObject *__pyx_t_7 = NULL;
26627 PyObject *__pyx_t_8 = NULL;
26628 PyObject *__pyx_t_9 = NULL;
26629 PyObject *__pyx_t_10 = NULL;
26630 __Pyx_TraceDeclarations
26631 __Pyx_RefNannySetupContext("__str__");
26632 __Pyx_TraceCall("__str__", __pyx_f[0], 2860);
26634 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2862
26635 * def __str__(self):
26637 * return "\t".join( map(str, ( # <<<<<<<<<<<<<<
26641 __Pyx_XDECREF(__pyx_r);
26642 __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 = 2862; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
26643 __Pyx_GOTREF(__pyx_t_1);
26645 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2863
26647 * return "\t".join( map(str, (
26648 * self.tid, # <<<<<<<<<<<<<<
26650 * self.reference_base,
26652 __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__tid); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2863; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
26653 __Pyx_GOTREF(__pyx_t_2);
26655 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2864
26656 * return "\t".join( map(str, (
26658 * self.pos, # <<<<<<<<<<<<<<
26659 * self.reference_base,
26662 __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__pos); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2864; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
26663 __Pyx_GOTREF(__pyx_t_3);
26665 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2865
26668 * self.reference_base, # <<<<<<<<<<<<<<
26670 * self.consensus_quality,
26672 __pyx_t_4 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__reference_base); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2865; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
26673 __Pyx_GOTREF(__pyx_t_4);
26675 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2866
26677 * self.reference_base,
26678 * self.genotype, # <<<<<<<<<<<<<<
26679 * self.consensus_quality,
26680 * self.snp_quality,
26682 __pyx_t_5 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__genotype); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2866; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
26683 __Pyx_GOTREF(__pyx_t_5);
26685 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2867
26686 * self.reference_base,
26688 * self.consensus_quality, # <<<<<<<<<<<<<<
26689 * self.snp_quality,
26690 * self.mapping_quality,
26692 __pyx_t_6 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__consensus_quality); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2867; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
26693 __Pyx_GOTREF(__pyx_t_6);
26695 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2868
26697 * self.consensus_quality,
26698 * self.snp_quality, # <<<<<<<<<<<<<<
26699 * self.mapping_quality,
26700 * self.coverage ) ) )
26702 __pyx_t_7 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__snp_quality); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2868; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
26703 __Pyx_GOTREF(__pyx_t_7);
26705 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2869
26706 * self.consensus_quality,
26707 * self.snp_quality,
26708 * self.mapping_quality, # <<<<<<<<<<<<<<
26709 * self.coverage ) ) )
26712 __pyx_t_8 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__mapping_quality); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2869; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
26713 __Pyx_GOTREF(__pyx_t_8);
26715 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2870
26716 * self.snp_quality,
26717 * self.mapping_quality,
26718 * self.coverage ) ) ) # <<<<<<<<<<<<<<
26722 __pyx_t_9 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__coverage); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
26723 __Pyx_GOTREF(__pyx_t_9);
26724 __pyx_t_10 = PyTuple_New(8); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2863; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
26725 __Pyx_GOTREF(__pyx_t_10);
26726 PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_2);
26727 __Pyx_GIVEREF(__pyx_t_2);
26728 PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_3);
26729 __Pyx_GIVEREF(__pyx_t_3);
26730 PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_t_4);
26731 __Pyx_GIVEREF(__pyx_t_4);
26732 PyTuple_SET_ITEM(__pyx_t_10, 3, __pyx_t_5);
26733 __Pyx_GIVEREF(__pyx_t_5);
26734 PyTuple_SET_ITEM(__pyx_t_10, 4, __pyx_t_6);
26735 __Pyx_GIVEREF(__pyx_t_6);
26736 PyTuple_SET_ITEM(__pyx_t_10, 5, __pyx_t_7);
26737 __Pyx_GIVEREF(__pyx_t_7);
26738 PyTuple_SET_ITEM(__pyx_t_10, 6, __pyx_t_8);
26739 __Pyx_GIVEREF(__pyx_t_8);
26740 PyTuple_SET_ITEM(__pyx_t_10, 7, __pyx_t_9);
26741 __Pyx_GIVEREF(__pyx_t_9);
26750 __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2862; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
26751 __Pyx_GOTREF(__pyx_t_9);
26752 __Pyx_INCREF(((PyObject *)((PyObject*)&PyString_Type)));
26753 PyTuple_SET_ITEM(__pyx_t_9, 0, ((PyObject *)((PyObject*)&PyString_Type)));
26754 __Pyx_GIVEREF(((PyObject *)((PyObject*)&PyString_Type)));
26755 PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_10);
26756 __Pyx_GIVEREF(__pyx_t_10);
26758 __pyx_t_10 = PyObject_Call(__pyx_builtin_map, __pyx_t_9, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2862; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
26759 __Pyx_GOTREF(__pyx_t_10);
26760 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
26761 __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2862; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
26762 __Pyx_GOTREF(__pyx_t_9);
26763 PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_10);
26764 __Pyx_GIVEREF(__pyx_t_10);
26766 __pyx_t_10 = PyObject_Call(__pyx_t_1, __pyx_t_9, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2862; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
26767 __Pyx_GOTREF(__pyx_t_10);
26768 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
26769 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
26770 __pyx_r = __pyx_t_10;
26774 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
26777 __Pyx_XDECREF(__pyx_t_1);
26778 __Pyx_XDECREF(__pyx_t_2);
26779 __Pyx_XDECREF(__pyx_t_3);
26780 __Pyx_XDECREF(__pyx_t_4);
26781 __Pyx_XDECREF(__pyx_t_5);
26782 __Pyx_XDECREF(__pyx_t_6);
26783 __Pyx_XDECREF(__pyx_t_7);
26784 __Pyx_XDECREF(__pyx_t_8);
26785 __Pyx_XDECREF(__pyx_t_9);
26786 __Pyx_XDECREF(__pyx_t_10);
26787 __Pyx_AddTraceback("csamtools.SNPCall.__str__");
26790 __Pyx_XGIVEREF(__pyx_r);
26791 __Pyx_TraceReturn(__pyx_r);
26792 __Pyx_RefNannyFinishContext();
26796 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2891
26797 * cdef IteratorColumn iter
26799 * def __cinit__(self, # <<<<<<<<<<<<<<
26800 * IteratorColumn iterator_column,
26804 static int __pyx_pf_9csamtools_13SNPCallerBase___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
26805 static int __pyx_pf_9csamtools_13SNPCallerBase___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
26806 struct __pyx_obj_9csamtools_IteratorColumn *__pyx_v_iterator_column = 0;
26807 PyObject *__pyx_v_kwargs = 0;
26809 PyObject *__pyx_t_1 = NULL;
26810 PyObject *__pyx_t_2 = NULL;
26814 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__iterator_column,0};
26815 __Pyx_TraceDeclarations
26816 __Pyx_RefNannySetupContext("__cinit__");
26817 __Pyx_TraceCall("__cinit__", __pyx_f[0], 2891);
26818 __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return -1;
26819 __Pyx_GOTREF(__pyx_v_kwargs);
26820 if (unlikely(__pyx_kwds)) {
26821 Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
26822 PyObject* values[1] = {0};
26823 switch (PyTuple_GET_SIZE(__pyx_args)) {
26824 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
26826 default: goto __pyx_L5_argtuple_error;
26828 switch (PyTuple_GET_SIZE(__pyx_args)) {
26830 values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__iterator_column);
26831 if (likely(values[0])) kw_args--;
26832 else goto __pyx_L5_argtuple_error;
26834 if (unlikely(kw_args > 0)) {
26835 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, PyTuple_GET_SIZE(__pyx_args), "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2891; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
26837 __pyx_v_iterator_column = ((struct __pyx_obj_9csamtools_IteratorColumn *)values[0]);
26838 } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
26839 goto __pyx_L5_argtuple_error;
26841 __pyx_v_iterator_column = ((struct __pyx_obj_9csamtools_IteratorColumn *)PyTuple_GET_ITEM(__pyx_args, 0));
26843 goto __pyx_L4_argument_unpacking_done;
26844 __pyx_L5_argtuple_error:;
26845 __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2891; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
26847 __Pyx_DECREF(__pyx_v_kwargs);
26848 __Pyx_AddTraceback("csamtools.SNPCallerBase.__cinit__");
26849 __Pyx_RefNannyFinishContext();
26851 __pyx_L4_argument_unpacking_done:;
26852 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_iterator_column), __pyx_ptype_9csamtools_IteratorColumn, 1, "iterator_column", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2892; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
26854 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2895
26857 * self.iter = iterator_column # <<<<<<<<<<<<<<
26858 * self.c = bam_maqcns_init()
26861 __Pyx_INCREF(((PyObject *)__pyx_v_iterator_column));
26862 __Pyx_GIVEREF(((PyObject *)__pyx_v_iterator_column));
26863 __Pyx_GOTREF(((struct __pyx_obj_9csamtools_SNPCallerBase *)__pyx_v_self)->iter);
26864 __Pyx_DECREF(((PyObject *)((struct __pyx_obj_9csamtools_SNPCallerBase *)__pyx_v_self)->iter));
26865 ((struct __pyx_obj_9csamtools_SNPCallerBase *)__pyx_v_self)->iter = __pyx_v_iterator_column;
26867 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2896
26869 * self.iter = iterator_column
26870 * self.c = bam_maqcns_init() # <<<<<<<<<<<<<<
26872 * # set the default parameterization according to
26874 ((struct __pyx_obj_9csamtools_SNPCallerBase *)__pyx_v_self)->c = bam_maqcns_init();
26876 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2902
26878 * # new default mode for samtools >0.1.10
26879 * self.c.errmod = kwargs.get( "errmod", BAM_ERRMOD_MAQ2 ) # <<<<<<<<<<<<<<
26881 * self.c.min_baseQ = kwargs.get( "min_baseQ", 13 )
26883 if (unlikely(__pyx_v_kwargs == Py_None)) {
26884 PyErr_SetString(PyExc_AttributeError, "'NoneType' object has no attribute 'get'"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2902; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
26886 __pyx_t_1 = PyInt_FromLong(BAM_ERRMOD_MAQ2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2902; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
26887 __Pyx_GOTREF(__pyx_t_1);
26888 __pyx_t_2 = __Pyx_PyDict_GetItemDefault(((PyObject *)__pyx_v_kwargs), ((PyObject *)__pyx_n_s__errmod), __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2902; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
26889 __Pyx_GOTREF(__pyx_t_2);
26890 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
26891 __pyx_t_3 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2902; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
26892 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
26893 ((struct __pyx_obj_9csamtools_SNPCallerBase *)__pyx_v_self)->c->errmod = __pyx_t_3;
26895 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2904
26896 * self.c.errmod = kwargs.get( "errmod", BAM_ERRMOD_MAQ2 )
26898 * self.c.min_baseQ = kwargs.get( "min_baseQ", 13 ) # <<<<<<<<<<<<<<
26899 * # self.c.capQ_thres = kwargs.get( "capQ_threshold", 60 )
26900 * self.c.n_hap = kwargs.get( "n_haplotypes", 2 )
26902 if (unlikely(__pyx_v_kwargs == Py_None)) {
26903 PyErr_SetString(PyExc_AttributeError, "'NoneType' object has no attribute 'get'"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2904; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
26905 __pyx_t_2 = __Pyx_PyDict_GetItemDefault(((PyObject *)__pyx_v_kwargs), ((PyObject *)__pyx_n_s__min_baseQ), __pyx_int_13); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2904; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
26906 __Pyx_GOTREF(__pyx_t_2);
26907 __pyx_t_3 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2904; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
26908 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
26909 ((struct __pyx_obj_9csamtools_SNPCallerBase *)__pyx_v_self)->c->min_baseQ = __pyx_t_3;
26911 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2906
26912 * self.c.min_baseQ = kwargs.get( "min_baseQ", 13 )
26913 * # self.c.capQ_thres = kwargs.get( "capQ_threshold", 60 )
26914 * self.c.n_hap = kwargs.get( "n_haplotypes", 2 ) # <<<<<<<<<<<<<<
26915 * self.c.het_rate = kwargs.get( "het_rate", 0.001 )
26916 * self.c.theta = kwargs.get( "theta", 0.83 )
26918 if (unlikely(__pyx_v_kwargs == Py_None)) {
26919 PyErr_SetString(PyExc_AttributeError, "'NoneType' object has no attribute 'get'"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2906; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
26921 __pyx_t_2 = __Pyx_PyDict_GetItemDefault(((PyObject *)__pyx_v_kwargs), ((PyObject *)__pyx_n_s__n_haplotypes), __pyx_int_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2906; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
26922 __Pyx_GOTREF(__pyx_t_2);
26923 __pyx_t_3 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2906; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
26924 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
26925 ((struct __pyx_obj_9csamtools_SNPCallerBase *)__pyx_v_self)->c->n_hap = __pyx_t_3;
26927 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2907
26928 * # self.c.capQ_thres = kwargs.get( "capQ_threshold", 60 )
26929 * self.c.n_hap = kwargs.get( "n_haplotypes", 2 )
26930 * self.c.het_rate = kwargs.get( "het_rate", 0.001 ) # <<<<<<<<<<<<<<
26931 * self.c.theta = kwargs.get( "theta", 0.83 )
26934 if (unlikely(__pyx_v_kwargs == Py_None)) {
26935 PyErr_SetString(PyExc_AttributeError, "'NoneType' object has no attribute 'get'"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2907; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
26937 __pyx_t_2 = PyFloat_FromDouble(0.001); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2907; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
26938 __Pyx_GOTREF(__pyx_t_2);
26939 __pyx_t_1 = __Pyx_PyDict_GetItemDefault(((PyObject *)__pyx_v_kwargs), ((PyObject *)__pyx_n_s__het_rate), __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2907; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
26940 __Pyx_GOTREF(__pyx_t_1);
26941 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
26942 __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_4 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2907; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
26943 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
26944 ((struct __pyx_obj_9csamtools_SNPCallerBase *)__pyx_v_self)->c->het_rate = __pyx_t_4;
26946 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2908
26947 * self.c.n_hap = kwargs.get( "n_haplotypes", 2 )
26948 * self.c.het_rate = kwargs.get( "het_rate", 0.001 )
26949 * self.c.theta = kwargs.get( "theta", 0.83 ) # <<<<<<<<<<<<<<
26951 * if self.c.errmod != BAM_ERRMOD_MAQ2:
26953 if (unlikely(__pyx_v_kwargs == Py_None)) {
26954 PyErr_SetString(PyExc_AttributeError, "'NoneType' object has no attribute 'get'"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2908; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
26956 __pyx_t_1 = PyFloat_FromDouble(0.83); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2908; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
26957 __Pyx_GOTREF(__pyx_t_1);
26958 __pyx_t_2 = __Pyx_PyDict_GetItemDefault(((PyObject *)__pyx_v_kwargs), ((PyObject *)__pyx_n_s__theta), __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2908; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
26959 __Pyx_GOTREF(__pyx_t_2);
26960 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
26961 __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_4 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2908; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
26962 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
26963 ((struct __pyx_obj_9csamtools_SNPCallerBase *)__pyx_v_self)->c->theta = __pyx_t_4;
26965 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2910
26966 * self.c.theta = kwargs.get( "theta", 0.83 )
26968 * if self.c.errmod != BAM_ERRMOD_MAQ2: # <<<<<<<<<<<<<<
26969 * self.c.theta += 0.02
26972 __pyx_t_5 = (((struct __pyx_obj_9csamtools_SNPCallerBase *)__pyx_v_self)->c->errmod != BAM_ERRMOD_MAQ2);
26975 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2911
26977 * if self.c.errmod != BAM_ERRMOD_MAQ2:
26978 * self.c.theta += 0.02 # <<<<<<<<<<<<<<
26980 * # call prepare AFTER setting parameters
26982 ((struct __pyx_obj_9csamtools_SNPCallerBase *)__pyx_v_self)->c->theta += 0.02;
26987 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2914
26989 * # call prepare AFTER setting parameters
26990 * bam_maqcns_prepare( self.c ) # <<<<<<<<<<<<<<
26992 * def __dealloc__(self):
26994 bam_maqcns_prepare(((struct __pyx_obj_9csamtools_SNPCallerBase *)__pyx_v_self)->c);
26999 __Pyx_XDECREF(__pyx_t_1);
27000 __Pyx_XDECREF(__pyx_t_2);
27001 __Pyx_AddTraceback("csamtools.SNPCallerBase.__cinit__");
27004 __Pyx_DECREF(__pyx_v_kwargs);
27005 __Pyx_TraceReturn(Py_None);
27006 __Pyx_RefNannyFinishContext();
27010 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2916
27011 * bam_maqcns_prepare( self.c )
27013 * def __dealloc__(self): # <<<<<<<<<<<<<<
27014 * bam_maqcns_destroy( self.c )
27018 static void __pyx_pf_9csamtools_13SNPCallerBase___dealloc__(PyObject *__pyx_v_self); /*proto*/
27019 static void __pyx_pf_9csamtools_13SNPCallerBase___dealloc__(PyObject *__pyx_v_self) {
27020 __Pyx_TraceDeclarations
27021 __Pyx_RefNannySetupContext("__dealloc__");
27022 __Pyx_TraceCall("__dealloc__", __pyx_f[0], 2916);
27024 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2917
27026 * def __dealloc__(self):
27027 * bam_maqcns_destroy( self.c ) # <<<<<<<<<<<<<<
27029 * cdef __dump( self, glf1_t * g, uint32_t cns, int rb ):
27031 bam_maqcns_destroy(((struct __pyx_obj_9csamtools_SNPCallerBase *)__pyx_v_self)->c);
27033 __Pyx_TraceReturn(Py_None);
27034 __Pyx_RefNannyFinishContext();
27037 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2919
27038 * bam_maqcns_destroy( self.c )
27040 * cdef __dump( self, glf1_t * g, uint32_t cns, int rb ): # <<<<<<<<<<<<<<
27041 * '''debugging output.'''
27045 static PyObject *__pyx_f_9csamtools_13SNPCallerBase___dump(struct __pyx_obj_9csamtools_SNPCallerBase *__pyx_v_self, glf1_t *__pyx_v_g, uint32_t __pyx_v_cns, int __pyx_v_rb) {
27047 PyObject *__pyx_r = NULL;
27050 PyObject *__pyx_t_3 = NULL;
27051 PyObject *__pyx_t_4 = NULL;
27052 PyObject *__pyx_t_5 = NULL;
27053 PyObject *__pyx_t_6 = NULL;
27054 PyObject *__pyx_t_7 = NULL;
27055 PyObject *__pyx_t_8 = NULL;
27056 PyObject *__pyx_t_9 = NULL;
27057 PyObject *__pyx_t_10 = NULL;
27058 PyObject *__pyx_t_11 = NULL;
27059 PyObject *__pyx_t_12 = NULL;
27060 PyObject *__pyx_t_13 = NULL;
27061 __Pyx_TraceDeclarations
27062 __Pyx_RefNannySetupContext("__dump");
27063 __Pyx_TraceCall("__dump", __pyx_f[0], 2919);
27065 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2922
27066 * '''debugging output.'''
27068 * pysam_dump_glf( g, self.c ); # <<<<<<<<<<<<<<
27070 * for x in range(self.iter.n_plp):
27072 pysam_dump_glf(__pyx_v_g, __pyx_v_self->c);
27074 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2923
27076 * pysam_dump_glf( g, self.c );
27077 * print "" # <<<<<<<<<<<<<<
27078 * for x in range(self.iter.n_plp):
27079 * print "--> read %i %s %i" % (x,
27081 if (__Pyx_PrintOne(0, ((PyObject *)__pyx_kp_s_8)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2923; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
27083 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2924
27084 * pysam_dump_glf( g, self.c );
27086 * for x in range(self.iter.n_plp): # <<<<<<<<<<<<<<
27087 * print "--> read %i %s %i" % (x,
27088 * bam1_qname(self.iter.plp[x].b),
27090 __pyx_t_1 = __pyx_v_self->iter->n_plp;
27091 for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
27092 __pyx_v_x = __pyx_t_2;
27094 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2925
27096 * for x in range(self.iter.n_plp):
27097 * print "--> read %i %s %i" % (x, # <<<<<<<<<<<<<<
27098 * bam1_qname(self.iter.plp[x].b),
27099 * self.iter.plp[x].qpos,
27101 __pyx_t_3 = PyInt_FromLong(__pyx_v_x); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2925; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
27102 __Pyx_GOTREF(__pyx_t_3);
27104 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2926
27105 * for x in range(self.iter.n_plp):
27106 * print "--> read %i %s %i" % (x,
27107 * bam1_qname(self.iter.plp[x].b), # <<<<<<<<<<<<<<
27108 * self.iter.plp[x].qpos,
27111 __pyx_t_4 = PyBytes_FromString(bam1_qname((__pyx_v_self->iter->plp[__pyx_v_x]).b)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2926; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
27112 __Pyx_GOTREF(((PyObject *)__pyx_t_4));
27114 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2927
27115 * print "--> read %i %s %i" % (x,
27116 * bam1_qname(self.iter.plp[x].b),
27117 * self.iter.plp[x].qpos, # <<<<<<<<<<<<<<
27121 __pyx_t_5 = __Pyx_PyInt_to_py_int32_t((__pyx_v_self->iter->plp[__pyx_v_x]).qpos); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2927; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
27122 __Pyx_GOTREF(__pyx_t_5);
27123 __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2925; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
27124 __Pyx_GOTREF(__pyx_t_6);
27125 PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3);
27126 __Pyx_GIVEREF(__pyx_t_3);
27127 PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_t_4));
27128 __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
27129 PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_5);
27130 __Pyx_GIVEREF(__pyx_t_5);
27134 __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_104), __pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2925; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
27135 __Pyx_GOTREF(((PyObject *)__pyx_t_5));
27136 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
27137 if (__Pyx_PrintOne(0, ((PyObject *)__pyx_t_5)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2925; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
27138 __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
27141 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2931
27143 * print "pos=%i, cns=%i, q_r = %f, depth=%i, n=%i, rb=%i, cns-cq=%i %i %i %i" \
27144 * % (self.iter.pos, # <<<<<<<<<<<<<<
27148 __pyx_t_5 = PyInt_FromLong(__pyx_v_self->iter->pos); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2931; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
27149 __Pyx_GOTREF(__pyx_t_5);
27151 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2932
27152 * print "pos=%i, cns=%i, q_r = %f, depth=%i, n=%i, rb=%i, cns-cq=%i %i %i %i" \
27153 * % (self.iter.pos,
27154 * cns, # <<<<<<<<<<<<<<
27158 __pyx_t_6 = __Pyx_PyInt_to_py_uint32_t(__pyx_v_cns); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
27159 __Pyx_GOTREF(__pyx_t_6);
27161 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2933
27162 * % (self.iter.pos,
27164 * self.c.q_r, # <<<<<<<<<<<<<<
27168 __pyx_t_4 = PyFloat_FromDouble(__pyx_v_self->c->q_r); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2933; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
27169 __Pyx_GOTREF(__pyx_t_4);
27171 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2934
27174 * self.iter.n_plp, # <<<<<<<<<<<<<<
27178 __pyx_t_3 = PyInt_FromLong(__pyx_v_self->iter->n_plp); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2934; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
27179 __Pyx_GOTREF(__pyx_t_3);
27181 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2935
27184 * self.iter.n_plp, # <<<<<<<<<<<<<<
27188 __pyx_t_7 = PyInt_FromLong(__pyx_v_self->iter->n_plp); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2935; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
27189 __Pyx_GOTREF(__pyx_t_7);
27191 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2936
27194 * rb, # <<<<<<<<<<<<<<
27196 * cns >> 16 & 0xff,
27198 __pyx_t_8 = PyInt_FromLong(__pyx_v_rb); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2936; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
27199 __Pyx_GOTREF(__pyx_t_8);
27201 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2937
27204 * cns >> 8 & 0xff, # <<<<<<<<<<<<<<
27205 * cns >> 16 & 0xff,
27208 __pyx_t_9 = PyInt_FromLong(((__pyx_v_cns >> 8) & 0xff)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2937; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
27209 __Pyx_GOTREF(__pyx_t_9);
27211 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2938
27214 * cns >> 16 & 0xff, # <<<<<<<<<<<<<<
27218 __pyx_t_10 = PyInt_FromLong(((__pyx_v_cns >> 16) & 0xff)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2938; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
27219 __Pyx_GOTREF(__pyx_t_10);
27221 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2939
27223 * cns >> 16 & 0xff,
27224 * cns & 0xff, # <<<<<<<<<<<<<<
27228 __pyx_t_11 = PyInt_FromLong((__pyx_v_cns & 0xff)); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2939; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
27229 __Pyx_GOTREF(__pyx_t_11);
27231 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2940
27232 * cns >> 16 & 0xff,
27234 * cns >> 28, # <<<<<<<<<<<<<<
27238 __pyx_t_12 = PyInt_FromLong((__pyx_v_cns >> 28)); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2940; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
27239 __Pyx_GOTREF(__pyx_t_12);
27240 __pyx_t_13 = PyTuple_New(10); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2931; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
27241 __Pyx_GOTREF(__pyx_t_13);
27242 PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_5);
27243 __Pyx_GIVEREF(__pyx_t_5);
27244 PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_6);
27245 __Pyx_GIVEREF(__pyx_t_6);
27246 PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_t_4);
27247 __Pyx_GIVEREF(__pyx_t_4);
27248 PyTuple_SET_ITEM(__pyx_t_13, 3, __pyx_t_3);
27249 __Pyx_GIVEREF(__pyx_t_3);
27250 PyTuple_SET_ITEM(__pyx_t_13, 4, __pyx_t_7);
27251 __Pyx_GIVEREF(__pyx_t_7);
27252 PyTuple_SET_ITEM(__pyx_t_13, 5, __pyx_t_8);
27253 __Pyx_GIVEREF(__pyx_t_8);
27254 PyTuple_SET_ITEM(__pyx_t_13, 6, __pyx_t_9);
27255 __Pyx_GIVEREF(__pyx_t_9);
27256 PyTuple_SET_ITEM(__pyx_t_13, 7, __pyx_t_10);
27257 __Pyx_GIVEREF(__pyx_t_10);
27258 PyTuple_SET_ITEM(__pyx_t_13, 8, __pyx_t_11);
27259 __Pyx_GIVEREF(__pyx_t_11);
27260 PyTuple_SET_ITEM(__pyx_t_13, 9, __pyx_t_12);
27261 __Pyx_GIVEREF(__pyx_t_12);
27272 __pyx_t_12 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_105), __pyx_t_13); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2931; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
27273 __Pyx_GOTREF(((PyObject *)__pyx_t_12));
27274 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
27275 if (__Pyx_PrintOne(0, ((PyObject *)__pyx_t_12)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2930; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
27276 __Pyx_DECREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0;
27278 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2943
27281 * printf("-------------------------------------\n"); # <<<<<<<<<<<<<<
27282 * sys.stdout.flush()
27285 printf(__pyx_k_106);
27287 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2944
27289 * printf("-------------------------------------\n");
27290 * sys.stdout.flush() # <<<<<<<<<<<<<<
27292 * cdef class IteratorSNPCalls( SNPCallerBase ):
27294 __pyx_t_12 = __Pyx_GetName(__pyx_m, __pyx_n_s__sys); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2944; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
27295 __Pyx_GOTREF(__pyx_t_12);
27296 __pyx_t_13 = PyObject_GetAttr(__pyx_t_12, __pyx_n_s__stdout); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2944; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
27297 __Pyx_GOTREF(__pyx_t_13);
27298 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
27299 __pyx_t_12 = PyObject_GetAttr(__pyx_t_13, __pyx_n_s__flush); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2944; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
27300 __Pyx_GOTREF(__pyx_t_12);
27301 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
27302 __pyx_t_13 = PyObject_Call(__pyx_t_12, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2944; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
27303 __Pyx_GOTREF(__pyx_t_13);
27304 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
27305 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
27307 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
27310 __Pyx_XDECREF(__pyx_t_3);
27311 __Pyx_XDECREF(__pyx_t_4);
27312 __Pyx_XDECREF(__pyx_t_5);
27313 __Pyx_XDECREF(__pyx_t_6);
27314 __Pyx_XDECREF(__pyx_t_7);
27315 __Pyx_XDECREF(__pyx_t_8);
27316 __Pyx_XDECREF(__pyx_t_9);
27317 __Pyx_XDECREF(__pyx_t_10);
27318 __Pyx_XDECREF(__pyx_t_11);
27319 __Pyx_XDECREF(__pyx_t_12);
27320 __Pyx_XDECREF(__pyx_t_13);
27321 __Pyx_AddTraceback("csamtools.SNPCallerBase.__dump");
27324 __Pyx_XGIVEREF(__pyx_r);
27325 __Pyx_TraceReturn(__pyx_r);
27326 __Pyx_RefNannyFinishContext();
27330 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2960
27333 * def __cinit__(self, # <<<<<<<<<<<<<<
27334 * IteratorColumn iterator_column,
27338 static int __pyx_pf_9csamtools_16IteratorSNPCalls___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
27339 static int __pyx_pf_9csamtools_16IteratorSNPCalls___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
27340 struct __pyx_obj_9csamtools_IteratorColumn *__pyx_v_iterator_column = 0;
27341 PyObject *__pyx_v_kwargs = 0;
27343 PyObject *__pyx_t_1 = NULL;
27344 PyObject *__pyx_t_2 = NULL;
27346 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__iterator_column,0};
27347 __Pyx_TraceDeclarations
27348 __Pyx_RefNannySetupContext("__cinit__");
27349 __Pyx_TraceCall("__cinit__", __pyx_f[0], 2960);
27350 __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return -1;
27351 __Pyx_GOTREF(__pyx_v_kwargs);
27352 if (unlikely(__pyx_kwds)) {
27353 Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
27354 PyObject* values[1] = {0};
27355 switch (PyTuple_GET_SIZE(__pyx_args)) {
27356 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
27358 default: goto __pyx_L5_argtuple_error;
27360 switch (PyTuple_GET_SIZE(__pyx_args)) {
27362 values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__iterator_column);
27363 if (likely(values[0])) kw_args--;
27364 else goto __pyx_L5_argtuple_error;
27366 if (unlikely(kw_args > 0)) {
27367 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, PyTuple_GET_SIZE(__pyx_args), "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2960; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
27369 __pyx_v_iterator_column = ((struct __pyx_obj_9csamtools_IteratorColumn *)values[0]);
27370 } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
27371 goto __pyx_L5_argtuple_error;
27373 __pyx_v_iterator_column = ((struct __pyx_obj_9csamtools_IteratorColumn *)PyTuple_GET_ITEM(__pyx_args, 0));
27375 goto __pyx_L4_argument_unpacking_done;
27376 __pyx_L5_argtuple_error:;
27377 __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2960; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
27379 __Pyx_DECREF(__pyx_v_kwargs);
27380 __Pyx_AddTraceback("csamtools.IteratorSNPCalls.__cinit__");
27381 __Pyx_RefNannyFinishContext();
27383 __pyx_L4_argument_unpacking_done:;
27384 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_iterator_column), __pyx_ptype_9csamtools_IteratorColumn, 1, "iterator_column", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2961; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
27386 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2964
27389 * assert self.iter.hasReference(), "IteratorSNPCalls requires an pileup iterator with reference sequence" # <<<<<<<<<<<<<<
27391 * def __iter__(self):
27393 #ifndef PYREX_WITHOUT_ASSERTIONS
27394 __pyx_t_1 = PyObject_GetAttr(((PyObject *)((struct __pyx_obj_9csamtools_IteratorSNPCalls *)__pyx_v_self)->__pyx_base.iter), __pyx_n_s__hasReference); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2964; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
27395 __Pyx_GOTREF(__pyx_t_1);
27396 __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 = 2964; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
27397 __Pyx_GOTREF(__pyx_t_2);
27398 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
27399 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2964; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
27400 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
27401 if (unlikely(!__pyx_t_3)) {
27402 PyErr_SetObject(PyExc_AssertionError, ((PyObject *)__pyx_kp_s_107));
27403 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2964; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
27410 __Pyx_XDECREF(__pyx_t_1);
27411 __Pyx_XDECREF(__pyx_t_2);
27412 __Pyx_AddTraceback("csamtools.IteratorSNPCalls.__cinit__");
27415 __Pyx_DECREF(__pyx_v_kwargs);
27416 __Pyx_TraceReturn(Py_None);
27417 __Pyx_RefNannyFinishContext();
27421 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2966
27422 * assert self.iter.hasReference(), "IteratorSNPCalls requires an pileup iterator with reference sequence"
27424 * def __iter__(self): # <<<<<<<<<<<<<<
27429 static PyObject *__pyx_pf_9csamtools_16IteratorSNPCalls___iter__(PyObject *__pyx_v_self); /*proto*/
27430 static PyObject *__pyx_pf_9csamtools_16IteratorSNPCalls___iter__(PyObject *__pyx_v_self) {
27431 PyObject *__pyx_r = NULL;
27432 __Pyx_TraceDeclarations
27433 __Pyx_RefNannySetupContext("__iter__");
27434 __Pyx_TraceCall("__iter__", __pyx_f[0], 2966);
27436 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2967
27438 * def __iter__(self):
27439 * return self # <<<<<<<<<<<<<<
27441 * def __next__(self):
27443 __Pyx_XDECREF(__pyx_r);
27444 __Pyx_INCREF(__pyx_v_self);
27445 __pyx_r = __pyx_v_self;
27448 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
27450 __Pyx_XGIVEREF(__pyx_r);
27451 __Pyx_TraceReturn(__pyx_r);
27452 __Pyx_RefNannyFinishContext();
27456 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2969
27459 * def __next__(self): # <<<<<<<<<<<<<<
27460 * """python version of next().
27464 static PyObject *__pyx_pf_9csamtools_16IteratorSNPCalls___next__(PyObject *__pyx_v_self); /*proto*/
27465 static char __pyx_doc_9csamtools_16IteratorSNPCalls___next__[] = "python version of next().\n ";
27466 struct wrapperbase __pyx_wrapperbase_9csamtools_16IteratorSNPCalls___next__;
27467 static PyObject *__pyx_pf_9csamtools_16IteratorSNPCalls___next__(PyObject *__pyx_v_self) {
27469 int __pyx_v_seq_len;
27471 uint32_t __pyx_v_cns;
27473 struct __pyx_obj_9csamtools_SNPCall *__pyx_v_call;
27474 PyObject *__pyx_r = NULL;
27476 PyObject *__pyx_t_2 = NULL;
27477 PyObject *__pyx_t_3 = NULL;
27479 PyObject *__pyx_t_5 = NULL;
27480 __Pyx_TraceDeclarations
27481 __Pyx_RefNannySetupContext("__next__");
27482 __Pyx_TraceCall("__next__", __pyx_f[0], 2969);
27483 __pyx_v_call = ((struct __pyx_obj_9csamtools_SNPCall *)Py_None); __Pyx_INCREF(Py_None);
27485 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2974
27487 * # the following code was adapted from bam_plcmd.c:pileup_func()
27488 * self.iter.cnext() # <<<<<<<<<<<<<<
27490 * if self.iter.n_plp < 0:
27492 ((struct __pyx_vtabstruct_9csamtools_IteratorColumn *)((struct __pyx_obj_9csamtools_IteratorSNPCalls *)__pyx_v_self)->__pyx_base.iter->__pyx_vtab)->cnext(((struct __pyx_obj_9csamtools_IteratorSNPCalls *)__pyx_v_self)->__pyx_base.iter);
27494 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2976
27495 * self.iter.cnext()
27497 * if self.iter.n_plp < 0: # <<<<<<<<<<<<<<
27498 * raise ValueError("error during iteration" )
27501 __pyx_t_1 = (((struct __pyx_obj_9csamtools_IteratorSNPCalls *)__pyx_v_self)->__pyx_base.iter->n_plp < 0);
27504 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2977
27506 * if self.iter.n_plp < 0:
27507 * raise ValueError("error during iteration" ) # <<<<<<<<<<<<<<
27509 * if self.iter.plp == NULL:
27511 __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2977; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
27512 __Pyx_GOTREF(__pyx_t_2);
27513 __Pyx_INCREF(((PyObject *)__pyx_kp_s_59));
27514 PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_59));
27515 __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_59));
27516 __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2977; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
27517 __Pyx_GOTREF(__pyx_t_3);
27518 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
27519 __Pyx_Raise(__pyx_t_3, 0, 0);
27520 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
27521 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2977; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
27526 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2979
27527 * raise ValueError("error during iteration" )
27529 * if self.iter.plp == NULL: # <<<<<<<<<<<<<<
27530 * raise StopIteration
27533 __pyx_t_1 = (((struct __pyx_obj_9csamtools_IteratorSNPCalls *)__pyx_v_self)->__pyx_base.iter->plp == NULL);
27536 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2980
27538 * if self.iter.plp == NULL:
27539 * raise StopIteration # <<<<<<<<<<<<<<
27541 * cdef char * seq = self.iter.getSequence()
27543 __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0);
27544 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2980; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
27549 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2982
27550 * raise StopIteration
27552 * cdef char * seq = self.iter.getSequence() # <<<<<<<<<<<<<<
27553 * cdef int seq_len = self.iter.seq_len
27556 __pyx_v_seq = ((struct __pyx_vtabstruct_9csamtools_IteratorColumn *)((struct __pyx_obj_9csamtools_IteratorSNPCalls *)__pyx_v_self)->__pyx_base.iter->__pyx_vtab)->getSequence(((struct __pyx_obj_9csamtools_IteratorSNPCalls *)__pyx_v_self)->__pyx_base.iter);
27558 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2983
27560 * cdef char * seq = self.iter.getSequence()
27561 * cdef int seq_len = self.iter.seq_len # <<<<<<<<<<<<<<
27563 * assert seq != NULL
27565 __pyx_t_3 = PyObject_GetAttr(((PyObject *)((struct __pyx_obj_9csamtools_IteratorSNPCalls *)__pyx_v_self)->__pyx_base.iter), __pyx_n_s__seq_len); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2983; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
27566 __Pyx_GOTREF(__pyx_t_3);
27567 __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2983; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
27568 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
27569 __pyx_v_seq_len = __pyx_t_4;
27571 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2985
27572 * cdef int seq_len = self.iter.seq_len
27574 * assert seq != NULL # <<<<<<<<<<<<<<
27578 #ifndef PYREX_WITHOUT_ASSERTIONS
27579 if (unlikely(!(__pyx_v_seq != NULL))) {
27580 PyErr_SetNone(PyExc_AssertionError);
27581 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2985; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
27585 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2988
27588 * if self.iter.pos >= seq_len: # <<<<<<<<<<<<<<
27589 * raise ValueError( "position %i out of bounds on reference sequence (len=%i)" % (self.iter.pos, seq_len) )
27592 __pyx_t_1 = (((struct __pyx_obj_9csamtools_IteratorSNPCalls *)__pyx_v_self)->__pyx_base.iter->pos >= __pyx_v_seq_len);
27595 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2989
27597 * if self.iter.pos >= seq_len:
27598 * raise ValueError( "position %i out of bounds on reference sequence (len=%i)" % (self.iter.pos, seq_len) ) # <<<<<<<<<<<<<<
27600 * cdef int rb = seq[self.iter.pos]
27602 __pyx_t_3 = PyInt_FromLong(((struct __pyx_obj_9csamtools_IteratorSNPCalls *)__pyx_v_self)->__pyx_base.iter->pos); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2989; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
27603 __Pyx_GOTREF(__pyx_t_3);
27604 __pyx_t_2 = PyInt_FromLong(__pyx_v_seq_len); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2989; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
27605 __Pyx_GOTREF(__pyx_t_2);
27606 __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2989; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
27607 __Pyx_GOTREF(__pyx_t_5);
27608 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3);
27609 __Pyx_GIVEREF(__pyx_t_3);
27610 PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
27611 __Pyx_GIVEREF(__pyx_t_2);
27614 __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_108), __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2989; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
27615 __Pyx_GOTREF(((PyObject *)__pyx_t_2));
27616 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
27617 __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2989; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
27618 __Pyx_GOTREF(__pyx_t_5);
27619 PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_2));
27620 __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
27622 __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2989; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
27623 __Pyx_GOTREF(__pyx_t_2);
27624 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
27625 __Pyx_Raise(__pyx_t_2, 0, 0);
27626 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
27627 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2989; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
27632 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2991
27633 * raise ValueError( "position %i out of bounds on reference sequence (len=%i)" % (self.iter.pos, seq_len) )
27635 * cdef int rb = seq[self.iter.pos] # <<<<<<<<<<<<<<
27636 * cdef uint32_t cns
27639 __pyx_v_rb = (__pyx_v_seq[((struct __pyx_obj_9csamtools_IteratorSNPCalls *)__pyx_v_self)->__pyx_base.iter->pos]);
27641 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2998
27643 * bam_nt16_table[rb],
27644 * self.c ) # <<<<<<<<<<<<<<
27646 * if pysam_glf_depth( g ) == 0:
27648 __pyx_v_g = bam_maqcns_glfgen(((struct __pyx_obj_9csamtools_IteratorSNPCalls *)__pyx_v_self)->__pyx_base.iter->n_plp, ((struct __pyx_obj_9csamtools_IteratorSNPCalls *)__pyx_v_self)->__pyx_base.iter->plp, (bam_nt16_table[__pyx_v_rb]), ((struct __pyx_obj_9csamtools_IteratorSNPCalls *)__pyx_v_self)->__pyx_base.c);
27650 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3000
27653 * if pysam_glf_depth( g ) == 0: # <<<<<<<<<<<<<<
27654 * cns = 0xfu << 28 | 0xf << 24
27657 __pyx_t_1 = (pysam_glf_depth(__pyx_v_g) == 0);
27660 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3001
27662 * if pysam_glf_depth( g ) == 0:
27663 * cns = 0xfu << 28 | 0xf << 24 # <<<<<<<<<<<<<<
27665 * cns = glf2cns(g, <int>(self.c.q_r + .499))
27667 __pyx_v_cns = 4278190080U;
27672 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3003
27673 * cns = 0xfu << 28 | 0xf << 24
27675 * cns = glf2cns(g, <int>(self.c.q_r + .499)) # <<<<<<<<<<<<<<
27679 __pyx_v_cns = glf2cns(__pyx_v_g, ((int)(((struct __pyx_obj_9csamtools_IteratorSNPCalls *)__pyx_v_self)->__pyx_base.c->q_r + .499)));
27683 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3005
27684 * cns = glf2cns(g, <int>(self.c.q_r + .499))
27686 * free(g) # <<<<<<<<<<<<<<
27688 * cdef SNPCall call
27692 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3009
27693 * cdef SNPCall call
27695 * call = SNPCall() # <<<<<<<<<<<<<<
27696 * call._tid = self.iter.tid
27697 * call._pos = self.iter.pos
27699 __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_9csamtools_SNPCall)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3009; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
27700 __Pyx_GOTREF(__pyx_t_2);
27701 __Pyx_DECREF(((PyObject *)__pyx_v_call));
27702 __pyx_v_call = ((struct __pyx_obj_9csamtools_SNPCall *)__pyx_t_2);
27705 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3010
27708 * call._tid = self.iter.tid # <<<<<<<<<<<<<<
27709 * call._pos = self.iter.pos
27710 * call._reference_base = rb
27712 __pyx_v_call->_tid = ((struct __pyx_obj_9csamtools_IteratorSNPCalls *)__pyx_v_self)->__pyx_base.iter->tid;
27714 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3011
27716 * call._tid = self.iter.tid
27717 * call._pos = self.iter.pos # <<<<<<<<<<<<<<
27718 * call._reference_base = rb
27719 * call._genotype = bam_nt16_rev_table[cns>>28]
27721 __pyx_v_call->_pos = ((struct __pyx_obj_9csamtools_IteratorSNPCalls *)__pyx_v_self)->__pyx_base.iter->pos;
27723 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3012
27724 * call._tid = self.iter.tid
27725 * call._pos = self.iter.pos
27726 * call._reference_base = rb # <<<<<<<<<<<<<<
27727 * call._genotype = bam_nt16_rev_table[cns>>28]
27728 * call._consensus_quality = cns >> 8 & 0xff
27730 __pyx_v_call->_reference_base = __pyx_v_rb;
27732 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3013
27733 * call._pos = self.iter.pos
27734 * call._reference_base = rb
27735 * call._genotype = bam_nt16_rev_table[cns>>28] # <<<<<<<<<<<<<<
27736 * call._consensus_quality = cns >> 8 & 0xff
27737 * call._snp_quality = cns & 0xff
27739 __pyx_v_call->_genotype = (__pyx_v_9csamtools_bam_nt16_rev_table[(__pyx_v_cns >> 28)]);
27741 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3014
27742 * call._reference_base = rb
27743 * call._genotype = bam_nt16_rev_table[cns>>28]
27744 * call._consensus_quality = cns >> 8 & 0xff # <<<<<<<<<<<<<<
27745 * call._snp_quality = cns & 0xff
27746 * call._rms_mapping_quality = cns >> 16&0xff
27748 __pyx_v_call->_consensus_quality = ((__pyx_v_cns >> 8) & 0xff);
27750 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3015
27751 * call._genotype = bam_nt16_rev_table[cns>>28]
27752 * call._consensus_quality = cns >> 8 & 0xff
27753 * call._snp_quality = cns & 0xff # <<<<<<<<<<<<<<
27754 * call._rms_mapping_quality = cns >> 16&0xff
27755 * call._coverage = self.iter.n_plp
27757 __pyx_v_call->_snp_quality = (__pyx_v_cns & 0xff);
27759 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3016
27760 * call._consensus_quality = cns >> 8 & 0xff
27761 * call._snp_quality = cns & 0xff
27762 * call._rms_mapping_quality = cns >> 16&0xff # <<<<<<<<<<<<<<
27763 * call._coverage = self.iter.n_plp
27766 __pyx_v_call->_rms_mapping_quality = ((__pyx_v_cns >> 16) & 0xff);
27768 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3017
27769 * call._snp_quality = cns & 0xff
27770 * call._rms_mapping_quality = cns >> 16&0xff
27771 * call._coverage = self.iter.n_plp # <<<<<<<<<<<<<<
27775 __pyx_v_call->_coverage = ((struct __pyx_obj_9csamtools_IteratorSNPCalls *)__pyx_v_self)->__pyx_base.iter->n_plp;
27777 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3019
27778 * call._coverage = self.iter.n_plp
27780 * return call # <<<<<<<<<<<<<<
27782 * cdef class SNPCaller( SNPCallerBase ):
27784 __Pyx_XDECREF(__pyx_r);
27785 __Pyx_INCREF(((PyObject *)__pyx_v_call));
27786 __pyx_r = ((PyObject *)__pyx_v_call);
27789 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
27792 __Pyx_XDECREF(__pyx_t_2);
27793 __Pyx_XDECREF(__pyx_t_3);
27794 __Pyx_XDECREF(__pyx_t_5);
27795 __Pyx_AddTraceback("csamtools.IteratorSNPCalls.__next__");
27798 __Pyx_DECREF((PyObject *)__pyx_v_call);
27799 __Pyx_XGIVEREF(__pyx_r);
27800 __Pyx_TraceReturn(__pyx_r);
27801 __Pyx_RefNannyFinishContext();
27805 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3035
27808 * def __cinit__(self, # <<<<<<<<<<<<<<
27809 * IteratorColumn iterator_column,
27813 static int __pyx_pf_9csamtools_9SNPCaller___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
27814 static int __pyx_pf_9csamtools_9SNPCaller___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
27815 struct __pyx_obj_9csamtools_IteratorColumn *__pyx_v_iterator_column = 0;
27816 PyObject *__pyx_v_kwargs = 0;
27818 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__iterator_column,0};
27819 __Pyx_TraceDeclarations
27820 __Pyx_RefNannySetupContext("__cinit__");
27821 __Pyx_TraceCall("__cinit__", __pyx_f[0], 3035);
27822 __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return -1;
27823 __Pyx_GOTREF(__pyx_v_kwargs);
27824 if (unlikely(__pyx_kwds)) {
27825 Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
27826 PyObject* values[1] = {0};
27827 switch (PyTuple_GET_SIZE(__pyx_args)) {
27828 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
27830 default: goto __pyx_L5_argtuple_error;
27832 switch (PyTuple_GET_SIZE(__pyx_args)) {
27834 values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__iterator_column);
27835 if (likely(values[0])) kw_args--;
27836 else goto __pyx_L5_argtuple_error;
27838 if (unlikely(kw_args > 0)) {
27839 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, PyTuple_GET_SIZE(__pyx_args), "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3035; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
27841 __pyx_v_iterator_column = ((struct __pyx_obj_9csamtools_IteratorColumn *)values[0]);
27842 } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
27843 goto __pyx_L5_argtuple_error;
27845 __pyx_v_iterator_column = ((struct __pyx_obj_9csamtools_IteratorColumn *)PyTuple_GET_ITEM(__pyx_args, 0));
27847 goto __pyx_L4_argument_unpacking_done;
27848 __pyx_L5_argtuple_error:;
27849 __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3035; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
27851 __Pyx_DECREF(__pyx_v_kwargs);
27852 __Pyx_AddTraceback("csamtools.SNPCaller.__cinit__");
27853 __Pyx_RefNannyFinishContext();
27855 __pyx_L4_argument_unpacking_done:;
27856 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_iterator_column), __pyx_ptype_9csamtools_IteratorColumn, 1, "iterator_column", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3036; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
27861 __Pyx_AddTraceback("csamtools.SNPCaller.__cinit__");
27864 __Pyx_DECREF(__pyx_v_kwargs);
27865 __Pyx_TraceReturn(Py_None);
27866 __Pyx_RefNannyFinishContext();
27870 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3041
27873 * def call(self, reference, int pos ): # <<<<<<<<<<<<<<
27874 * """call a snp on chromosome *reference*
27875 * and position *pos*.
27878 static PyObject *__pyx_pf_9csamtools_9SNPCaller_call(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
27879 static char __pyx_doc_9csamtools_9SNPCaller_call[] = "SNPCaller.call(self, reference, int pos)\ncall a snp on chromosome *reference*\n and position *pos*.\n\n returns a :class:`SNPCall` object.\n ";
27880 static PyObject *__pyx_pf_9csamtools_9SNPCaller_call(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
27881 PyObject *__pyx_v_reference = 0;
27885 int __pyx_v_seq_len;
27887 uint32_t __pyx_v_cns;
27889 struct __pyx_obj_9csamtools_SNPCall *__pyx_v_call;
27890 PyObject *__pyx_r = NULL;
27891 PyObject *__pyx_t_1 = NULL;
27892 PyObject *__pyx_t_2 = NULL;
27893 PyObject *__pyx_t_3 = NULL;
27895 PyObject *__pyx_t_5 = NULL;
27897 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__reference,&__pyx_n_s__pos,0};
27898 __Pyx_TraceDeclarations
27899 __Pyx_RefNannySetupContext("call");
27900 __Pyx_TraceCall("call", __pyx_f[0], 3041);
27901 if (unlikely(__pyx_kwds)) {
27902 Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
27903 PyObject* values[2] = {0,0};
27904 switch (PyTuple_GET_SIZE(__pyx_args)) {
27905 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
27906 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
27908 default: goto __pyx_L5_argtuple_error;
27910 switch (PyTuple_GET_SIZE(__pyx_args)) {
27912 values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__reference);
27913 if (likely(values[0])) kw_args--;
27914 else goto __pyx_L5_argtuple_error;
27916 values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__pos);
27917 if (likely(values[1])) kw_args--;
27919 __Pyx_RaiseArgtupleInvalid("call", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3041; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
27922 if (unlikely(kw_args > 0)) {
27923 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "call") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3041; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
27925 __pyx_v_reference = values[0];
27926 __pyx_v_pos = __Pyx_PyInt_AsInt(values[1]); if (unlikely((__pyx_v_pos == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3041; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
27927 } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
27928 goto __pyx_L5_argtuple_error;
27930 __pyx_v_reference = PyTuple_GET_ITEM(__pyx_args, 0);
27931 __pyx_v_pos = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely((__pyx_v_pos == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3041; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
27933 goto __pyx_L4_argument_unpacking_done;
27934 __pyx_L5_argtuple_error:;
27935 __Pyx_RaiseArgtupleInvalid("call", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3041; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
27937 __Pyx_AddTraceback("csamtools.SNPCaller.call");
27938 __Pyx_RefNannyFinishContext();
27940 __pyx_L4_argument_unpacking_done:;
27941 __pyx_v_call = ((struct __pyx_obj_9csamtools_SNPCall *)Py_None); __Pyx_INCREF(Py_None);
27943 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3048
27946 * cdef int tid = self.iter.samfile.gettid( reference ) # <<<<<<<<<<<<<<
27948 * self.iter.reset( tid, pos, pos + 1 )
27950 __pyx_t_1 = PyObject_GetAttr(((PyObject *)((struct __pyx_obj_9csamtools_SNPCaller *)__pyx_v_self)->__pyx_base.iter->samfile), __pyx_n_s__gettid); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3048; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
27951 __Pyx_GOTREF(__pyx_t_1);
27952 __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3048; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
27953 __Pyx_GOTREF(__pyx_t_2);
27954 __Pyx_INCREF(__pyx_v_reference);
27955 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_reference);
27956 __Pyx_GIVEREF(__pyx_v_reference);
27957 __pyx_t_3 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3048; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
27958 __Pyx_GOTREF(__pyx_t_3);
27959 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
27960 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
27961 __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3048; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
27962 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
27963 __pyx_v_tid = __pyx_t_4;
27965 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3050
27966 * cdef int tid = self.iter.samfile.gettid( reference )
27968 * self.iter.reset( tid, pos, pos + 1 ) # <<<<<<<<<<<<<<
27972 __pyx_t_3 = PyInt_FromLong(__pyx_v_tid); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3050; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
27973 __Pyx_GOTREF(__pyx_t_3);
27974 __pyx_t_2 = PyInt_FromLong(__pyx_v_pos); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3050; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
27975 __Pyx_GOTREF(__pyx_t_2);
27976 __pyx_t_1 = PyInt_FromLong((__pyx_v_pos + 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3050; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
27977 __Pyx_GOTREF(__pyx_t_1);
27978 __pyx_t_5 = ((struct __pyx_vtabstruct_9csamtools_IteratorColumn *)((struct __pyx_obj_9csamtools_SNPCaller *)__pyx_v_self)->__pyx_base.iter->__pyx_vtab)->reset(((struct __pyx_obj_9csamtools_SNPCaller *)__pyx_v_self)->__pyx_base.iter, __pyx_t_3, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3050; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
27979 __Pyx_GOTREF(__pyx_t_5);
27980 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
27981 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
27982 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
27983 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
27985 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3052
27986 * self.iter.reset( tid, pos, pos + 1 )
27988 * while 1: # <<<<<<<<<<<<<<
27989 * self.iter.cnext()
27995 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3053
27998 * self.iter.cnext() # <<<<<<<<<<<<<<
28000 * if self.iter.n_plp < 0:
28002 ((struct __pyx_vtabstruct_9csamtools_IteratorColumn *)((struct __pyx_obj_9csamtools_SNPCaller *)__pyx_v_self)->__pyx_base.iter->__pyx_vtab)->cnext(((struct __pyx_obj_9csamtools_SNPCaller *)__pyx_v_self)->__pyx_base.iter);
28004 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3055
28005 * self.iter.cnext()
28007 * if self.iter.n_plp < 0: # <<<<<<<<<<<<<<
28008 * raise ValueError("error during iteration" )
28011 __pyx_t_6 = (((struct __pyx_obj_9csamtools_SNPCaller *)__pyx_v_self)->__pyx_base.iter->n_plp < 0);
28014 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3056
28016 * if self.iter.n_plp < 0:
28017 * raise ValueError("error during iteration" ) # <<<<<<<<<<<<<<
28019 * if self.iter.plp == NULL:
28021 __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3056; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
28022 __Pyx_GOTREF(__pyx_t_5);
28023 __Pyx_INCREF(((PyObject *)__pyx_kp_s_59));
28024 PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_kp_s_59));
28025 __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_59));
28026 __pyx_t_1 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3056; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
28027 __Pyx_GOTREF(__pyx_t_1);
28028 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
28029 __Pyx_Raise(__pyx_t_1, 0, 0);
28030 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
28031 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3056; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
28036 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3058
28037 * raise ValueError("error during iteration" )
28039 * if self.iter.plp == NULL: # <<<<<<<<<<<<<<
28040 * raise ValueError( "no reads in region - no call" )
28043 __pyx_t_6 = (((struct __pyx_obj_9csamtools_SNPCaller *)__pyx_v_self)->__pyx_base.iter->plp == NULL);
28046 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3059
28048 * if self.iter.plp == NULL:
28049 * raise ValueError( "no reads in region - no call" ) # <<<<<<<<<<<<<<
28051 * if self.iter.pos == pos: break
28053 __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3059; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
28054 __Pyx_GOTREF(__pyx_t_1);
28055 __Pyx_INCREF(((PyObject *)__pyx_kp_s_109));
28056 PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_kp_s_109));
28057 __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_109));
28058 __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3059; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
28059 __Pyx_GOTREF(__pyx_t_5);
28060 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
28061 __Pyx_Raise(__pyx_t_5, 0, 0);
28062 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
28063 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3059; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
28068 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3061
28069 * raise ValueError( "no reads in region - no call" )
28071 * if self.iter.pos == pos: break # <<<<<<<<<<<<<<
28073 * cdef char * seq = self.iter.getSequence()
28075 __pyx_t_6 = (((struct __pyx_obj_9csamtools_SNPCaller *)__pyx_v_self)->__pyx_base.iter->pos == __pyx_v_pos);
28077 goto __pyx_L7_break;
28084 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3063
28085 * if self.iter.pos == pos: break
28087 * cdef char * seq = self.iter.getSequence() # <<<<<<<<<<<<<<
28088 * cdef int seq_len = self.iter.seq_len
28091 __pyx_v_seq = ((struct __pyx_vtabstruct_9csamtools_IteratorColumn *)((struct __pyx_obj_9csamtools_SNPCaller *)__pyx_v_self)->__pyx_base.iter->__pyx_vtab)->getSequence(((struct __pyx_obj_9csamtools_SNPCaller *)__pyx_v_self)->__pyx_base.iter);
28093 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3064
28095 * cdef char * seq = self.iter.getSequence()
28096 * cdef int seq_len = self.iter.seq_len # <<<<<<<<<<<<<<
28098 * assert seq != NULL
28100 __pyx_t_5 = PyObject_GetAttr(((PyObject *)((struct __pyx_obj_9csamtools_SNPCaller *)__pyx_v_self)->__pyx_base.iter), __pyx_n_s__seq_len); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3064; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
28101 __Pyx_GOTREF(__pyx_t_5);
28102 __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_t_5); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3064; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
28103 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
28104 __pyx_v_seq_len = __pyx_t_4;
28106 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3066
28107 * cdef int seq_len = self.iter.seq_len
28109 * assert seq != NULL # <<<<<<<<<<<<<<
28113 #ifndef PYREX_WITHOUT_ASSERTIONS
28114 if (unlikely(!(__pyx_v_seq != NULL))) {
28115 PyErr_SetNone(PyExc_AssertionError);
28116 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3066; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
28120 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3069
28123 * if self.iter.pos >= seq_len: # <<<<<<<<<<<<<<
28124 * raise ValueError( "position %i out of bounds on reference sequence (len=%i)" % (self.iter.pos, seq_len) )
28127 __pyx_t_6 = (((struct __pyx_obj_9csamtools_SNPCaller *)__pyx_v_self)->__pyx_base.iter->pos >= __pyx_v_seq_len);
28130 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3070
28132 * if self.iter.pos >= seq_len:
28133 * raise ValueError( "position %i out of bounds on reference sequence (len=%i)" % (self.iter.pos, seq_len) ) # <<<<<<<<<<<<<<
28135 * cdef int rb = seq[self.iter.pos]
28137 __pyx_t_5 = PyInt_FromLong(((struct __pyx_obj_9csamtools_SNPCaller *)__pyx_v_self)->__pyx_base.iter->pos); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
28138 __Pyx_GOTREF(__pyx_t_5);
28139 __pyx_t_1 = PyInt_FromLong(__pyx_v_seq_len); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
28140 __Pyx_GOTREF(__pyx_t_1);
28141 __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
28142 __Pyx_GOTREF(__pyx_t_2);
28143 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5);
28144 __Pyx_GIVEREF(__pyx_t_5);
28145 PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
28146 __Pyx_GIVEREF(__pyx_t_1);
28149 __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_108), __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
28150 __Pyx_GOTREF(((PyObject *)__pyx_t_1));
28151 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
28152 __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
28153 __Pyx_GOTREF(__pyx_t_2);
28154 PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_1));
28155 __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
28157 __pyx_t_1 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
28158 __Pyx_GOTREF(__pyx_t_1);
28159 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
28160 __Pyx_Raise(__pyx_t_1, 0, 0);
28161 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
28162 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
28167 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3072
28168 * raise ValueError( "position %i out of bounds on reference sequence (len=%i)" % (self.iter.pos, seq_len) )
28170 * cdef int rb = seq[self.iter.pos] # <<<<<<<<<<<<<<
28171 * cdef uint32_t cns
28174 __pyx_v_rb = (__pyx_v_seq[((struct __pyx_obj_9csamtools_SNPCaller *)__pyx_v_self)->__pyx_base.iter->pos]);
28176 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3079
28178 * bam_nt16_table[rb],
28179 * self.c ) # <<<<<<<<<<<<<<
28183 __pyx_v_g = bam_maqcns_glfgen(((struct __pyx_obj_9csamtools_SNPCaller *)__pyx_v_self)->__pyx_base.iter->n_plp, ((struct __pyx_obj_9csamtools_SNPCaller *)__pyx_v_self)->__pyx_base.iter->plp, (bam_nt16_table[__pyx_v_rb]), ((struct __pyx_obj_9csamtools_SNPCaller *)__pyx_v_self)->__pyx_base.c);
28185 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3082
28188 * if pysam_glf_depth( g ) == 0: # <<<<<<<<<<<<<<
28189 * cns = 0xfu << 28 | 0xf << 24
28192 __pyx_t_6 = (pysam_glf_depth(__pyx_v_g) == 0);
28195 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3083
28197 * if pysam_glf_depth( g ) == 0:
28198 * cns = 0xfu << 28 | 0xf << 24 # <<<<<<<<<<<<<<
28200 * cns = glf2cns(g, <int>(self.c.q_r + .499))
28202 __pyx_v_cns = 4278190080U;
28207 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3085
28208 * cns = 0xfu << 28 | 0xf << 24
28210 * cns = glf2cns(g, <int>(self.c.q_r + .499)) # <<<<<<<<<<<<<<
28214 __pyx_v_cns = glf2cns(__pyx_v_g, ((int)(((struct __pyx_obj_9csamtools_SNPCaller *)__pyx_v_self)->__pyx_base.c->q_r + .499)));
28218 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3087
28219 * cns = glf2cns(g, <int>(self.c.q_r + .499))
28221 * free(g) # <<<<<<<<<<<<<<
28223 * cdef SNPCall call
28227 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3091
28228 * cdef SNPCall call
28230 * call = SNPCall() # <<<<<<<<<<<<<<
28231 * call._tid = self.iter.tid
28232 * call._pos = self.iter.pos
28234 __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_9csamtools_SNPCall)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3091; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
28235 __Pyx_GOTREF(__pyx_t_1);
28236 __Pyx_DECREF(((PyObject *)__pyx_v_call));
28237 __pyx_v_call = ((struct __pyx_obj_9csamtools_SNPCall *)__pyx_t_1);
28240 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3092
28243 * call._tid = self.iter.tid # <<<<<<<<<<<<<<
28244 * call._pos = self.iter.pos
28245 * call._reference_base = rb
28247 __pyx_v_call->_tid = ((struct __pyx_obj_9csamtools_SNPCaller *)__pyx_v_self)->__pyx_base.iter->tid;
28249 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3093
28251 * call._tid = self.iter.tid
28252 * call._pos = self.iter.pos # <<<<<<<<<<<<<<
28253 * call._reference_base = rb
28254 * call._genotype = bam_nt16_rev_table[cns>>28]
28256 __pyx_v_call->_pos = ((struct __pyx_obj_9csamtools_SNPCaller *)__pyx_v_self)->__pyx_base.iter->pos;
28258 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3094
28259 * call._tid = self.iter.tid
28260 * call._pos = self.iter.pos
28261 * call._reference_base = rb # <<<<<<<<<<<<<<
28262 * call._genotype = bam_nt16_rev_table[cns>>28]
28263 * call._consensus_quality = cns >> 8 & 0xff
28265 __pyx_v_call->_reference_base = __pyx_v_rb;
28267 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3095
28268 * call._pos = self.iter.pos
28269 * call._reference_base = rb
28270 * call._genotype = bam_nt16_rev_table[cns>>28] # <<<<<<<<<<<<<<
28271 * call._consensus_quality = cns >> 8 & 0xff
28272 * call._snp_quality = cns & 0xff
28274 __pyx_v_call->_genotype = (__pyx_v_9csamtools_bam_nt16_rev_table[(__pyx_v_cns >> 28)]);
28276 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3096
28277 * call._reference_base = rb
28278 * call._genotype = bam_nt16_rev_table[cns>>28]
28279 * call._consensus_quality = cns >> 8 & 0xff # <<<<<<<<<<<<<<
28280 * call._snp_quality = cns & 0xff
28281 * call._rms_mapping_quality = cns >> 16&0xff
28283 __pyx_v_call->_consensus_quality = ((__pyx_v_cns >> 8) & 0xff);
28285 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3097
28286 * call._genotype = bam_nt16_rev_table[cns>>28]
28287 * call._consensus_quality = cns >> 8 & 0xff
28288 * call._snp_quality = cns & 0xff # <<<<<<<<<<<<<<
28289 * call._rms_mapping_quality = cns >> 16&0xff
28290 * call._coverage = self.iter.n_plp
28292 __pyx_v_call->_snp_quality = (__pyx_v_cns & 0xff);
28294 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3098
28295 * call._consensus_quality = cns >> 8 & 0xff
28296 * call._snp_quality = cns & 0xff
28297 * call._rms_mapping_quality = cns >> 16&0xff # <<<<<<<<<<<<<<
28298 * call._coverage = self.iter.n_plp
28301 __pyx_v_call->_rms_mapping_quality = ((__pyx_v_cns >> 16) & 0xff);
28303 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3099
28304 * call._snp_quality = cns & 0xff
28305 * call._rms_mapping_quality = cns >> 16&0xff
28306 * call._coverage = self.iter.n_plp # <<<<<<<<<<<<<<
28310 __pyx_v_call->_coverage = ((struct __pyx_obj_9csamtools_SNPCaller *)__pyx_v_self)->__pyx_base.iter->n_plp;
28312 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3101
28313 * call._coverage = self.iter.n_plp
28315 * return call # <<<<<<<<<<<<<<
28317 * cdef class IndelCall:
28319 __Pyx_XDECREF(__pyx_r);
28320 __Pyx_INCREF(((PyObject *)__pyx_v_call));
28321 __pyx_r = ((PyObject *)__pyx_v_call);
28324 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
28327 __Pyx_XDECREF(__pyx_t_1);
28328 __Pyx_XDECREF(__pyx_t_2);
28329 __Pyx_XDECREF(__pyx_t_3);
28330 __Pyx_XDECREF(__pyx_t_5);
28331 __Pyx_AddTraceback("csamtools.SNPCaller.call");
28334 __Pyx_DECREF((PyObject *)__pyx_v_call);
28335 __Pyx_XGIVEREF(__pyx_r);
28336 __Pyx_TraceReturn(__pyx_r);
28337 __Pyx_RefNannyFinishContext();
28341 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3111
28342 * cdef bam_maqindel_ret_t * _r
28344 * def __cinit__(self): # <<<<<<<<<<<<<<
28345 * #assert r != NULL
28349 static int __pyx_pf_9csamtools_9IndelCall___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
28350 static int __pyx_pf_9csamtools_9IndelCall___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
28352 __Pyx_TraceDeclarations
28353 __Pyx_RefNannySetupContext("__cinit__");
28354 __Pyx_TraceCall("__cinit__", __pyx_f[0], 3111);
28355 if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
28356 __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
28357 if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
28360 __Pyx_TraceReturn(Py_None);
28361 __Pyx_RefNannyFinishContext();
28365 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3118
28367 * '''the chromosome ID as is defined in the header'''
28368 * def __get__(self): # <<<<<<<<<<<<<<
28373 static PyObject *__pyx_pf_9csamtools_9IndelCall_3tid___get__(PyObject *__pyx_v_self); /*proto*/
28374 static PyObject *__pyx_pf_9csamtools_9IndelCall_3tid___get__(PyObject *__pyx_v_self) {
28375 PyObject *__pyx_r = NULL;
28376 PyObject *__pyx_t_1 = NULL;
28377 __Pyx_TraceDeclarations
28378 __Pyx_RefNannySetupContext("__get__");
28379 __Pyx_TraceCall("__get__", __pyx_f[0], 3118);
28381 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3119
28382 * '''the chromosome ID as is defined in the header'''
28383 * def __get__(self):
28384 * return self._tid # <<<<<<<<<<<<<<
28388 __Pyx_XDECREF(__pyx_r);
28389 __pyx_t_1 = PyInt_FromLong(((struct __pyx_obj_9csamtools_IndelCall *)__pyx_v_self)->_tid); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
28390 __Pyx_GOTREF(__pyx_t_1);
28391 __pyx_r = __pyx_t_1;
28395 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
28398 __Pyx_XDECREF(__pyx_t_1);
28399 __Pyx_AddTraceback("csamtools.IndelCall.tid.__get__");
28402 __Pyx_XGIVEREF(__pyx_r);
28403 __Pyx_TraceReturn(__pyx_r);
28404 __Pyx_RefNannyFinishContext();
28408 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3123
28410 * '''nucleotide position of SNP.'''
28411 * def __get__(self): return self._pos # <<<<<<<<<<<<<<
28413 * property genotype:
28416 static PyObject *__pyx_pf_9csamtools_9IndelCall_3pos___get__(PyObject *__pyx_v_self); /*proto*/
28417 static PyObject *__pyx_pf_9csamtools_9IndelCall_3pos___get__(PyObject *__pyx_v_self) {
28418 PyObject *__pyx_r = NULL;
28419 PyObject *__pyx_t_1 = NULL;
28420 __Pyx_TraceDeclarations
28421 __Pyx_RefNannySetupContext("__get__");
28422 __Pyx_TraceCall("__get__", __pyx_f[0], 3123);
28423 __Pyx_XDECREF(__pyx_r);
28424 __pyx_t_1 = PyInt_FromLong(((struct __pyx_obj_9csamtools_IndelCall *)__pyx_v_self)->_pos); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
28425 __Pyx_GOTREF(__pyx_t_1);
28426 __pyx_r = __pyx_t_1;
28430 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
28433 __Pyx_XDECREF(__pyx_t_1);
28434 __Pyx_AddTraceback("csamtools.IndelCall.pos.__get__");
28437 __Pyx_XGIVEREF(__pyx_r);
28438 __Pyx_TraceReturn(__pyx_r);
28439 __Pyx_RefNannyFinishContext();
28443 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3127
28444 * property genotype:
28445 * '''the genotype called.'''
28446 * def __get__(self): # <<<<<<<<<<<<<<
28447 * if self._r.gt == 0:
28448 * s = PyString_FromStringAndSize( self._r.s[0], self._r.indel1 + 1)
28451 static PyObject *__pyx_pf_9csamtools_9IndelCall_8genotype___get__(PyObject *__pyx_v_self); /*proto*/
28452 static PyObject *__pyx_pf_9csamtools_9IndelCall_8genotype___get__(PyObject *__pyx_v_self) {
28453 PyObject *__pyx_v_s;
28454 PyObject *__pyx_r = NULL;
28455 PyObject *__pyx_t_1 = NULL;
28456 PyObject *__pyx_t_2 = NULL;
28457 PyObject *__pyx_t_3 = NULL;
28458 __Pyx_TraceDeclarations
28459 __Pyx_RefNannySetupContext("__get__");
28460 __Pyx_TraceCall("__get__", __pyx_f[0], 3127);
28461 __pyx_v_s = Py_None; __Pyx_INCREF(Py_None);
28463 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3128
28464 * '''the genotype called.'''
28465 * def __get__(self):
28466 * if self._r.gt == 0: # <<<<<<<<<<<<<<
28467 * s = PyString_FromStringAndSize( self._r.s[0], self._r.indel1 + 1)
28468 * return "%s/%s" % (s,s)
28470 switch (((struct __pyx_obj_9csamtools_IndelCall *)__pyx_v_self)->_r->gt) {
28473 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3129
28474 * def __get__(self):
28475 * if self._r.gt == 0:
28476 * s = PyString_FromStringAndSize( self._r.s[0], self._r.indel1 + 1) # <<<<<<<<<<<<<<
28477 * return "%s/%s" % (s,s)
28478 * elif self._r.gt == 1:
28480 __pyx_t_1 = PyString_FromStringAndSize((((struct __pyx_obj_9csamtools_IndelCall *)__pyx_v_self)->_r->s[0]), (((struct __pyx_obj_9csamtools_IndelCall *)__pyx_v_self)->_r->indel1 + 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
28481 __Pyx_GOTREF(__pyx_t_1);
28482 __Pyx_DECREF(__pyx_v_s);
28483 __pyx_v_s = __pyx_t_1;
28486 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3130
28487 * if self._r.gt == 0:
28488 * s = PyString_FromStringAndSize( self._r.s[0], self._r.indel1 + 1)
28489 * return "%s/%s" % (s,s) # <<<<<<<<<<<<<<
28490 * elif self._r.gt == 1:
28491 * s = PyString_FromStringAndSize( self._r.s[1], self._r.indel2 + 1)
28493 __Pyx_XDECREF(__pyx_r);
28494 __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
28495 __Pyx_GOTREF(__pyx_t_1);
28496 __Pyx_INCREF(__pyx_v_s);
28497 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_s);
28498 __Pyx_GIVEREF(__pyx_v_s);
28499 __Pyx_INCREF(__pyx_v_s);
28500 PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_s);
28501 __Pyx_GIVEREF(__pyx_v_s);
28502 __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_110), __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
28503 __Pyx_GOTREF(((PyObject *)__pyx_t_2));
28504 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
28505 __pyx_r = ((PyObject *)__pyx_t_2);
28510 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3131
28511 * s = PyString_FromStringAndSize( self._r.s[0], self._r.indel1 + 1)
28512 * return "%s/%s" % (s,s)
28513 * elif self._r.gt == 1: # <<<<<<<<<<<<<<
28514 * s = PyString_FromStringAndSize( self._r.s[1], self._r.indel2 + 1)
28515 * return "%s/%s" % (s,s)
28519 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3132
28520 * return "%s/%s" % (s,s)
28521 * elif self._r.gt == 1:
28522 * s = PyString_FromStringAndSize( self._r.s[1], self._r.indel2 + 1) # <<<<<<<<<<<<<<
28523 * return "%s/%s" % (s,s)
28526 __pyx_t_2 = PyString_FromStringAndSize((((struct __pyx_obj_9csamtools_IndelCall *)__pyx_v_self)->_r->s[1]), (((struct __pyx_obj_9csamtools_IndelCall *)__pyx_v_self)->_r->indel2 + 1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
28527 __Pyx_GOTREF(__pyx_t_2);
28528 __Pyx_DECREF(__pyx_v_s);
28529 __pyx_v_s = __pyx_t_2;
28532 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3133
28533 * elif self._r.gt == 1:
28534 * s = PyString_FromStringAndSize( self._r.s[1], self._r.indel2 + 1)
28535 * return "%s/%s" % (s,s) # <<<<<<<<<<<<<<
28537 * return "%s/%s" % (self.first_allele, self.second_allele )
28539 __Pyx_XDECREF(__pyx_r);
28540 __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
28541 __Pyx_GOTREF(__pyx_t_2);
28542 __Pyx_INCREF(__pyx_v_s);
28543 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_s);
28544 __Pyx_GIVEREF(__pyx_v_s);
28545 __Pyx_INCREF(__pyx_v_s);
28546 PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_s);
28547 __Pyx_GIVEREF(__pyx_v_s);
28548 __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_110), __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
28549 __Pyx_GOTREF(((PyObject *)__pyx_t_1));
28550 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
28551 __pyx_r = ((PyObject *)__pyx_t_1);
28557 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3135
28558 * return "%s/%s" % (s,s)
28560 * return "%s/%s" % (self.first_allele, self.second_allele ) # <<<<<<<<<<<<<<
28562 * property consensus_quality:
28564 __Pyx_XDECREF(__pyx_r);
28565 __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__first_allele); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
28566 __Pyx_GOTREF(__pyx_t_1);
28567 __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__second_allele); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
28568 __Pyx_GOTREF(__pyx_t_2);
28569 __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
28570 __Pyx_GOTREF(__pyx_t_3);
28571 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
28572 __Pyx_GIVEREF(__pyx_t_1);
28573 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
28574 __Pyx_GIVEREF(__pyx_t_2);
28577 __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_110), __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
28578 __Pyx_GOTREF(((PyObject *)__pyx_t_2));
28579 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
28580 __pyx_r = ((PyObject *)__pyx_t_2);
28586 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
28589 __Pyx_XDECREF(__pyx_t_1);
28590 __Pyx_XDECREF(__pyx_t_2);
28591 __Pyx_XDECREF(__pyx_t_3);
28592 __Pyx_AddTraceback("csamtools.IndelCall.genotype.__get__");
28595 __Pyx_DECREF(__pyx_v_s);
28596 __Pyx_XGIVEREF(__pyx_r);
28597 __Pyx_TraceReturn(__pyx_r);
28598 __Pyx_RefNannyFinishContext();
28602 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3139
28603 * property consensus_quality:
28604 * '''the genotype quality (Phred-scaled).'''
28605 * def __get__(self): return self._r.q_cns # <<<<<<<<<<<<<<
28607 * property snp_quality:
28610 static PyObject *__pyx_pf_9csamtools_9IndelCall_17consensus_quality___get__(PyObject *__pyx_v_self); /*proto*/
28611 static PyObject *__pyx_pf_9csamtools_9IndelCall_17consensus_quality___get__(PyObject *__pyx_v_self) {
28612 PyObject *__pyx_r = NULL;
28613 PyObject *__pyx_t_1 = NULL;
28614 __Pyx_TraceDeclarations
28615 __Pyx_RefNannySetupContext("__get__");
28616 __Pyx_TraceCall("__get__", __pyx_f[0], 3139);
28617 __Pyx_XDECREF(__pyx_r);
28618 __pyx_t_1 = PyInt_FromLong(((struct __pyx_obj_9csamtools_IndelCall *)__pyx_v_self)->_r->q_cns); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
28619 __Pyx_GOTREF(__pyx_t_1);
28620 __pyx_r = __pyx_t_1;
28624 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
28627 __Pyx_XDECREF(__pyx_t_1);
28628 __Pyx_AddTraceback("csamtools.IndelCall.consensus_quality.__get__");
28631 __Pyx_XGIVEREF(__pyx_r);
28632 __Pyx_TraceReturn(__pyx_r);
28633 __Pyx_RefNannyFinishContext();
28637 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3143
28638 * property snp_quality:
28639 * '''the snp quality (Phred scaled) - probability of consensus being identical to reference sequence.'''
28640 * def __get__(self): return self._r.q_ref # <<<<<<<<<<<<<<
28642 * property mapping_quality:
28645 static PyObject *__pyx_pf_9csamtools_9IndelCall_11snp_quality___get__(PyObject *__pyx_v_self); /*proto*/
28646 static PyObject *__pyx_pf_9csamtools_9IndelCall_11snp_quality___get__(PyObject *__pyx_v_self) {
28647 PyObject *__pyx_r = NULL;
28648 PyObject *__pyx_t_1 = NULL;
28649 __Pyx_TraceDeclarations
28650 __Pyx_RefNannySetupContext("__get__");
28651 __Pyx_TraceCall("__get__", __pyx_f[0], 3143);
28652 __Pyx_XDECREF(__pyx_r);
28653 __pyx_t_1 = PyInt_FromLong(((struct __pyx_obj_9csamtools_IndelCall *)__pyx_v_self)->_r->q_ref); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
28654 __Pyx_GOTREF(__pyx_t_1);
28655 __pyx_r = __pyx_t_1;
28659 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
28662 __Pyx_XDECREF(__pyx_t_1);
28663 __Pyx_AddTraceback("csamtools.IndelCall.snp_quality.__get__");
28666 __Pyx_XGIVEREF(__pyx_r);
28667 __Pyx_TraceReturn(__pyx_r);
28668 __Pyx_RefNannyFinishContext();
28672 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3147
28673 * property mapping_quality:
28674 * '''the root mean square (rms) of the mapping quality of all reads involved in the call.'''
28675 * def __get__(self): return self._rms_mapping_quality # <<<<<<<<<<<<<<
28677 * property coverage:
28680 static PyObject *__pyx_pf_9csamtools_9IndelCall_15mapping_quality___get__(PyObject *__pyx_v_self); /*proto*/
28681 static PyObject *__pyx_pf_9csamtools_9IndelCall_15mapping_quality___get__(PyObject *__pyx_v_self) {
28682 PyObject *__pyx_r = NULL;
28683 PyObject *__pyx_t_1 = NULL;
28684 __Pyx_TraceDeclarations
28685 __Pyx_RefNannySetupContext("__get__");
28686 __Pyx_TraceCall("__get__", __pyx_f[0], 3147);
28687 __Pyx_XDECREF(__pyx_r);
28688 __pyx_t_1 = PyInt_FromLong(((struct __pyx_obj_9csamtools_IndelCall *)__pyx_v_self)->_rms_mapping_quality); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
28689 __Pyx_GOTREF(__pyx_t_1);
28690 __pyx_r = __pyx_t_1;
28694 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
28697 __Pyx_XDECREF(__pyx_t_1);
28698 __Pyx_AddTraceback("csamtools.IndelCall.mapping_quality.__get__");
28701 __Pyx_XGIVEREF(__pyx_r);
28702 __Pyx_TraceReturn(__pyx_r);
28703 __Pyx_RefNannyFinishContext();
28707 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3151
28708 * property coverage:
28709 * '''coverage or read depth - the number of reads involved in the call.'''
28710 * def __get__(self): return self._coverage # <<<<<<<<<<<<<<
28712 * property first_allele:
28715 static PyObject *__pyx_pf_9csamtools_9IndelCall_8coverage___get__(PyObject *__pyx_v_self); /*proto*/
28716 static PyObject *__pyx_pf_9csamtools_9IndelCall_8coverage___get__(PyObject *__pyx_v_self) {
28717 PyObject *__pyx_r = NULL;
28718 PyObject *__pyx_t_1 = NULL;
28719 __Pyx_TraceDeclarations
28720 __Pyx_RefNannySetupContext("__get__");
28721 __Pyx_TraceCall("__get__", __pyx_f[0], 3151);
28722 __Pyx_XDECREF(__pyx_r);
28723 __pyx_t_1 = PyInt_FromLong(((struct __pyx_obj_9csamtools_IndelCall *)__pyx_v_self)->_coverage); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
28724 __Pyx_GOTREF(__pyx_t_1);
28725 __pyx_r = __pyx_t_1;
28729 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
28732 __Pyx_XDECREF(__pyx_t_1);
28733 __Pyx_AddTraceback("csamtools.IndelCall.coverage.__get__");
28736 __Pyx_XGIVEREF(__pyx_r);
28737 __Pyx_TraceReturn(__pyx_r);
28738 __Pyx_RefNannyFinishContext();
28742 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3155
28743 * property first_allele:
28744 * '''sequence of first allele.'''
28745 * def __get__(self): return PyString_FromStringAndSize( self._r.s[0], self._r.indel1 + 1) # <<<<<<<<<<<<<<
28747 * property second_allele:
28750 static PyObject *__pyx_pf_9csamtools_9IndelCall_12first_allele___get__(PyObject *__pyx_v_self); /*proto*/
28751 static PyObject *__pyx_pf_9csamtools_9IndelCall_12first_allele___get__(PyObject *__pyx_v_self) {
28752 PyObject *__pyx_r = NULL;
28753 PyObject *__pyx_t_1 = NULL;
28754 __Pyx_TraceDeclarations
28755 __Pyx_RefNannySetupContext("__get__");
28756 __Pyx_TraceCall("__get__", __pyx_f[0], 3155);
28757 __Pyx_XDECREF(__pyx_r);
28758 __pyx_t_1 = PyString_FromStringAndSize((((struct __pyx_obj_9csamtools_IndelCall *)__pyx_v_self)->_r->s[0]), (((struct __pyx_obj_9csamtools_IndelCall *)__pyx_v_self)->_r->indel1 + 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
28759 __Pyx_GOTREF(__pyx_t_1);
28760 __pyx_r = __pyx_t_1;
28764 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
28767 __Pyx_XDECREF(__pyx_t_1);
28768 __Pyx_AddTraceback("csamtools.IndelCall.first_allele.__get__");
28771 __Pyx_XGIVEREF(__pyx_r);
28772 __Pyx_TraceReturn(__pyx_r);
28773 __Pyx_RefNannyFinishContext();
28777 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3159
28778 * property second_allele:
28779 * '''sequence of second allele.'''
28780 * def __get__(self): return PyString_FromStringAndSize( self._r.s[1], self._r.indel2 + 1) # <<<<<<<<<<<<<<
28782 * property reads_first:
28785 static PyObject *__pyx_pf_9csamtools_9IndelCall_13second_allele___get__(PyObject *__pyx_v_self); /*proto*/
28786 static PyObject *__pyx_pf_9csamtools_9IndelCall_13second_allele___get__(PyObject *__pyx_v_self) {
28787 PyObject *__pyx_r = NULL;
28788 PyObject *__pyx_t_1 = NULL;
28789 __Pyx_TraceDeclarations
28790 __Pyx_RefNannySetupContext("__get__");
28791 __Pyx_TraceCall("__get__", __pyx_f[0], 3159);
28792 __Pyx_XDECREF(__pyx_r);
28793 __pyx_t_1 = PyString_FromStringAndSize((((struct __pyx_obj_9csamtools_IndelCall *)__pyx_v_self)->_r->s[1]), (((struct __pyx_obj_9csamtools_IndelCall *)__pyx_v_self)->_r->indel2 + 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
28794 __Pyx_GOTREF(__pyx_t_1);
28795 __pyx_r = __pyx_t_1;
28799 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
28802 __Pyx_XDECREF(__pyx_t_1);
28803 __Pyx_AddTraceback("csamtools.IndelCall.second_allele.__get__");
28806 __Pyx_XGIVEREF(__pyx_r);
28807 __Pyx_TraceReturn(__pyx_r);
28808 __Pyx_RefNannyFinishContext();
28812 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3163
28813 * property reads_first:
28814 * '''reads supporting first allele.'''
28815 * def __get__(self): return self._r.cnt1 # <<<<<<<<<<<<<<
28817 * property reads_second:
28820 static PyObject *__pyx_pf_9csamtools_9IndelCall_11reads_first___get__(PyObject *__pyx_v_self); /*proto*/
28821 static PyObject *__pyx_pf_9csamtools_9IndelCall_11reads_first___get__(PyObject *__pyx_v_self) {
28822 PyObject *__pyx_r = NULL;
28823 PyObject *__pyx_t_1 = NULL;
28824 __Pyx_TraceDeclarations
28825 __Pyx_RefNannySetupContext("__get__");
28826 __Pyx_TraceCall("__get__", __pyx_f[0], 3163);
28827 __Pyx_XDECREF(__pyx_r);
28828 __pyx_t_1 = PyInt_FromLong(((struct __pyx_obj_9csamtools_IndelCall *)__pyx_v_self)->_r->cnt1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
28829 __Pyx_GOTREF(__pyx_t_1);
28830 __pyx_r = __pyx_t_1;
28834 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
28837 __Pyx_XDECREF(__pyx_t_1);
28838 __Pyx_AddTraceback("csamtools.IndelCall.reads_first.__get__");
28841 __Pyx_XGIVEREF(__pyx_r);
28842 __Pyx_TraceReturn(__pyx_r);
28843 __Pyx_RefNannyFinishContext();
28847 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3167
28848 * property reads_second:
28849 * '''reads supporting first allele.'''
28850 * def __get__(self): return self._r.cnt2 # <<<<<<<<<<<<<<
28852 * property reads_diff:
28855 static PyObject *__pyx_pf_9csamtools_9IndelCall_12reads_second___get__(PyObject *__pyx_v_self); /*proto*/
28856 static PyObject *__pyx_pf_9csamtools_9IndelCall_12reads_second___get__(PyObject *__pyx_v_self) {
28857 PyObject *__pyx_r = NULL;
28858 PyObject *__pyx_t_1 = NULL;
28859 __Pyx_TraceDeclarations
28860 __Pyx_RefNannySetupContext("__get__");
28861 __Pyx_TraceCall("__get__", __pyx_f[0], 3167);
28862 __Pyx_XDECREF(__pyx_r);
28863 __pyx_t_1 = PyInt_FromLong(((struct __pyx_obj_9csamtools_IndelCall *)__pyx_v_self)->_r->cnt2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
28864 __Pyx_GOTREF(__pyx_t_1);
28865 __pyx_r = __pyx_t_1;
28869 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
28872 __Pyx_XDECREF(__pyx_t_1);
28873 __Pyx_AddTraceback("csamtools.IndelCall.reads_second.__get__");
28876 __Pyx_XGIVEREF(__pyx_r);
28877 __Pyx_TraceReturn(__pyx_r);
28878 __Pyx_RefNannyFinishContext();
28882 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3171
28883 * property reads_diff:
28884 * '''reads supporting first allele.'''
28885 * def __get__(self): return self._r.cnt_anti # <<<<<<<<<<<<<<
28887 * def __str__(self):
28890 static PyObject *__pyx_pf_9csamtools_9IndelCall_10reads_diff___get__(PyObject *__pyx_v_self); /*proto*/
28891 static PyObject *__pyx_pf_9csamtools_9IndelCall_10reads_diff___get__(PyObject *__pyx_v_self) {
28892 PyObject *__pyx_r = NULL;
28893 PyObject *__pyx_t_1 = NULL;
28894 __Pyx_TraceDeclarations
28895 __Pyx_RefNannySetupContext("__get__");
28896 __Pyx_TraceCall("__get__", __pyx_f[0], 3171);
28897 __Pyx_XDECREF(__pyx_r);
28898 __pyx_t_1 = PyInt_FromLong(((struct __pyx_obj_9csamtools_IndelCall *)__pyx_v_self)->_r->cnt_anti); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
28899 __Pyx_GOTREF(__pyx_t_1);
28900 __pyx_r = __pyx_t_1;
28904 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
28907 __Pyx_XDECREF(__pyx_t_1);
28908 __Pyx_AddTraceback("csamtools.IndelCall.reads_diff.__get__");
28911 __Pyx_XGIVEREF(__pyx_r);
28912 __Pyx_TraceReturn(__pyx_r);
28913 __Pyx_RefNannyFinishContext();
28917 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3173
28918 * def __get__(self): return self._r.cnt_anti
28920 * def __str__(self): # <<<<<<<<<<<<<<
28922 * return "\t".join( map(str, (
28925 static PyObject *__pyx_pf_9csamtools_9IndelCall___str__(PyObject *__pyx_v_self); /*proto*/
28926 static PyObject *__pyx_pf_9csamtools_9IndelCall___str__(PyObject *__pyx_v_self) {
28927 PyObject *__pyx_r = NULL;
28928 PyObject *__pyx_t_1 = NULL;
28929 PyObject *__pyx_t_2 = NULL;
28930 PyObject *__pyx_t_3 = NULL;
28931 PyObject *__pyx_t_4 = NULL;
28932 PyObject *__pyx_t_5 = NULL;
28933 PyObject *__pyx_t_6 = NULL;
28934 PyObject *__pyx_t_7 = NULL;
28935 PyObject *__pyx_t_8 = NULL;
28936 PyObject *__pyx_t_9 = NULL;
28937 PyObject *__pyx_t_10 = NULL;
28938 PyObject *__pyx_t_11 = NULL;
28939 PyObject *__pyx_t_12 = NULL;
28940 PyObject *__pyx_t_13 = NULL;
28941 PyObject *__pyx_t_14 = NULL;
28942 __Pyx_TraceDeclarations
28943 __Pyx_RefNannySetupContext("__str__");
28944 __Pyx_TraceCall("__str__", __pyx_f[0], 3173);
28946 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3175
28947 * def __str__(self):
28949 * return "\t".join( map(str, ( # <<<<<<<<<<<<<<
28953 __Pyx_XDECREF(__pyx_r);
28954 __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 = 3175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
28955 __Pyx_GOTREF(__pyx_t_1);
28957 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3176
28959 * return "\t".join( map(str, (
28960 * self.tid, # <<<<<<<<<<<<<<
28964 __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__tid); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
28965 __Pyx_GOTREF(__pyx_t_2);
28967 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3177
28968 * return "\t".join( map(str, (
28970 * self.pos, # <<<<<<<<<<<<<<
28972 * self.consensus_quality,
28974 __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__pos); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
28975 __Pyx_GOTREF(__pyx_t_3);
28977 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3178
28980 * self.genotype, # <<<<<<<<<<<<<<
28981 * self.consensus_quality,
28982 * self.snp_quality,
28984 __pyx_t_4 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__genotype); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
28985 __Pyx_GOTREF(__pyx_t_4);
28987 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3179
28990 * self.consensus_quality, # <<<<<<<<<<<<<<
28991 * self.snp_quality,
28992 * self.mapping_quality,
28994 __pyx_t_5 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__consensus_quality); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
28995 __Pyx_GOTREF(__pyx_t_5);
28997 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3180
28999 * self.consensus_quality,
29000 * self.snp_quality, # <<<<<<<<<<<<<<
29001 * self.mapping_quality,
29004 __pyx_t_6 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__snp_quality); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
29005 __Pyx_GOTREF(__pyx_t_6);
29007 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3181
29008 * self.consensus_quality,
29009 * self.snp_quality,
29010 * self.mapping_quality, # <<<<<<<<<<<<<<
29012 * self.first_allele,
29014 __pyx_t_7 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__mapping_quality); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
29015 __Pyx_GOTREF(__pyx_t_7);
29017 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3182
29018 * self.snp_quality,
29019 * self.mapping_quality,
29020 * self.coverage, # <<<<<<<<<<<<<<
29021 * self.first_allele,
29022 * self.second_allele,
29024 __pyx_t_8 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__coverage); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
29025 __Pyx_GOTREF(__pyx_t_8);
29027 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3183
29028 * self.mapping_quality,
29030 * self.first_allele, # <<<<<<<<<<<<<<
29031 * self.second_allele,
29032 * self.reads_first,
29034 __pyx_t_9 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__first_allele); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
29035 __Pyx_GOTREF(__pyx_t_9);
29037 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3184
29039 * self.first_allele,
29040 * self.second_allele, # <<<<<<<<<<<<<<
29041 * self.reads_first,
29042 * self.reads_second,
29044 __pyx_t_10 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__second_allele); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
29045 __Pyx_GOTREF(__pyx_t_10);
29047 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3185
29048 * self.first_allele,
29049 * self.second_allele,
29050 * self.reads_first, # <<<<<<<<<<<<<<
29051 * self.reads_second,
29052 * self.reads_diff ) ) )
29054 __pyx_t_11 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__reads_first); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
29055 __Pyx_GOTREF(__pyx_t_11);
29057 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3186
29058 * self.second_allele,
29059 * self.reads_first,
29060 * self.reads_second, # <<<<<<<<<<<<<<
29061 * self.reads_diff ) ) )
29064 __pyx_t_12 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__reads_second); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
29065 __Pyx_GOTREF(__pyx_t_12);
29067 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3187
29068 * self.reads_first,
29069 * self.reads_second,
29070 * self.reads_diff ) ) ) # <<<<<<<<<<<<<<
29072 * def __dealloc__(self ):
29074 __pyx_t_13 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__reads_diff); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
29075 __Pyx_GOTREF(__pyx_t_13);
29076 __pyx_t_14 = PyTuple_New(12); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
29077 __Pyx_GOTREF(__pyx_t_14);
29078 PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_2);
29079 __Pyx_GIVEREF(__pyx_t_2);
29080 PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_t_3);
29081 __Pyx_GIVEREF(__pyx_t_3);
29082 PyTuple_SET_ITEM(__pyx_t_14, 2, __pyx_t_4);
29083 __Pyx_GIVEREF(__pyx_t_4);
29084 PyTuple_SET_ITEM(__pyx_t_14, 3, __pyx_t_5);
29085 __Pyx_GIVEREF(__pyx_t_5);
29086 PyTuple_SET_ITEM(__pyx_t_14, 4, __pyx_t_6);
29087 __Pyx_GIVEREF(__pyx_t_6);
29088 PyTuple_SET_ITEM(__pyx_t_14, 5, __pyx_t_7);
29089 __Pyx_GIVEREF(__pyx_t_7);
29090 PyTuple_SET_ITEM(__pyx_t_14, 6, __pyx_t_8);
29091 __Pyx_GIVEREF(__pyx_t_8);
29092 PyTuple_SET_ITEM(__pyx_t_14, 7, __pyx_t_9);
29093 __Pyx_GIVEREF(__pyx_t_9);
29094 PyTuple_SET_ITEM(__pyx_t_14, 8, __pyx_t_10);
29095 __Pyx_GIVEREF(__pyx_t_10);
29096 PyTuple_SET_ITEM(__pyx_t_14, 9, __pyx_t_11);
29097 __Pyx_GIVEREF(__pyx_t_11);
29098 PyTuple_SET_ITEM(__pyx_t_14, 10, __pyx_t_12);
29099 __Pyx_GIVEREF(__pyx_t_12);
29100 PyTuple_SET_ITEM(__pyx_t_14, 11, __pyx_t_13);
29101 __Pyx_GIVEREF(__pyx_t_13);
29114 __pyx_t_13 = PyTuple_New(2); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
29115 __Pyx_GOTREF(__pyx_t_13);
29116 __Pyx_INCREF(((PyObject *)((PyObject*)&PyString_Type)));
29117 PyTuple_SET_ITEM(__pyx_t_13, 0, ((PyObject *)((PyObject*)&PyString_Type)));
29118 __Pyx_GIVEREF(((PyObject *)((PyObject*)&PyString_Type)));
29119 PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_14);
29120 __Pyx_GIVEREF(__pyx_t_14);
29122 __pyx_t_14 = PyObject_Call(__pyx_builtin_map, __pyx_t_13, NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
29123 __Pyx_GOTREF(__pyx_t_14);
29124 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
29125 __pyx_t_13 = PyTuple_New(1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
29126 __Pyx_GOTREF(__pyx_t_13);
29127 PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_14);
29128 __Pyx_GIVEREF(__pyx_t_14);
29130 __pyx_t_14 = PyObject_Call(__pyx_t_1, __pyx_t_13, NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
29131 __Pyx_GOTREF(__pyx_t_14);
29132 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
29133 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
29134 __pyx_r = __pyx_t_14;
29138 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
29141 __Pyx_XDECREF(__pyx_t_1);
29142 __Pyx_XDECREF(__pyx_t_2);
29143 __Pyx_XDECREF(__pyx_t_3);
29144 __Pyx_XDECREF(__pyx_t_4);
29145 __Pyx_XDECREF(__pyx_t_5);
29146 __Pyx_XDECREF(__pyx_t_6);
29147 __Pyx_XDECREF(__pyx_t_7);
29148 __Pyx_XDECREF(__pyx_t_8);
29149 __Pyx_XDECREF(__pyx_t_9);
29150 __Pyx_XDECREF(__pyx_t_10);
29151 __Pyx_XDECREF(__pyx_t_11);
29152 __Pyx_XDECREF(__pyx_t_12);
29153 __Pyx_XDECREF(__pyx_t_13);
29154 __Pyx_XDECREF(__pyx_t_14);
29155 __Pyx_AddTraceback("csamtools.IndelCall.__str__");
29158 __Pyx_XGIVEREF(__pyx_r);
29159 __Pyx_TraceReturn(__pyx_r);
29160 __Pyx_RefNannyFinishContext();
29164 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3189
29165 * self.reads_diff ) ) )
29167 * def __dealloc__(self ): # <<<<<<<<<<<<<<
29168 * bam_maqindel_ret_destroy(self._r)
29172 static void __pyx_pf_9csamtools_9IndelCall___dealloc__(PyObject *__pyx_v_self); /*proto*/
29173 static void __pyx_pf_9csamtools_9IndelCall___dealloc__(PyObject *__pyx_v_self) {
29174 __Pyx_TraceDeclarations
29175 __Pyx_RefNannySetupContext("__dealloc__");
29176 __Pyx_TraceCall("__dealloc__", __pyx_f[0], 3189);
29178 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3190
29180 * def __dealloc__(self ):
29181 * bam_maqindel_ret_destroy(self._r) # <<<<<<<<<<<<<<
29183 * cdef class IndelCallerBase:
29185 bam_maqindel_ret_destroy(((struct __pyx_obj_9csamtools_IndelCall *)__pyx_v_self)->_r);
29187 __Pyx_TraceReturn(Py_None);
29188 __Pyx_RefNannyFinishContext();
29191 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3212
29192 * cdef int max_depth
29194 * def __cinit__(self, # <<<<<<<<<<<<<<
29195 * IteratorColumn iterator_column,
29199 static int __pyx_pf_9csamtools_15IndelCallerBase___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
29200 static int __pyx_pf_9csamtools_15IndelCallerBase___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
29201 struct __pyx_obj_9csamtools_IteratorColumn *__pyx_v_iterator_column = 0;
29202 PyObject *__pyx_v_kwargs = 0;
29204 PyObject *__pyx_t_1 = NULL;
29205 PyObject *__pyx_t_2 = NULL;
29209 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__iterator_column,0};
29210 __Pyx_TraceDeclarations
29211 __Pyx_RefNannySetupContext("__cinit__");
29212 __Pyx_TraceCall("__cinit__", __pyx_f[0], 3212);
29213 __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return -1;
29214 __Pyx_GOTREF(__pyx_v_kwargs);
29215 if (unlikely(__pyx_kwds)) {
29216 Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
29217 PyObject* values[1] = {0};
29218 switch (PyTuple_GET_SIZE(__pyx_args)) {
29219 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
29221 default: goto __pyx_L5_argtuple_error;
29223 switch (PyTuple_GET_SIZE(__pyx_args)) {
29225 values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__iterator_column);
29226 if (likely(values[0])) kw_args--;
29227 else goto __pyx_L5_argtuple_error;
29229 if (unlikely(kw_args > 0)) {
29230 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, PyTuple_GET_SIZE(__pyx_args), "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3212; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
29232 __pyx_v_iterator_column = ((struct __pyx_obj_9csamtools_IteratorColumn *)values[0]);
29233 } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
29234 goto __pyx_L5_argtuple_error;
29236 __pyx_v_iterator_column = ((struct __pyx_obj_9csamtools_IteratorColumn *)PyTuple_GET_ITEM(__pyx_args, 0));
29238 goto __pyx_L4_argument_unpacking_done;
29239 __pyx_L5_argtuple_error:;
29240 __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3212; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
29242 __Pyx_DECREF(__pyx_v_kwargs);
29243 __Pyx_AddTraceback("csamtools.IndelCallerBase.__cinit__");
29244 __Pyx_RefNannyFinishContext();
29246 __pyx_L4_argument_unpacking_done:;
29247 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_iterator_column), __pyx_ptype_9csamtools_IteratorColumn, 1, "iterator_column", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
29249 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3217
29252 * self.iter = iterator_column # <<<<<<<<<<<<<<
29254 * assert iterator_column.hasReference(), "IndelCallerBase requires an pileup iterator with reference sequence"
29256 __Pyx_INCREF(((PyObject *)__pyx_v_iterator_column));
29257 __Pyx_GIVEREF(((PyObject *)__pyx_v_iterator_column));
29258 __Pyx_GOTREF(((struct __pyx_obj_9csamtools_IndelCallerBase *)__pyx_v_self)->iter);
29259 __Pyx_DECREF(((PyObject *)((struct __pyx_obj_9csamtools_IndelCallerBase *)__pyx_v_self)->iter));
29260 ((struct __pyx_obj_9csamtools_IndelCallerBase *)__pyx_v_self)->iter = __pyx_v_iterator_column;
29262 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3219
29263 * self.iter = iterator_column
29265 * assert iterator_column.hasReference(), "IndelCallerBase requires an pileup iterator with reference sequence" # <<<<<<<<<<<<<<
29267 * self.options = bam_maqindel_opt_init()
29269 #ifndef PYREX_WITHOUT_ASSERTIONS
29270 __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_iterator_column), __pyx_n_s__hasReference); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
29271 __Pyx_GOTREF(__pyx_t_1);
29272 __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 = 3219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
29273 __Pyx_GOTREF(__pyx_t_2);
29274 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
29275 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
29276 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
29277 if (unlikely(!__pyx_t_3)) {
29278 PyErr_SetObject(PyExc_AssertionError, ((PyObject *)__pyx_kp_s_111));
29279 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
29283 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3221
29284 * assert iterator_column.hasReference(), "IndelCallerBase requires an pileup iterator with reference sequence"
29286 * self.options = bam_maqindel_opt_init() # <<<<<<<<<<<<<<
29288 * # set the default parameterization according to
29290 ((struct __pyx_obj_9csamtools_IndelCallerBase *)__pyx_v_self)->options = bam_maqindel_opt_init();
29292 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3226
29295 * self.options.r_indel = kwargs.get( "r_indel", 0.00015 ) # <<<<<<<<<<<<<<
29296 * self.options.q_indel = kwargs.get( "q_indel", 40 )
29297 * self.cap_mapQ = kwargs.get( "cap_mapQ", 60 )
29299 if (unlikely(__pyx_v_kwargs == Py_None)) {
29300 PyErr_SetString(PyExc_AttributeError, "'NoneType' object has no attribute 'get'"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
29302 __pyx_t_2 = PyFloat_FromDouble(0.00015); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
29303 __Pyx_GOTREF(__pyx_t_2);
29304 __pyx_t_1 = __Pyx_PyDict_GetItemDefault(((PyObject *)__pyx_v_kwargs), ((PyObject *)__pyx_n_s__r_indel), __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
29305 __Pyx_GOTREF(__pyx_t_1);
29306 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
29307 __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_4 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
29308 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
29309 ((struct __pyx_obj_9csamtools_IndelCallerBase *)__pyx_v_self)->options->r_indel = __pyx_t_4;
29311 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3227
29313 * self.options.r_indel = kwargs.get( "r_indel", 0.00015 )
29314 * self.options.q_indel = kwargs.get( "q_indel", 40 ) # <<<<<<<<<<<<<<
29315 * self.cap_mapQ = kwargs.get( "cap_mapQ", 60 )
29316 * self.max_depth = kwargs.get( "max_depth", 1024 )
29318 if (unlikely(__pyx_v_kwargs == Py_None)) {
29319 PyErr_SetString(PyExc_AttributeError, "'NoneType' object has no attribute 'get'"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
29321 __pyx_t_1 = __Pyx_PyDict_GetItemDefault(((PyObject *)__pyx_v_kwargs), ((PyObject *)__pyx_n_s__q_indel), __pyx_int_40); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
29322 __Pyx_GOTREF(__pyx_t_1);
29323 __pyx_t_5 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
29324 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
29325 ((struct __pyx_obj_9csamtools_IndelCallerBase *)__pyx_v_self)->options->q_indel = __pyx_t_5;
29327 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3228
29328 * self.options.r_indel = kwargs.get( "r_indel", 0.00015 )
29329 * self.options.q_indel = kwargs.get( "q_indel", 40 )
29330 * self.cap_mapQ = kwargs.get( "cap_mapQ", 60 ) # <<<<<<<<<<<<<<
29331 * self.max_depth = kwargs.get( "max_depth", 1024 )
29334 if (unlikely(__pyx_v_kwargs == Py_None)) {
29335 PyErr_SetString(PyExc_AttributeError, "'NoneType' object has no attribute 'get'"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
29337 __pyx_t_1 = __Pyx_PyDict_GetItemDefault(((PyObject *)__pyx_v_kwargs), ((PyObject *)__pyx_n_s__cap_mapQ), __pyx_int_60); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
29338 __Pyx_GOTREF(__pyx_t_1);
29339 __pyx_t_5 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
29340 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
29341 ((struct __pyx_obj_9csamtools_IndelCallerBase *)__pyx_v_self)->cap_mapQ = __pyx_t_5;
29343 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3229
29344 * self.options.q_indel = kwargs.get( "q_indel", 40 )
29345 * self.cap_mapQ = kwargs.get( "cap_mapQ", 60 )
29346 * self.max_depth = kwargs.get( "max_depth", 1024 ) # <<<<<<<<<<<<<<
29348 * def __dealloc__(self):
29350 if (unlikely(__pyx_v_kwargs == Py_None)) {
29351 PyErr_SetString(PyExc_AttributeError, "'NoneType' object has no attribute 'get'"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3229; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
29353 __pyx_t_1 = __Pyx_PyDict_GetItemDefault(((PyObject *)__pyx_v_kwargs), ((PyObject *)__pyx_n_s__max_depth), __pyx_int_1024); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3229; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
29354 __Pyx_GOTREF(__pyx_t_1);
29355 __pyx_t_5 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3229; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
29356 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
29357 ((struct __pyx_obj_9csamtools_IndelCallerBase *)__pyx_v_self)->max_depth = __pyx_t_5;
29362 __Pyx_XDECREF(__pyx_t_1);
29363 __Pyx_XDECREF(__pyx_t_2);
29364 __Pyx_AddTraceback("csamtools.IndelCallerBase.__cinit__");
29367 __Pyx_DECREF(__pyx_v_kwargs);
29368 __Pyx_TraceReturn(Py_None);
29369 __Pyx_RefNannyFinishContext();
29373 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3231
29374 * self.max_depth = kwargs.get( "max_depth", 1024 )
29376 * def __dealloc__(self): # <<<<<<<<<<<<<<
29377 * free( self.options )
29381 static void __pyx_pf_9csamtools_15IndelCallerBase___dealloc__(PyObject *__pyx_v_self); /*proto*/
29382 static void __pyx_pf_9csamtools_15IndelCallerBase___dealloc__(PyObject *__pyx_v_self) {
29383 __Pyx_TraceDeclarations
29384 __Pyx_RefNannySetupContext("__dealloc__");
29385 __Pyx_TraceCall("__dealloc__", __pyx_f[0], 3231);
29387 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3232
29389 * def __dealloc__(self):
29390 * free( self.options ) # <<<<<<<<<<<<<<
29392 * def _call( self ):
29394 free(((struct __pyx_obj_9csamtools_IndelCallerBase *)__pyx_v_self)->options);
29396 __Pyx_TraceReturn(Py_None);
29397 __Pyx_RefNannyFinishContext();
29400 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3234
29401 * free( self.options )
29403 * def _call( self ): # <<<<<<<<<<<<<<
29405 * cdef char * seq = self.iter.getSequence()
29408 static PyObject *__pyx_pf_9csamtools_15IndelCallerBase__call(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
29409 static char __pyx_doc_9csamtools_15IndelCallerBase__call[] = "IndelCallerBase._call(self)";
29410 static PyObject *__pyx_pf_9csamtools_15IndelCallerBase__call(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
29412 int __pyx_v_seq_len;
29413 bam_maqindel_ret_t *__pyx_v_r;
29415 struct __pyx_obj_9csamtools_IndelCall *__pyx_v_call;
29416 uint64_t __pyx_v_rms_aux;
29418 bam_pileup1_t *__pyx_v_p;
29420 PyObject *__pyx_r = NULL;
29421 PyObject *__pyx_t_1 = NULL;
29424 PyObject *__pyx_t_4 = NULL;
29425 PyObject *__pyx_t_5 = NULL;
29429 __Pyx_TraceDeclarations
29430 __Pyx_RefNannySetupContext("_call");
29431 __Pyx_TraceCall("_call", __pyx_f[0], 3234);
29432 __pyx_v_call = ((struct __pyx_obj_9csamtools_IndelCall *)Py_None); __Pyx_INCREF(Py_None);
29434 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3236
29435 * def _call( self ):
29437 * cdef char * seq = self.iter.getSequence() # <<<<<<<<<<<<<<
29438 * cdef int seq_len = self.iter.seq_len
29441 __pyx_v_seq = ((struct __pyx_vtabstruct_9csamtools_IteratorColumn *)((struct __pyx_obj_9csamtools_IndelCallerBase *)__pyx_v_self)->iter->__pyx_vtab)->getSequence(((struct __pyx_obj_9csamtools_IndelCallerBase *)__pyx_v_self)->iter);
29443 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3237
29445 * cdef char * seq = self.iter.getSequence()
29446 * cdef int seq_len = self.iter.seq_len # <<<<<<<<<<<<<<
29448 * assert seq != NULL
29450 __pyx_t_1 = PyObject_GetAttr(((PyObject *)((struct __pyx_obj_9csamtools_IndelCallerBase *)__pyx_v_self)->iter), __pyx_n_s__seq_len); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
29451 __Pyx_GOTREF(__pyx_t_1);
29452 __pyx_t_2 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
29453 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
29454 __pyx_v_seq_len = __pyx_t_2;
29456 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3239
29457 * cdef int seq_len = self.iter.seq_len
29459 * assert seq != NULL # <<<<<<<<<<<<<<
29463 #ifndef PYREX_WITHOUT_ASSERTIONS
29464 if (unlikely(!(__pyx_v_seq != NULL))) {
29465 PyErr_SetNone(PyExc_AssertionError);
29466 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
29470 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3242
29473 * if self.iter.pos >= seq_len: # <<<<<<<<<<<<<<
29474 * raise ValueError( "position %i out of bounds on reference sequence (len=%i)" % (self.iter.pos, seq_len) )
29477 __pyx_t_3 = (((struct __pyx_obj_9csamtools_IndelCallerBase *)__pyx_v_self)->iter->pos >= __pyx_v_seq_len);
29480 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3243
29482 * if self.iter.pos >= seq_len:
29483 * raise ValueError( "position %i out of bounds on reference sequence (len=%i)" % (self.iter.pos, seq_len) ) # <<<<<<<<<<<<<<
29485 * cdef bam_maqindel_ret_t * r
29487 __pyx_t_1 = PyInt_FromLong(((struct __pyx_obj_9csamtools_IndelCallerBase *)__pyx_v_self)->iter->pos); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3243; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
29488 __Pyx_GOTREF(__pyx_t_1);
29489 __pyx_t_4 = PyInt_FromLong(__pyx_v_seq_len); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3243; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
29490 __Pyx_GOTREF(__pyx_t_4);
29491 __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3243; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
29492 __Pyx_GOTREF(__pyx_t_5);
29493 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
29494 __Pyx_GIVEREF(__pyx_t_1);
29495 PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4);
29496 __Pyx_GIVEREF(__pyx_t_4);
29499 __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_108), __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3243; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
29500 __Pyx_GOTREF(((PyObject *)__pyx_t_4));
29501 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
29502 __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3243; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
29503 __Pyx_GOTREF(__pyx_t_5);
29504 PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_4));
29505 __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
29507 __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3243; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
29508 __Pyx_GOTREF(__pyx_t_4);
29509 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
29510 __Pyx_Raise(__pyx_t_4, 0, 0);
29511 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
29512 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3243; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
29517 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3247
29518 * cdef bam_maqindel_ret_t * r
29520 * cdef int m = min( self.max_depth, self.iter.n_plp ) # <<<<<<<<<<<<<<
29522 * # printf("pysam: m=%i, q_indel=%i, r_indel=%f, r_snp=%i, mm_penalty=%i, indel_err=%i, ambi_thres=%i\n",
29524 __pyx_t_2 = ((struct __pyx_obj_9csamtools_IndelCallerBase *)__pyx_v_self)->iter->n_plp;
29525 __pyx_t_6 = ((struct __pyx_obj_9csamtools_IndelCallerBase *)__pyx_v_self)->max_depth;
29526 if ((__pyx_t_2 < __pyx_t_6)) {
29527 __pyx_t_7 = __pyx_t_2;
29529 __pyx_t_7 = __pyx_t_6;
29531 __pyx_v_m = __pyx_t_7;
29533 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3259
29536 * NULL) # <<<<<<<<<<<<<<
29538 * if r == NULL: return None
29540 __pyx_v_r = bam_maqindel(__pyx_v_m, ((struct __pyx_obj_9csamtools_IndelCallerBase *)__pyx_v_self)->iter->pos, ((struct __pyx_obj_9csamtools_IndelCallerBase *)__pyx_v_self)->options, ((struct __pyx_obj_9csamtools_IndelCallerBase *)__pyx_v_self)->iter->plp, __pyx_v_seq, 0, NULL);
29542 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3261
29545 * if r == NULL: return None # <<<<<<<<<<<<<<
29547 * cdef IndelCall call
29549 __pyx_t_3 = (__pyx_v_r == NULL);
29551 __Pyx_XDECREF(__pyx_r);
29552 __Pyx_INCREF(Py_None);
29559 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3264
29561 * cdef IndelCall call
29562 * call = IndelCall() # <<<<<<<<<<<<<<
29564 * call._tid = self.iter.tid
29566 __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_9csamtools_IndelCall)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
29567 __Pyx_GOTREF(__pyx_t_4);
29568 __Pyx_DECREF(((PyObject *)__pyx_v_call));
29569 __pyx_v_call = ((struct __pyx_obj_9csamtools_IndelCall *)__pyx_t_4);
29572 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3265
29573 * cdef IndelCall call
29574 * call = IndelCall()
29575 * call._r = r # <<<<<<<<<<<<<<
29576 * call._tid = self.iter.tid
29577 * call._pos = self.iter.pos
29579 __pyx_v_call->_r = __pyx_v_r;
29581 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3266
29582 * call = IndelCall()
29584 * call._tid = self.iter.tid # <<<<<<<<<<<<<<
29585 * call._pos = self.iter.pos
29586 * call._coverage = self.iter.n_plp
29588 __pyx_v_call->_tid = ((struct __pyx_obj_9csamtools_IndelCallerBase *)__pyx_v_self)->iter->tid;
29590 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3267
29592 * call._tid = self.iter.tid
29593 * call._pos = self.iter.pos # <<<<<<<<<<<<<<
29594 * call._coverage = self.iter.n_plp
29597 __pyx_v_call->_pos = ((struct __pyx_obj_9csamtools_IndelCallerBase *)__pyx_v_self)->iter->pos;
29599 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3268
29600 * call._tid = self.iter.tid
29601 * call._pos = self.iter.pos
29602 * call._coverage = self.iter.n_plp # <<<<<<<<<<<<<<
29604 * cdef uint64_t rms_aux = 0
29606 __pyx_v_call->_coverage = ((struct __pyx_obj_9csamtools_IndelCallerBase *)__pyx_v_self)->iter->n_plp;
29608 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3270
29609 * call._coverage = self.iter.n_plp
29611 * cdef uint64_t rms_aux = 0 # <<<<<<<<<<<<<<
29613 * cdef bam_pileup1_t * p
29615 __pyx_v_rms_aux = 0;
29617 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3271
29619 * cdef uint64_t rms_aux = 0
29620 * cdef int i = 0 # <<<<<<<<<<<<<<
29621 * cdef bam_pileup1_t * p
29626 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3275
29629 * for i from 0 <= i < self.iter.n_plp: # <<<<<<<<<<<<<<
29630 * p = self.iter.plp + i
29631 * if p.b.core.qual < self.cap_mapQ:
29633 __pyx_t_7 = ((struct __pyx_obj_9csamtools_IndelCallerBase *)__pyx_v_self)->iter->n_plp;
29634 for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_7; __pyx_v_i++) {
29636 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3276
29638 * for i from 0 <= i < self.iter.n_plp:
29639 * p = self.iter.plp + i # <<<<<<<<<<<<<<
29640 * if p.b.core.qual < self.cap_mapQ:
29641 * tmp = p.b.core.qual
29643 __pyx_v_p = (((struct __pyx_obj_9csamtools_IndelCallerBase *)__pyx_v_self)->iter->plp + __pyx_v_i);
29645 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3277
29646 * for i from 0 <= i < self.iter.n_plp:
29647 * p = self.iter.plp + i
29648 * if p.b.core.qual < self.cap_mapQ: # <<<<<<<<<<<<<<
29649 * tmp = p.b.core.qual
29652 __pyx_t_3 = (__pyx_v_p->b->core.qual < ((struct __pyx_obj_9csamtools_IndelCallerBase *)__pyx_v_self)->cap_mapQ);
29655 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3278
29656 * p = self.iter.plp + i
29657 * if p.b.core.qual < self.cap_mapQ:
29658 * tmp = p.b.core.qual # <<<<<<<<<<<<<<
29660 * tmp = self.cap_mapQ
29662 __pyx_v_tmp = __pyx_v_p->b->core.qual;
29667 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3280
29668 * tmp = p.b.core.qual
29670 * tmp = self.cap_mapQ # <<<<<<<<<<<<<<
29671 * rms_aux += tmp * tmp
29674 __pyx_v_tmp = ((struct __pyx_obj_9csamtools_IndelCallerBase *)__pyx_v_self)->cap_mapQ;
29678 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3281
29680 * tmp = self.cap_mapQ
29681 * rms_aux += tmp * tmp # <<<<<<<<<<<<<<
29683 * call._rms_mapping_quality = <uint64_t>(sqrt(<double>rms_aux / self.iter.n_plp) + .499)
29685 __pyx_v_rms_aux += (__pyx_v_tmp * __pyx_v_tmp);
29688 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3283
29689 * rms_aux += tmp * tmp
29691 * call._rms_mapping_quality = <uint64_t>(sqrt(<double>rms_aux / self.iter.n_plp) + .499) # <<<<<<<<<<<<<<
29695 __pyx_t_8 = ((double)__pyx_v_rms_aux);
29696 if (unlikely(((struct __pyx_obj_9csamtools_IndelCallerBase *)__pyx_v_self)->iter->n_plp == 0)) {
29697 PyErr_Format(PyExc_ZeroDivisionError, "float division");
29698 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
29700 __pyx_v_call->_rms_mapping_quality = ((uint64_t)(sqrt((__pyx_t_8 / ((struct __pyx_obj_9csamtools_IndelCallerBase *)__pyx_v_self)->iter->n_plp)) + .499));
29702 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3285
29703 * call._rms_mapping_quality = <uint64_t>(sqrt(<double>rms_aux / self.iter.n_plp) + .499)
29705 * return call # <<<<<<<<<<<<<<
29707 * cdef class IndelCaller( IndelCallerBase ):
29709 __Pyx_XDECREF(__pyx_r);
29710 __Pyx_INCREF(((PyObject *)__pyx_v_call));
29711 __pyx_r = ((PyObject *)__pyx_v_call);
29714 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
29717 __Pyx_XDECREF(__pyx_t_1);
29718 __Pyx_XDECREF(__pyx_t_4);
29719 __Pyx_XDECREF(__pyx_t_5);
29720 __Pyx_AddTraceback("csamtools.IndelCallerBase._call");
29723 __Pyx_DECREF((PyObject *)__pyx_v_call);
29724 __Pyx_XGIVEREF(__pyx_r);
29725 __Pyx_TraceReturn(__pyx_r);
29726 __Pyx_RefNannyFinishContext();
29730 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3300
29733 * def __cinit__(self, # <<<<<<<<<<<<<<
29734 * IteratorColumn iterator_column,
29738 static int __pyx_pf_9csamtools_11IndelCaller___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
29739 static int __pyx_pf_9csamtools_11IndelCaller___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
29740 struct __pyx_obj_9csamtools_IteratorColumn *__pyx_v_iterator_column = 0;
29741 PyObject *__pyx_v_kwargs = 0;
29743 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__iterator_column,0};
29744 __Pyx_TraceDeclarations
29745 __Pyx_RefNannySetupContext("__cinit__");
29746 __Pyx_TraceCall("__cinit__", __pyx_f[0], 3300);
29747 __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return -1;
29748 __Pyx_GOTREF(__pyx_v_kwargs);
29749 if (unlikely(__pyx_kwds)) {
29750 Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
29751 PyObject* values[1] = {0};
29752 switch (PyTuple_GET_SIZE(__pyx_args)) {
29753 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
29755 default: goto __pyx_L5_argtuple_error;
29757 switch (PyTuple_GET_SIZE(__pyx_args)) {
29759 values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__iterator_column);
29760 if (likely(values[0])) kw_args--;
29761 else goto __pyx_L5_argtuple_error;
29763 if (unlikely(kw_args > 0)) {
29764 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, PyTuple_GET_SIZE(__pyx_args), "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3300; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
29766 __pyx_v_iterator_column = ((struct __pyx_obj_9csamtools_IteratorColumn *)values[0]);
29767 } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
29768 goto __pyx_L5_argtuple_error;
29770 __pyx_v_iterator_column = ((struct __pyx_obj_9csamtools_IteratorColumn *)PyTuple_GET_ITEM(__pyx_args, 0));
29772 goto __pyx_L4_argument_unpacking_done;
29773 __pyx_L5_argtuple_error:;
29774 __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3300; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
29776 __Pyx_DECREF(__pyx_v_kwargs);
29777 __Pyx_AddTraceback("csamtools.IndelCaller.__cinit__");
29778 __Pyx_RefNannyFinishContext();
29780 __pyx_L4_argument_unpacking_done:;
29781 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_iterator_column), __pyx_ptype_9csamtools_IteratorColumn, 1, "iterator_column", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
29786 __Pyx_AddTraceback("csamtools.IndelCaller.__cinit__");
29789 __Pyx_DECREF(__pyx_v_kwargs);
29790 __Pyx_TraceReturn(Py_None);
29791 __Pyx_RefNannyFinishContext();
29795 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3306
29798 * def call(self, reference, int pos ): # <<<<<<<<<<<<<<
29799 * """call a snp on chromosome *reference*
29800 * and position *pos*.
29803 static PyObject *__pyx_pf_9csamtools_11IndelCaller_call(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
29804 static char __pyx_doc_9csamtools_11IndelCaller_call[] = "IndelCaller.call(self, reference, int pos)\ncall a snp on chromosome *reference*\n and position *pos*.\n\n returns a :class:`SNPCall` object or None, if no indel call could be made.\n ";
29805 static PyObject *__pyx_pf_9csamtools_11IndelCaller_call(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
29806 PyObject *__pyx_v_reference = 0;
29809 PyObject *__pyx_r = NULL;
29810 PyObject *__pyx_t_1 = NULL;
29811 PyObject *__pyx_t_2 = NULL;
29812 PyObject *__pyx_t_3 = NULL;
29814 PyObject *__pyx_t_5 = NULL;
29816 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__reference,&__pyx_n_s__pos,0};
29817 __Pyx_TraceDeclarations
29818 __Pyx_RefNannySetupContext("call");
29819 __Pyx_TraceCall("call", __pyx_f[0], 3306);
29820 if (unlikely(__pyx_kwds)) {
29821 Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
29822 PyObject* values[2] = {0,0};
29823 switch (PyTuple_GET_SIZE(__pyx_args)) {
29824 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
29825 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
29827 default: goto __pyx_L5_argtuple_error;
29829 switch (PyTuple_GET_SIZE(__pyx_args)) {
29831 values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__reference);
29832 if (likely(values[0])) kw_args--;
29833 else goto __pyx_L5_argtuple_error;
29835 values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__pos);
29836 if (likely(values[1])) kw_args--;
29838 __Pyx_RaiseArgtupleInvalid("call", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3306; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
29841 if (unlikely(kw_args > 0)) {
29842 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "call") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3306; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
29844 __pyx_v_reference = values[0];
29845 __pyx_v_pos = __Pyx_PyInt_AsInt(values[1]); if (unlikely((__pyx_v_pos == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3306; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
29846 } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
29847 goto __pyx_L5_argtuple_error;
29849 __pyx_v_reference = PyTuple_GET_ITEM(__pyx_args, 0);
29850 __pyx_v_pos = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely((__pyx_v_pos == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3306; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
29852 goto __pyx_L4_argument_unpacking_done;
29853 __pyx_L5_argtuple_error:;
29854 __Pyx_RaiseArgtupleInvalid("call", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3306; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
29856 __Pyx_AddTraceback("csamtools.IndelCaller.call");
29857 __Pyx_RefNannyFinishContext();
29859 __pyx_L4_argument_unpacking_done:;
29861 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3313
29864 * cdef int tid = self.iter.samfile.gettid( reference ) # <<<<<<<<<<<<<<
29866 * self.iter.reset( tid, pos, pos + 1 )
29868 __pyx_t_1 = PyObject_GetAttr(((PyObject *)((struct __pyx_obj_9csamtools_IndelCaller *)__pyx_v_self)->__pyx_base.iter->samfile), __pyx_n_s__gettid); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
29869 __Pyx_GOTREF(__pyx_t_1);
29870 __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
29871 __Pyx_GOTREF(__pyx_t_2);
29872 __Pyx_INCREF(__pyx_v_reference);
29873 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_reference);
29874 __Pyx_GIVEREF(__pyx_v_reference);
29875 __pyx_t_3 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
29876 __Pyx_GOTREF(__pyx_t_3);
29877 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
29878 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
29879 __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
29880 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
29881 __pyx_v_tid = __pyx_t_4;
29883 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3315
29884 * cdef int tid = self.iter.samfile.gettid( reference )
29886 * self.iter.reset( tid, pos, pos + 1 ) # <<<<<<<<<<<<<<
29890 __pyx_t_3 = PyInt_FromLong(__pyx_v_tid); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
29891 __Pyx_GOTREF(__pyx_t_3);
29892 __pyx_t_2 = PyInt_FromLong(__pyx_v_pos); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
29893 __Pyx_GOTREF(__pyx_t_2);
29894 __pyx_t_1 = PyInt_FromLong((__pyx_v_pos + 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
29895 __Pyx_GOTREF(__pyx_t_1);
29896 __pyx_t_5 = ((struct __pyx_vtabstruct_9csamtools_IteratorColumn *)((struct __pyx_obj_9csamtools_IndelCaller *)__pyx_v_self)->__pyx_base.iter->__pyx_vtab)->reset(((struct __pyx_obj_9csamtools_IndelCaller *)__pyx_v_self)->__pyx_base.iter, __pyx_t_3, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
29897 __Pyx_GOTREF(__pyx_t_5);
29898 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
29899 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
29900 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
29901 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
29903 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3317
29904 * self.iter.reset( tid, pos, pos + 1 )
29906 * while 1: # <<<<<<<<<<<<<<
29907 * self.iter.cnext()
29913 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3318
29916 * self.iter.cnext() # <<<<<<<<<<<<<<
29918 * if self.iter.n_plp < 0:
29920 ((struct __pyx_vtabstruct_9csamtools_IteratorColumn *)((struct __pyx_obj_9csamtools_IndelCaller *)__pyx_v_self)->__pyx_base.iter->__pyx_vtab)->cnext(((struct __pyx_obj_9csamtools_IndelCaller *)__pyx_v_self)->__pyx_base.iter);
29922 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3320
29923 * self.iter.cnext()
29925 * if self.iter.n_plp < 0: # <<<<<<<<<<<<<<
29926 * raise ValueError("error during iteration" )
29929 __pyx_t_6 = (((struct __pyx_obj_9csamtools_IndelCaller *)__pyx_v_self)->__pyx_base.iter->n_plp < 0);
29932 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3321
29934 * if self.iter.n_plp < 0:
29935 * raise ValueError("error during iteration" ) # <<<<<<<<<<<<<<
29937 * if self.iter.plp == NULL:
29939 __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
29940 __Pyx_GOTREF(__pyx_t_5);
29941 __Pyx_INCREF(((PyObject *)__pyx_kp_s_59));
29942 PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_kp_s_59));
29943 __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_59));
29944 __pyx_t_1 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
29945 __Pyx_GOTREF(__pyx_t_1);
29946 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
29947 __Pyx_Raise(__pyx_t_1, 0, 0);
29948 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
29949 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
29954 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3323
29955 * raise ValueError("error during iteration" )
29957 * if self.iter.plp == NULL: # <<<<<<<<<<<<<<
29958 * raise ValueError( "no reads in region - no call" )
29961 __pyx_t_6 = (((struct __pyx_obj_9csamtools_IndelCaller *)__pyx_v_self)->__pyx_base.iter->plp == NULL);
29964 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3324
29966 * if self.iter.plp == NULL:
29967 * raise ValueError( "no reads in region - no call" ) # <<<<<<<<<<<<<<
29969 * if self.iter.pos == pos: break
29971 __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3324; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
29972 __Pyx_GOTREF(__pyx_t_1);
29973 __Pyx_INCREF(((PyObject *)__pyx_kp_s_109));
29974 PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_kp_s_109));
29975 __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_109));
29976 __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3324; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
29977 __Pyx_GOTREF(__pyx_t_5);
29978 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
29979 __Pyx_Raise(__pyx_t_5, 0, 0);
29980 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
29981 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3324; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
29986 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3326
29987 * raise ValueError( "no reads in region - no call" )
29989 * if self.iter.pos == pos: break # <<<<<<<<<<<<<<
29991 * return self._call()
29993 __pyx_t_6 = (((struct __pyx_obj_9csamtools_IndelCaller *)__pyx_v_self)->__pyx_base.iter->pos == __pyx_v_pos);
29995 goto __pyx_L7_break;
30002 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3328
30003 * if self.iter.pos == pos: break
30005 * return self._call() # <<<<<<<<<<<<<<
30007 * cdef class IteratorIndelCalls( IndelCallerBase ):
30009 __Pyx_XDECREF(__pyx_r);
30010 __pyx_t_5 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___call); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
30011 __Pyx_GOTREF(__pyx_t_5);
30012 __pyx_t_1 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
30013 __Pyx_GOTREF(__pyx_t_1);
30014 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
30015 __pyx_r = __pyx_t_1;
30019 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
30022 __Pyx_XDECREF(__pyx_t_1);
30023 __Pyx_XDECREF(__pyx_t_2);
30024 __Pyx_XDECREF(__pyx_t_3);
30025 __Pyx_XDECREF(__pyx_t_5);
30026 __Pyx_AddTraceback("csamtools.IndelCaller.call");
30029 __Pyx_XGIVEREF(__pyx_r);
30030 __Pyx_TraceReturn(__pyx_r);
30031 __Pyx_RefNannyFinishContext();
30035 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3344
30038 * def __cinit__(self, # <<<<<<<<<<<<<<
30039 * IteratorColumn iterator_column,
30043 static int __pyx_pf_9csamtools_18IteratorIndelCalls___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
30044 static int __pyx_pf_9csamtools_18IteratorIndelCalls___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
30045 struct __pyx_obj_9csamtools_IteratorColumn *__pyx_v_iterator_column = 0;
30046 PyObject *__pyx_v_kwargs = 0;
30048 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__iterator_column,0};
30049 __Pyx_TraceDeclarations
30050 __Pyx_RefNannySetupContext("__cinit__");
30051 __Pyx_TraceCall("__cinit__", __pyx_f[0], 3344);
30052 __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return -1;
30053 __Pyx_GOTREF(__pyx_v_kwargs);
30054 if (unlikely(__pyx_kwds)) {
30055 Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
30056 PyObject* values[1] = {0};
30057 switch (PyTuple_GET_SIZE(__pyx_args)) {
30058 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
30060 default: goto __pyx_L5_argtuple_error;
30062 switch (PyTuple_GET_SIZE(__pyx_args)) {
30064 values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__iterator_column);
30065 if (likely(values[0])) kw_args--;
30066 else goto __pyx_L5_argtuple_error;
30068 if (unlikely(kw_args > 0)) {
30069 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, PyTuple_GET_SIZE(__pyx_args), "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3344; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
30071 __pyx_v_iterator_column = ((struct __pyx_obj_9csamtools_IteratorColumn *)values[0]);
30072 } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
30073 goto __pyx_L5_argtuple_error;
30075 __pyx_v_iterator_column = ((struct __pyx_obj_9csamtools_IteratorColumn *)PyTuple_GET_ITEM(__pyx_args, 0));
30077 goto __pyx_L4_argument_unpacking_done;
30078 __pyx_L5_argtuple_error:;
30079 __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3344; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
30081 __Pyx_DECREF(__pyx_v_kwargs);
30082 __Pyx_AddTraceback("csamtools.IteratorIndelCalls.__cinit__");
30083 __Pyx_RefNannyFinishContext();
30085 __pyx_L4_argument_unpacking_done:;
30086 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_iterator_column), __pyx_ptype_9csamtools_IteratorColumn, 1, "iterator_column", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3345; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
30091 __Pyx_AddTraceback("csamtools.IteratorIndelCalls.__cinit__");
30094 __Pyx_DECREF(__pyx_v_kwargs);
30095 __Pyx_TraceReturn(Py_None);
30096 __Pyx_RefNannyFinishContext();
30100 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3350
30103 * def __iter__(self): # <<<<<<<<<<<<<<
30108 static PyObject *__pyx_pf_9csamtools_18IteratorIndelCalls___iter__(PyObject *__pyx_v_self); /*proto*/
30109 static PyObject *__pyx_pf_9csamtools_18IteratorIndelCalls___iter__(PyObject *__pyx_v_self) {
30110 PyObject *__pyx_r = NULL;
30111 __Pyx_TraceDeclarations
30112 __Pyx_RefNannySetupContext("__iter__");
30113 __Pyx_TraceCall("__iter__", __pyx_f[0], 3350);
30115 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3351
30117 * def __iter__(self):
30118 * return self # <<<<<<<<<<<<<<
30120 * def __next__(self):
30122 __Pyx_XDECREF(__pyx_r);
30123 __Pyx_INCREF(__pyx_v_self);
30124 __pyx_r = __pyx_v_self;
30127 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
30129 __Pyx_XGIVEREF(__pyx_r);
30130 __Pyx_TraceReturn(__pyx_r);
30131 __Pyx_RefNannyFinishContext();
30135 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3353
30138 * def __next__(self): # <<<<<<<<<<<<<<
30139 * """python version of next().
30143 static PyObject *__pyx_pf_9csamtools_18IteratorIndelCalls___next__(PyObject *__pyx_v_self); /*proto*/
30144 static char __pyx_doc_9csamtools_18IteratorIndelCalls___next__[] = "python version of next().\n ";
30145 struct wrapperbase __pyx_wrapperbase_9csamtools_18IteratorIndelCalls___next__;
30146 static PyObject *__pyx_pf_9csamtools_18IteratorIndelCalls___next__(PyObject *__pyx_v_self) {
30147 PyObject *__pyx_r = NULL;
30149 PyObject *__pyx_t_2 = NULL;
30150 PyObject *__pyx_t_3 = NULL;
30151 __Pyx_TraceDeclarations
30152 __Pyx_RefNannySetupContext("__next__");
30153 __Pyx_TraceCall("__next__", __pyx_f[0], 3353);
30155 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3358
30157 * # the following code was adapted from bam_plcmd.c:pileup_func()
30158 * self.iter.cnext() # <<<<<<<<<<<<<<
30160 * if self.iter.n_plp < 0:
30162 ((struct __pyx_vtabstruct_9csamtools_IteratorColumn *)((struct __pyx_obj_9csamtools_IteratorIndelCalls *)__pyx_v_self)->__pyx_base.iter->__pyx_vtab)->cnext(((struct __pyx_obj_9csamtools_IteratorIndelCalls *)__pyx_v_self)->__pyx_base.iter);
30164 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3360
30165 * self.iter.cnext()
30167 * if self.iter.n_plp < 0: # <<<<<<<<<<<<<<
30168 * raise ValueError("error during iteration" )
30171 __pyx_t_1 = (((struct __pyx_obj_9csamtools_IteratorIndelCalls *)__pyx_v_self)->__pyx_base.iter->n_plp < 0);
30174 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3361
30176 * if self.iter.n_plp < 0:
30177 * raise ValueError("error during iteration" ) # <<<<<<<<<<<<<<
30179 * if self.iter.plp == NULL:
30181 __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3361; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
30182 __Pyx_GOTREF(__pyx_t_2);
30183 __Pyx_INCREF(((PyObject *)__pyx_kp_s_59));
30184 PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_59));
30185 __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_59));
30186 __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3361; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
30187 __Pyx_GOTREF(__pyx_t_3);
30188 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
30189 __Pyx_Raise(__pyx_t_3, 0, 0);
30190 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
30191 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3361; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
30196 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3363
30197 * raise ValueError("error during iteration" )
30199 * if self.iter.plp == NULL: # <<<<<<<<<<<<<<
30200 * raise StopIteration
30203 __pyx_t_1 = (((struct __pyx_obj_9csamtools_IteratorIndelCalls *)__pyx_v_self)->__pyx_base.iter->plp == NULL);
30206 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3364
30208 * if self.iter.plp == NULL:
30209 * raise StopIteration # <<<<<<<<<<<<<<
30211 * return self._call()
30213 __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0);
30214 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
30219 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3366
30220 * raise StopIteration
30222 * return self._call() # <<<<<<<<<<<<<<
30226 __Pyx_XDECREF(__pyx_r);
30227 __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___call); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
30228 __Pyx_GOTREF(__pyx_t_3);
30229 __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 = 3366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
30230 __Pyx_GOTREF(__pyx_t_2);
30231 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
30232 __pyx_r = __pyx_t_2;
30236 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
30239 __Pyx_XDECREF(__pyx_t_2);
30240 __Pyx_XDECREF(__pyx_t_3);
30241 __Pyx_AddTraceback("csamtools.IteratorIndelCalls.__next__");
30244 __Pyx_XGIVEREF(__pyx_r);
30245 __Pyx_TraceReturn(__pyx_r);
30246 __Pyx_RefNannyFinishContext();
30250 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3386
30251 * cdef int owns_samfile
30253 * def __init__(self, Samfile samfile, int reopen = True ): # <<<<<<<<<<<<<<
30254 * self.samfile = samfile
30258 static int __pyx_pf_9csamtools_12IndexedReads___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
30259 static int __pyx_pf_9csamtools_12IndexedReads___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
30260 struct __pyx_obj_9csamtools_Samfile *__pyx_v_samfile = 0;
30261 int __pyx_v_reopen;
30262 PyObject *__pyx_v_mode;
30263 PyObject *__pyx_v_store;
30265 PyObject *__pyx_t_1 = NULL;
30266 PyObject *__pyx_t_2 = NULL;
30268 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__samfile,&__pyx_n_s__reopen,0};
30269 __Pyx_TraceDeclarations
30270 __Pyx_RefNannySetupContext("__init__");
30271 __Pyx_TraceCall("__init__", __pyx_f[0], 3386);
30272 if (unlikely(__pyx_kwds)) {
30273 Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
30274 PyObject* values[2] = {0,0};
30275 switch (PyTuple_GET_SIZE(__pyx_args)) {
30276 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
30277 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
30279 default: goto __pyx_L5_argtuple_error;
30281 switch (PyTuple_GET_SIZE(__pyx_args)) {
30283 values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__samfile);
30284 if (likely(values[0])) kw_args--;
30285 else goto __pyx_L5_argtuple_error;
30288 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__reopen);
30289 if (value) { values[1] = value; kw_args--; }
30292 if (unlikely(kw_args > 0)) {
30293 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3386; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
30295 __pyx_v_samfile = ((struct __pyx_obj_9csamtools_Samfile *)values[0]);
30297 __pyx_v_reopen = __Pyx_PyInt_AsInt(values[1]); if (unlikely((__pyx_v_reopen == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3386; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
30299 __pyx_v_reopen = ((int)1);
30302 __pyx_v_reopen = ((int)1);
30303 switch (PyTuple_GET_SIZE(__pyx_args)) {
30304 case 2: __pyx_v_reopen = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely((__pyx_v_reopen == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3386; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
30305 case 1: __pyx_v_samfile = ((struct __pyx_obj_9csamtools_Samfile *)PyTuple_GET_ITEM(__pyx_args, 0));
30307 default: goto __pyx_L5_argtuple_error;
30310 goto __pyx_L4_argument_unpacking_done;
30311 __pyx_L5_argtuple_error:;
30312 __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3386; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
30314 __Pyx_AddTraceback("csamtools.IndexedReads.__init__");
30315 __Pyx_RefNannyFinishContext();
30317 __pyx_L4_argument_unpacking_done:;
30318 __pyx_v_mode = Py_None; __Pyx_INCREF(Py_None);
30319 __pyx_v_store = Py_None; __Pyx_INCREF(Py_None);
30320 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_samfile), __pyx_ptype_9csamtools_Samfile, 1, "samfile", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
30322 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3387
30324 * def __init__(self, Samfile samfile, int reopen = True ):
30325 * self.samfile = samfile # <<<<<<<<<<<<<<
30327 * if samfile.isbam: mode = "rb"
30329 __Pyx_INCREF(((PyObject *)__pyx_v_samfile));
30330 __Pyx_GIVEREF(((PyObject *)__pyx_v_samfile));
30331 __Pyx_GOTREF(((struct __pyx_obj_9csamtools_IndexedReads *)__pyx_v_self)->samfile);
30332 __Pyx_DECREF(((PyObject *)((struct __pyx_obj_9csamtools_IndexedReads *)__pyx_v_self)->samfile));
30333 ((struct __pyx_obj_9csamtools_IndexedReads *)__pyx_v_self)->samfile = __pyx_v_samfile;
30335 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3389
30336 * self.samfile = samfile
30338 * if samfile.isbam: mode = "rb" # <<<<<<<<<<<<<<
30342 if (__pyx_v_samfile->isbam) {
30343 __Pyx_INCREF(((PyObject *)__pyx_n_s__rb));
30344 __Pyx_DECREF(__pyx_v_mode);
30345 __pyx_v_mode = ((PyObject *)__pyx_n_s__rb);
30350 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3390
30352 * if samfile.isbam: mode = "rb"
30353 * else: mode = "r" # <<<<<<<<<<<<<<
30355 * # reopen the file - note that this makes the iterator
30357 __Pyx_INCREF(((PyObject *)__pyx_n_s__r));
30358 __Pyx_DECREF(__pyx_v_mode);
30359 __pyx_v_mode = ((PyObject *)__pyx_n_s__r);
30363 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3394
30364 * # reopen the file - note that this makes the iterator
30365 * # slow and causes pileup to slow down significantly.
30366 * if reopen: # <<<<<<<<<<<<<<
30367 * store = StderrStore()
30368 * self.fp = samopen( samfile._filename, mode, NULL )
30370 if (__pyx_v_reopen) {
30372 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3395
30373 * # slow and causes pileup to slow down significantly.
30375 * store = StderrStore() # <<<<<<<<<<<<<<
30376 * self.fp = samopen( samfile._filename, mode, NULL )
30379 __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__StderrStore); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
30380 __Pyx_GOTREF(__pyx_t_1);
30381 __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 = 3395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
30382 __Pyx_GOTREF(__pyx_t_2);
30383 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
30384 __Pyx_DECREF(__pyx_v_store);
30385 __pyx_v_store = __pyx_t_2;
30388 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3396
30390 * store = StderrStore()
30391 * self.fp = samopen( samfile._filename, mode, NULL ) # <<<<<<<<<<<<<<
30393 * assert self.fp != NULL
30395 __pyx_t_3 = PyBytes_AsString(__pyx_v_mode); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3396; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
30396 ((struct __pyx_obj_9csamtools_IndexedReads *)__pyx_v_self)->fp = samopen(__pyx_v_samfile->_filename, __pyx_t_3, NULL);
30398 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3397
30399 * store = StderrStore()
30400 * self.fp = samopen( samfile._filename, mode, NULL )
30401 * store.release() # <<<<<<<<<<<<<<
30402 * assert self.fp != NULL
30403 * self.owns_samfile = True
30405 __pyx_t_2 = PyObject_GetAttr(__pyx_v_store, __pyx_n_s__release); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
30406 __Pyx_GOTREF(__pyx_t_2);
30407 __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 = 3397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
30408 __Pyx_GOTREF(__pyx_t_1);
30409 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
30410 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
30412 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3398
30413 * self.fp = samopen( samfile._filename, mode, NULL )
30415 * assert self.fp != NULL # <<<<<<<<<<<<<<
30416 * self.owns_samfile = True
30419 #ifndef PYREX_WITHOUT_ASSERTIONS
30420 if (unlikely(!(((struct __pyx_obj_9csamtools_IndexedReads *)__pyx_v_self)->fp != NULL))) {
30421 PyErr_SetNone(PyExc_AssertionError);
30422 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
30426 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3399
30428 * assert self.fp != NULL
30429 * self.owns_samfile = True # <<<<<<<<<<<<<<
30431 * self.fp = samfile.samfile
30433 ((struct __pyx_obj_9csamtools_IndexedReads *)__pyx_v_self)->owns_samfile = 1;
30438 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3401
30439 * self.owns_samfile = True
30441 * self.fp = samfile.samfile # <<<<<<<<<<<<<<
30442 * self.owns_samfile = False
30445 ((struct __pyx_obj_9csamtools_IndexedReads *)__pyx_v_self)->fp = __pyx_v_samfile->samfile;
30447 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3402
30449 * self.fp = samfile.samfile
30450 * self.owns_samfile = False # <<<<<<<<<<<<<<
30452 * assert samfile.isbam, "can only IndexReads on bam files"
30454 ((struct __pyx_obj_9csamtools_IndexedReads *)__pyx_v_self)->owns_samfile = 0;
30458 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3404
30459 * self.owns_samfile = False
30461 * assert samfile.isbam, "can only IndexReads on bam files" # <<<<<<<<<<<<<<
30463 * def build( self ):
30465 #ifndef PYREX_WITHOUT_ASSERTIONS
30466 if (unlikely(!__pyx_v_samfile->isbam)) {
30467 PyErr_SetObject(PyExc_AssertionError, ((PyObject *)__pyx_kp_s_112));
30468 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3404; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
30475 __Pyx_XDECREF(__pyx_t_1);
30476 __Pyx_XDECREF(__pyx_t_2);
30477 __Pyx_AddTraceback("csamtools.IndexedReads.__init__");
30480 __Pyx_DECREF(__pyx_v_mode);
30481 __Pyx_DECREF(__pyx_v_store);
30482 __Pyx_TraceReturn(Py_None);
30483 __Pyx_RefNannyFinishContext();
30487 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3406
30488 * assert samfile.isbam, "can only IndexReads on bam files"
30490 * def build( self ): # <<<<<<<<<<<<<<
30491 * '''build index.'''
30495 static PyObject *__pyx_pf_9csamtools_12IndexedReads_build(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
30496 static char __pyx_doc_9csamtools_12IndexedReads_build[] = "IndexedReads.build(self)\nbuild index.";
30497 static PyObject *__pyx_pf_9csamtools_12IndexedReads_build(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
30500 uint64_t __pyx_v_pos;
30501 char *__pyx_v_qname;
30502 PyObject *__pyx_r = NULL;
30503 PyObject *__pyx_t_1 = NULL;
30504 PyObject *__pyx_t_2 = NULL;
30505 PyObject *__pyx_t_3 = NULL;
30507 __Pyx_TraceDeclarations
30508 __Pyx_RefNannySetupContext("build");
30509 __Pyx_TraceCall("build", __pyx_f[0], 3406);
30511 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3409
30512 * '''build index.'''
30514 * self.index = collections.defaultdict( list ) # <<<<<<<<<<<<<<
30516 * # this method will start indexing from the current file position
30518 __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__collections); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3409; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
30519 __Pyx_GOTREF(__pyx_t_1);
30520 __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__defaultdict); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3409; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
30521 __Pyx_GOTREF(__pyx_t_2);
30522 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
30523 __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3409; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
30524 __Pyx_GOTREF(__pyx_t_1);
30525 __Pyx_INCREF(((PyObject *)((PyObject*)&PyList_Type)));
30526 PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)((PyObject*)&PyList_Type)));
30527 __Pyx_GIVEREF(((PyObject *)((PyObject*)&PyList_Type)));
30528 __pyx_t_3 = PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3409; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
30529 __Pyx_GOTREF(__pyx_t_3);
30530 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
30531 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
30532 __Pyx_GIVEREF(__pyx_t_3);
30533 __Pyx_GOTREF(((struct __pyx_obj_9csamtools_IndexedReads *)__pyx_v_self)->index);
30534 __Pyx_DECREF(((struct __pyx_obj_9csamtools_IndexedReads *)__pyx_v_self)->index);
30535 ((struct __pyx_obj_9csamtools_IndexedReads *)__pyx_v_self)->index = __pyx_t_3;
30538 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3413
30539 * # this method will start indexing from the current file position
30541 * cdef int ret = 1 # <<<<<<<<<<<<<<
30542 * cdef bam1_t * b = <bam1_t*> calloc(1, sizeof( bam1_t) )
30547 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3414
30550 * cdef bam1_t * b = <bam1_t*> calloc(1, sizeof( bam1_t) ) # <<<<<<<<<<<<<<
30552 * cdef uint64_t pos
30554 __pyx_v_b = ((bam1_t *)calloc(1, (sizeof(bam1_t))));
30556 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3418
30557 * cdef uint64_t pos
30559 * while ret > 0: # <<<<<<<<<<<<<<
30560 * pos = bam_tell( self.fp.x.bam )
30561 * ret = samread( self.fp, b)
30564 __pyx_t_4 = (__pyx_v_ret > 0);
30565 if (!__pyx_t_4) break;
30567 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3419
30570 * pos = bam_tell( self.fp.x.bam ) # <<<<<<<<<<<<<<
30571 * ret = samread( self.fp, b)
30574 __pyx_v_pos = bam_tell(((struct __pyx_obj_9csamtools_IndexedReads *)__pyx_v_self)->fp->x.bam);
30576 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3420
30578 * pos = bam_tell( self.fp.x.bam )
30579 * ret = samread( self.fp, b) # <<<<<<<<<<<<<<
30581 * qname = bam1_qname( b )
30583 __pyx_v_ret = samread(((struct __pyx_obj_9csamtools_IndexedReads *)__pyx_v_self)->fp, __pyx_v_b);
30585 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3421
30586 * pos = bam_tell( self.fp.x.bam )
30587 * ret = samread( self.fp, b)
30588 * if ret > 0: # <<<<<<<<<<<<<<
30589 * qname = bam1_qname( b )
30590 * self.index[qname].append( pos )
30592 __pyx_t_4 = (__pyx_v_ret > 0);
30595 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3422
30596 * ret = samread( self.fp, b)
30598 * qname = bam1_qname( b ) # <<<<<<<<<<<<<<
30599 * self.index[qname].append( pos )
30602 __pyx_v_qname = bam1_qname(__pyx_v_b);
30604 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3423
30606 * qname = bam1_qname( b )
30607 * self.index[qname].append( pos ) # <<<<<<<<<<<<<<
30609 * bam_destroy1( b )
30611 __pyx_t_3 = PyBytes_FromString(__pyx_v_qname); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
30612 __Pyx_GOTREF(((PyObject *)__pyx_t_3));
30613 __pyx_t_1 = PyObject_GetItem(((struct __pyx_obj_9csamtools_IndexedReads *)__pyx_v_self)->index, ((PyObject *)__pyx_t_3)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
30614 __Pyx_GOTREF(__pyx_t_1);
30615 __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
30616 __pyx_t_3 = __Pyx_PyInt_to_py_uint64_t(__pyx_v_pos); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
30617 __Pyx_GOTREF(__pyx_t_3);
30618 __pyx_t_2 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
30619 __Pyx_GOTREF(__pyx_t_2);
30620 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
30621 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
30622 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
30628 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3425
30629 * self.index[qname].append( pos )
30631 * bam_destroy1( b ) # <<<<<<<<<<<<<<
30633 * def find( self, qname ):
30635 bam_destroy1(__pyx_v_b);
30637 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
30640 __Pyx_XDECREF(__pyx_t_1);
30641 __Pyx_XDECREF(__pyx_t_2);
30642 __Pyx_XDECREF(__pyx_t_3);
30643 __Pyx_AddTraceback("csamtools.IndexedReads.build");
30646 __Pyx_XGIVEREF(__pyx_r);
30647 __Pyx_TraceReturn(__pyx_r);
30648 __Pyx_RefNannyFinishContext();
30652 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3427
30653 * bam_destroy1( b )
30655 * def find( self, qname ): # <<<<<<<<<<<<<<
30656 * if qname in self.index:
30657 * return IteratorRowSelection( self.samfile, self.index[qname], reopen = False )
30660 static PyObject *__pyx_pf_9csamtools_12IndexedReads_find(PyObject *__pyx_v_self, PyObject *__pyx_v_qname); /*proto*/
30661 static char __pyx_doc_9csamtools_12IndexedReads_find[] = "IndexedReads.find(self, qname)";
30662 static PyObject *__pyx_pf_9csamtools_12IndexedReads_find(PyObject *__pyx_v_self, PyObject *__pyx_v_qname) {
30663 PyObject *__pyx_r = NULL;
30665 PyObject *__pyx_t_2 = NULL;
30666 PyObject *__pyx_t_3 = NULL;
30667 PyObject *__pyx_t_4 = NULL;
30668 __Pyx_TraceDeclarations
30669 __Pyx_RefNannySetupContext("find");
30670 __Pyx_TraceCall("find", __pyx_f[0], 3427);
30672 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3428
30674 * def find( self, qname ):
30675 * if qname in self.index: # <<<<<<<<<<<<<<
30676 * return IteratorRowSelection( self.samfile, self.index[qname], reopen = False )
30679 __pyx_t_1 = ((PySequence_Contains(((struct __pyx_obj_9csamtools_IndexedReads *)__pyx_v_self)->index, __pyx_v_qname))); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
30682 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3429
30683 * def find( self, qname ):
30684 * if qname in self.index:
30685 * return IteratorRowSelection( self.samfile, self.index[qname], reopen = False ) # <<<<<<<<<<<<<<
30687 * raise KeyError( "read %s not found" % qname )
30689 __Pyx_XDECREF(__pyx_r);
30690 __pyx_t_2 = PyObject_GetItem(((struct __pyx_obj_9csamtools_IndexedReads *)__pyx_v_self)->index, __pyx_v_qname); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
30691 __Pyx_GOTREF(__pyx_t_2);
30692 __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
30693 __Pyx_GOTREF(__pyx_t_3);
30694 __Pyx_INCREF(((PyObject *)((struct __pyx_obj_9csamtools_IndexedReads *)__pyx_v_self)->samfile));
30695 PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)((struct __pyx_obj_9csamtools_IndexedReads *)__pyx_v_self)->samfile));
30696 __Pyx_GIVEREF(((PyObject *)((struct __pyx_obj_9csamtools_IndexedReads *)__pyx_v_self)->samfile));
30697 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
30698 __Pyx_GIVEREF(__pyx_t_2);
30700 __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
30701 __Pyx_GOTREF(((PyObject *)__pyx_t_2));
30702 __pyx_t_4 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
30703 __Pyx_GOTREF(__pyx_t_4);
30704 if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__reopen), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
30705 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
30706 __pyx_t_4 = PyEval_CallObjectWithKeywords(((PyObject *)((PyObject*)__pyx_ptype_9csamtools_IteratorRowSelection)), __pyx_t_3, ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
30707 __Pyx_GOTREF(__pyx_t_4);
30708 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
30709 __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
30710 __pyx_r = __pyx_t_4;
30717 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3431
30718 * return IteratorRowSelection( self.samfile, self.index[qname], reopen = False )
30720 * raise KeyError( "read %s not found" % qname ) # <<<<<<<<<<<<<<
30722 * def __dealloc__(self):
30724 __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_113), __pyx_v_qname); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
30725 __Pyx_GOTREF(((PyObject *)__pyx_t_4));
30726 __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
30727 __Pyx_GOTREF(__pyx_t_2);
30728 PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_4));
30729 __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
30731 __pyx_t_4 = PyObject_Call(__pyx_builtin_KeyError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
30732 __Pyx_GOTREF(__pyx_t_4);
30733 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
30734 __Pyx_Raise(__pyx_t_4, 0, 0);
30735 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
30736 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
30740 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
30743 __Pyx_XDECREF(__pyx_t_2);
30744 __Pyx_XDECREF(__pyx_t_3);
30745 __Pyx_XDECREF(__pyx_t_4);
30746 __Pyx_AddTraceback("csamtools.IndexedReads.find");
30749 __Pyx_XGIVEREF(__pyx_r);
30750 __Pyx_TraceReturn(__pyx_r);
30751 __Pyx_RefNannyFinishContext();
30755 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3433
30756 * raise KeyError( "read %s not found" % qname )
30758 * def __dealloc__(self): # <<<<<<<<<<<<<<
30759 * if self.owns_samfile: samclose( self.fp )
30763 static void __pyx_pf_9csamtools_12IndexedReads___dealloc__(PyObject *__pyx_v_self); /*proto*/
30764 static void __pyx_pf_9csamtools_12IndexedReads___dealloc__(PyObject *__pyx_v_self) {
30765 __Pyx_TraceDeclarations
30766 __Pyx_RefNannySetupContext("__dealloc__");
30767 __Pyx_TraceCall("__dealloc__", __pyx_f[0], 3433);
30769 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3434
30771 * def __dealloc__(self):
30772 * if self.owns_samfile: samclose( self.fp ) # <<<<<<<<<<<<<<
30774 * __all__ = ["Samfile",
30776 if (((struct __pyx_obj_9csamtools_IndexedReads *)__pyx_v_self)->owns_samfile) {
30777 samclose(((struct __pyx_obj_9csamtools_IndexedReads *)__pyx_v_self)->fp);
30782 __Pyx_TraceReturn(Py_None);
30783 __Pyx_RefNannyFinishContext();
30786 static PyObject *__pyx_tp_new_9csamtools_AlignedRead(PyTypeObject *t, PyObject *a, PyObject *k) {
30787 PyObject *o = (*t->tp_alloc)(t, 0);
30792 static void __pyx_tp_dealloc_9csamtools_AlignedRead(PyObject *o) {
30794 PyObject *etype, *eval, *etb;
30795 PyErr_Fetch(&etype, &eval, &etb);
30797 __pyx_pf_9csamtools_11AlignedRead___dealloc__(o);
30798 if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
30800 PyErr_Restore(etype, eval, etb);
30802 (*Py_TYPE(o)->tp_free)(o);
30805 static PyObject *__pyx_getprop_9csamtools_11AlignedRead_qname(PyObject *o, void *x) {
30806 return __pyx_pf_9csamtools_11AlignedRead_5qname___get__(o);
30809 static int __pyx_setprop_9csamtools_11AlignedRead_qname(PyObject *o, PyObject *v, void *x) {
30811 return __pyx_pf_9csamtools_11AlignedRead_5qname___set__(o, v);
30814 PyErr_SetString(PyExc_NotImplementedError, "__del__");
30819 static PyObject *__pyx_getprop_9csamtools_11AlignedRead_cigar(PyObject *o, void *x) {
30820 return __pyx_pf_9csamtools_11AlignedRead_5cigar___get__(o);
30823 static int __pyx_setprop_9csamtools_11AlignedRead_cigar(PyObject *o, PyObject *v, void *x) {
30825 return __pyx_pf_9csamtools_11AlignedRead_5cigar___set__(o, v);
30828 PyErr_SetString(PyExc_NotImplementedError, "__del__");
30833 static PyObject *__pyx_getprop_9csamtools_11AlignedRead_seq(PyObject *o, void *x) {
30834 return __pyx_pf_9csamtools_11AlignedRead_3seq___get__(o);
30837 static int __pyx_setprop_9csamtools_11AlignedRead_seq(PyObject *o, PyObject *v, void *x) {
30839 return __pyx_pf_9csamtools_11AlignedRead_3seq___set__(o, v);
30842 PyErr_SetString(PyExc_NotImplementedError, "__del__");
30847 static PyObject *__pyx_getprop_9csamtools_11AlignedRead_qual(PyObject *o, void *x) {
30848 return __pyx_pf_9csamtools_11AlignedRead_4qual___get__(o);
30851 static int __pyx_setprop_9csamtools_11AlignedRead_qual(PyObject *o, PyObject *v, void *x) {
30853 return __pyx_pf_9csamtools_11AlignedRead_4qual___set__(o, v);
30856 PyErr_SetString(PyExc_NotImplementedError, "__del__");
30861 static PyObject *__pyx_getprop_9csamtools_11AlignedRead_query(PyObject *o, void *x) {
30862 return __pyx_pf_9csamtools_11AlignedRead_5query___get__(o);
30865 static PyObject *__pyx_getprop_9csamtools_11AlignedRead_qqual(PyObject *o, void *x) {
30866 return __pyx_pf_9csamtools_11AlignedRead_5qqual___get__(o);
30869 static PyObject *__pyx_getprop_9csamtools_11AlignedRead_qstart(PyObject *o, void *x) {
30870 return __pyx_pf_9csamtools_11AlignedRead_6qstart___get__(o);
30873 static PyObject *__pyx_getprop_9csamtools_11AlignedRead_qend(PyObject *o, void *x) {
30874 return __pyx_pf_9csamtools_11AlignedRead_4qend___get__(o);
30877 static PyObject *__pyx_getprop_9csamtools_11AlignedRead_qlen(PyObject *o, void *x) {
30878 return __pyx_pf_9csamtools_11AlignedRead_4qlen___get__(o);
30881 static PyObject *__pyx_getprop_9csamtools_11AlignedRead_tags(PyObject *o, void *x) {
30882 return __pyx_pf_9csamtools_11AlignedRead_4tags___get__(o);
30885 static int __pyx_setprop_9csamtools_11AlignedRead_tags(PyObject *o, PyObject *v, void *x) {
30887 return __pyx_pf_9csamtools_11AlignedRead_4tags___set__(o, v);
30890 PyErr_SetString(PyExc_NotImplementedError, "__del__");
30895 static PyObject *__pyx_getprop_9csamtools_11AlignedRead_flag(PyObject *o, void *x) {
30896 return __pyx_pf_9csamtools_11AlignedRead_4flag___get__(o);
30899 static int __pyx_setprop_9csamtools_11AlignedRead_flag(PyObject *o, PyObject *v, void *x) {
30901 return __pyx_pf_9csamtools_11AlignedRead_4flag___set__(o, v);
30904 PyErr_SetString(PyExc_NotImplementedError, "__del__");
30909 static PyObject *__pyx_getprop_9csamtools_11AlignedRead_rname(PyObject *o, void *x) {
30910 return __pyx_pf_9csamtools_11AlignedRead_5rname___get__(o);
30913 static int __pyx_setprop_9csamtools_11AlignedRead_rname(PyObject *o, PyObject *v, void *x) {
30915 return __pyx_pf_9csamtools_11AlignedRead_5rname___set__(o, v);
30918 PyErr_SetString(PyExc_NotImplementedError, "__del__");
30923 static PyObject *__pyx_getprop_9csamtools_11AlignedRead_tid(PyObject *o, void *x) {
30924 return __pyx_pf_9csamtools_11AlignedRead_3tid___get__(o);
30927 static int __pyx_setprop_9csamtools_11AlignedRead_tid(PyObject *o, PyObject *v, void *x) {
30929 return __pyx_pf_9csamtools_11AlignedRead_3tid___set__(o, v);
30932 PyErr_SetString(PyExc_NotImplementedError, "__del__");
30937 static PyObject *__pyx_getprop_9csamtools_11AlignedRead_pos(PyObject *o, void *x) {
30938 return __pyx_pf_9csamtools_11AlignedRead_3pos___get__(o);
30941 static int __pyx_setprop_9csamtools_11AlignedRead_pos(PyObject *o, PyObject *v, void *x) {
30943 return __pyx_pf_9csamtools_11AlignedRead_3pos___set__(o, v);
30946 PyErr_SetString(PyExc_NotImplementedError, "__del__");
30951 static PyObject *__pyx_getprop_9csamtools_11AlignedRead_bin(PyObject *o, void *x) {
30952 return __pyx_pf_9csamtools_11AlignedRead_3bin___get__(o);
30955 static int __pyx_setprop_9csamtools_11AlignedRead_bin(PyObject *o, PyObject *v, void *x) {
30957 return __pyx_pf_9csamtools_11AlignedRead_3bin___set__(o, v);
30960 PyErr_SetString(PyExc_NotImplementedError, "__del__");
30965 static PyObject *__pyx_getprop_9csamtools_11AlignedRead_rlen(PyObject *o, void *x) {
30966 return __pyx_pf_9csamtools_11AlignedRead_4rlen___get__(o);
30969 static PyObject *__pyx_getprop_9csamtools_11AlignedRead_aend(PyObject *o, void *x) {
30970 return __pyx_pf_9csamtools_11AlignedRead_4aend___get__(o);
30973 static PyObject *__pyx_getprop_9csamtools_11AlignedRead_alen(PyObject *o, void *x) {
30974 return __pyx_pf_9csamtools_11AlignedRead_4alen___get__(o);
30977 static PyObject *__pyx_getprop_9csamtools_11AlignedRead_mapq(PyObject *o, void *x) {
30978 return __pyx_pf_9csamtools_11AlignedRead_4mapq___get__(o);
30981 static int __pyx_setprop_9csamtools_11AlignedRead_mapq(PyObject *o, PyObject *v, void *x) {
30983 return __pyx_pf_9csamtools_11AlignedRead_4mapq___set__(o, v);
30986 PyErr_SetString(PyExc_NotImplementedError, "__del__");
30991 static PyObject *__pyx_getprop_9csamtools_11AlignedRead_mrnm(PyObject *o, void *x) {
30992 return __pyx_pf_9csamtools_11AlignedRead_4mrnm___get__(o);
30995 static int __pyx_setprop_9csamtools_11AlignedRead_mrnm(PyObject *o, PyObject *v, void *x) {
30997 return __pyx_pf_9csamtools_11AlignedRead_4mrnm___set__(o, v);
31000 PyErr_SetString(PyExc_NotImplementedError, "__del__");
31005 static PyObject *__pyx_getprop_9csamtools_11AlignedRead_mpos(PyObject *o, void *x) {
31006 return __pyx_pf_9csamtools_11AlignedRead_4mpos___get__(o);
31009 static int __pyx_setprop_9csamtools_11AlignedRead_mpos(PyObject *o, PyObject *v, void *x) {
31011 return __pyx_pf_9csamtools_11AlignedRead_4mpos___set__(o, v);
31014 PyErr_SetString(PyExc_NotImplementedError, "__del__");
31019 static PyObject *__pyx_getprop_9csamtools_11AlignedRead_isize(PyObject *o, void *x) {
31020 return __pyx_pf_9csamtools_11AlignedRead_5isize___get__(o);
31023 static int __pyx_setprop_9csamtools_11AlignedRead_isize(PyObject *o, PyObject *v, void *x) {
31025 return __pyx_pf_9csamtools_11AlignedRead_5isize___set__(o, v);
31028 PyErr_SetString(PyExc_NotImplementedError, "__del__");
31033 static PyObject *__pyx_getprop_9csamtools_11AlignedRead_is_paired(PyObject *o, void *x) {
31034 return __pyx_pf_9csamtools_11AlignedRead_9is_paired___get__(o);
31037 static int __pyx_setprop_9csamtools_11AlignedRead_is_paired(PyObject *o, PyObject *v, void *x) {
31039 return __pyx_pf_9csamtools_11AlignedRead_9is_paired___set__(o, v);
31042 PyErr_SetString(PyExc_NotImplementedError, "__del__");
31047 static PyObject *__pyx_getprop_9csamtools_11AlignedRead_is_proper_pair(PyObject *o, void *x) {
31048 return __pyx_pf_9csamtools_11AlignedRead_14is_proper_pair___get__(o);
31051 static int __pyx_setprop_9csamtools_11AlignedRead_is_proper_pair(PyObject *o, PyObject *v, void *x) {
31053 return __pyx_pf_9csamtools_11AlignedRead_14is_proper_pair___set__(o, v);
31056 PyErr_SetString(PyExc_NotImplementedError, "__del__");
31061 static PyObject *__pyx_getprop_9csamtools_11AlignedRead_is_unmapped(PyObject *o, void *x) {
31062 return __pyx_pf_9csamtools_11AlignedRead_11is_unmapped___get__(o);
31065 static int __pyx_setprop_9csamtools_11AlignedRead_is_unmapped(PyObject *o, PyObject *v, void *x) {
31067 return __pyx_pf_9csamtools_11AlignedRead_11is_unmapped___set__(o, v);
31070 PyErr_SetString(PyExc_NotImplementedError, "__del__");
31075 static PyObject *__pyx_getprop_9csamtools_11AlignedRead_mate_is_unmapped(PyObject *o, void *x) {
31076 return __pyx_pf_9csamtools_11AlignedRead_16mate_is_unmapped___get__(o);
31079 static int __pyx_setprop_9csamtools_11AlignedRead_mate_is_unmapped(PyObject *o, PyObject *v, void *x) {
31081 return __pyx_pf_9csamtools_11AlignedRead_16mate_is_unmapped___set__(o, v);
31084 PyErr_SetString(PyExc_NotImplementedError, "__del__");
31089 static PyObject *__pyx_getprop_9csamtools_11AlignedRead_is_reverse(PyObject *o, void *x) {
31090 return __pyx_pf_9csamtools_11AlignedRead_10is_reverse___get__(o);
31093 static int __pyx_setprop_9csamtools_11AlignedRead_is_reverse(PyObject *o, PyObject *v, void *x) {
31095 return __pyx_pf_9csamtools_11AlignedRead_10is_reverse___set__(o, v);
31098 PyErr_SetString(PyExc_NotImplementedError, "__del__");
31103 static PyObject *__pyx_getprop_9csamtools_11AlignedRead_mate_is_reverse(PyObject *o, void *x) {
31104 return __pyx_pf_9csamtools_11AlignedRead_15mate_is_reverse___get__(o);
31107 static int __pyx_setprop_9csamtools_11AlignedRead_mate_is_reverse(PyObject *o, PyObject *v, void *x) {
31109 return __pyx_pf_9csamtools_11AlignedRead_15mate_is_reverse___set__(o, v);
31112 PyErr_SetString(PyExc_NotImplementedError, "__del__");
31117 static PyObject *__pyx_getprop_9csamtools_11AlignedRead_is_read1(PyObject *o, void *x) {
31118 return __pyx_pf_9csamtools_11AlignedRead_8is_read1___get__(o);
31121 static int __pyx_setprop_9csamtools_11AlignedRead_is_read1(PyObject *o, PyObject *v, void *x) {
31123 return __pyx_pf_9csamtools_11AlignedRead_8is_read1___set__(o, v);
31126 PyErr_SetString(PyExc_NotImplementedError, "__del__");
31131 static PyObject *__pyx_getprop_9csamtools_11AlignedRead_is_read2(PyObject *o, void *x) {
31132 return __pyx_pf_9csamtools_11AlignedRead_8is_read2___get__(o);
31135 static int __pyx_setprop_9csamtools_11AlignedRead_is_read2(PyObject *o, PyObject *v, void *x) {
31137 return __pyx_pf_9csamtools_11AlignedRead_8is_read2___set__(o, v);
31140 PyErr_SetString(PyExc_NotImplementedError, "__del__");
31145 static PyObject *__pyx_getprop_9csamtools_11AlignedRead_is_secondary(PyObject *o, void *x) {
31146 return __pyx_pf_9csamtools_11AlignedRead_12is_secondary___get__(o);
31149 static int __pyx_setprop_9csamtools_11AlignedRead_is_secondary(PyObject *o, PyObject *v, void *x) {
31151 return __pyx_pf_9csamtools_11AlignedRead_12is_secondary___set__(o, v);
31154 PyErr_SetString(PyExc_NotImplementedError, "__del__");
31159 static PyObject *__pyx_getprop_9csamtools_11AlignedRead_is_qcfail(PyObject *o, void *x) {
31160 return __pyx_pf_9csamtools_11AlignedRead_9is_qcfail___get__(o);
31163 static int __pyx_setprop_9csamtools_11AlignedRead_is_qcfail(PyObject *o, PyObject *v, void *x) {
31165 return __pyx_pf_9csamtools_11AlignedRead_9is_qcfail___set__(o, v);
31168 PyErr_SetString(PyExc_NotImplementedError, "__del__");
31173 static PyObject *__pyx_getprop_9csamtools_11AlignedRead_is_duplicate(PyObject *o, void *x) {
31174 return __pyx_pf_9csamtools_11AlignedRead_12is_duplicate___get__(o);
31177 static int __pyx_setprop_9csamtools_11AlignedRead_is_duplicate(PyObject *o, PyObject *v, void *x) {
31179 return __pyx_pf_9csamtools_11AlignedRead_12is_duplicate___set__(o, v);
31182 PyErr_SetString(PyExc_NotImplementedError, "__del__");
31187 static PyObject *__pyx_getprop_9csamtools_11AlignedRead_positions(PyObject *o, void *x) {
31188 return __pyx_pf_9csamtools_11AlignedRead_9positions___get__(o);
31191 static PyMethodDef __pyx_methods_9csamtools_AlignedRead[] = {
31192 {__Pyx_NAMESTR("compare"), (PyCFunction)__pyx_pf_9csamtools_11AlignedRead_compare, METH_O, __Pyx_DOCSTR(__pyx_doc_9csamtools_11AlignedRead_compare)},
31193 {__Pyx_NAMESTR("overlap"), (PyCFunction)__pyx_pf_9csamtools_11AlignedRead_overlap, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_9csamtools_11AlignedRead_overlap)},
31194 {__Pyx_NAMESTR("opt"), (PyCFunction)__pyx_pf_9csamtools_11AlignedRead_opt, METH_O, __Pyx_DOCSTR(__pyx_doc_9csamtools_11AlignedRead_opt)},
31195 {__Pyx_NAMESTR("fancy_str"), (PyCFunction)__pyx_pf_9csamtools_11AlignedRead_fancy_str, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_9csamtools_11AlignedRead_fancy_str)},
31199 static struct PyGetSetDef __pyx_getsets_9csamtools_AlignedRead[] = {
31200 {(char *)"qname", __pyx_getprop_9csamtools_11AlignedRead_qname, __pyx_setprop_9csamtools_11AlignedRead_qname, __Pyx_DOCSTR(__pyx_k_114), 0},
31201 {(char *)"cigar", __pyx_getprop_9csamtools_11AlignedRead_cigar, __pyx_setprop_9csamtools_11AlignedRead_cigar, __Pyx_DOCSTR(__pyx_k_115), 0},
31202 {(char *)"seq", __pyx_getprop_9csamtools_11AlignedRead_seq, __pyx_setprop_9csamtools_11AlignedRead_seq, __Pyx_DOCSTR(__pyx_k_116), 0},
31203 {(char *)"qual", __pyx_getprop_9csamtools_11AlignedRead_qual, __pyx_setprop_9csamtools_11AlignedRead_qual, __Pyx_DOCSTR(__pyx_k_117), 0},
31204 {(char *)"query", __pyx_getprop_9csamtools_11AlignedRead_query, 0, __Pyx_DOCSTR(__pyx_k_118), 0},
31205 {(char *)"qqual", __pyx_getprop_9csamtools_11AlignedRead_qqual, 0, __Pyx_DOCSTR(__pyx_k_119), 0},
31206 {(char *)"qstart", __pyx_getprop_9csamtools_11AlignedRead_qstart, 0, __Pyx_DOCSTR(__pyx_k_120), 0},
31207 {(char *)"qend", __pyx_getprop_9csamtools_11AlignedRead_qend, 0, __Pyx_DOCSTR(__pyx_k_121), 0},
31208 {(char *)"qlen", __pyx_getprop_9csamtools_11AlignedRead_qlen, 0, __Pyx_DOCSTR(__pyx_k_122), 0},
31209 {(char *)"tags", __pyx_getprop_9csamtools_11AlignedRead_tags, __pyx_setprop_9csamtools_11AlignedRead_tags, __Pyx_DOCSTR(__pyx_k_123), 0},
31210 {(char *)"flag", __pyx_getprop_9csamtools_11AlignedRead_flag, __pyx_setprop_9csamtools_11AlignedRead_flag, __Pyx_DOCSTR(__pyx_k_124), 0},
31211 {(char *)"rname", __pyx_getprop_9csamtools_11AlignedRead_rname, __pyx_setprop_9csamtools_11AlignedRead_rname, __Pyx_DOCSTR(__pyx_k_125), 0},
31212 {(char *)"tid", __pyx_getprop_9csamtools_11AlignedRead_tid, __pyx_setprop_9csamtools_11AlignedRead_tid, __Pyx_DOCSTR(__pyx_k_126), 0},
31213 {(char *)"pos", __pyx_getprop_9csamtools_11AlignedRead_pos, __pyx_setprop_9csamtools_11AlignedRead_pos, __Pyx_DOCSTR(__pyx_k_127), 0},
31214 {(char *)"bin", __pyx_getprop_9csamtools_11AlignedRead_bin, __pyx_setprop_9csamtools_11AlignedRead_bin, __Pyx_DOCSTR(__pyx_k_128), 0},
31215 {(char *)"rlen", __pyx_getprop_9csamtools_11AlignedRead_rlen, 0, __Pyx_DOCSTR(__pyx_k_129), 0},
31216 {(char *)"aend", __pyx_getprop_9csamtools_11AlignedRead_aend, 0, __Pyx_DOCSTR(__pyx_k_130), 0},
31217 {(char *)"alen", __pyx_getprop_9csamtools_11AlignedRead_alen, 0, __Pyx_DOCSTR(__pyx_k_131), 0},
31218 {(char *)"mapq", __pyx_getprop_9csamtools_11AlignedRead_mapq, __pyx_setprop_9csamtools_11AlignedRead_mapq, __Pyx_DOCSTR(__pyx_k_132), 0},
31219 {(char *)"mrnm", __pyx_getprop_9csamtools_11AlignedRead_mrnm, __pyx_setprop_9csamtools_11AlignedRead_mrnm, __Pyx_DOCSTR(__pyx_k_133), 0},
31220 {(char *)"mpos", __pyx_getprop_9csamtools_11AlignedRead_mpos, __pyx_setprop_9csamtools_11AlignedRead_mpos, __Pyx_DOCSTR(__pyx_k_134), 0},
31221 {(char *)"isize", __pyx_getprop_9csamtools_11AlignedRead_isize, __pyx_setprop_9csamtools_11AlignedRead_isize, __Pyx_DOCSTR(__pyx_k_135), 0},
31222 {(char *)"is_paired", __pyx_getprop_9csamtools_11AlignedRead_is_paired, __pyx_setprop_9csamtools_11AlignedRead_is_paired, __Pyx_DOCSTR(__pyx_k_136), 0},
31223 {(char *)"is_proper_pair", __pyx_getprop_9csamtools_11AlignedRead_is_proper_pair, __pyx_setprop_9csamtools_11AlignedRead_is_proper_pair, __Pyx_DOCSTR(__pyx_k_137), 0},
31224 {(char *)"is_unmapped", __pyx_getprop_9csamtools_11AlignedRead_is_unmapped, __pyx_setprop_9csamtools_11AlignedRead_is_unmapped, __Pyx_DOCSTR(__pyx_k_138), 0},
31225 {(char *)"mate_is_unmapped", __pyx_getprop_9csamtools_11AlignedRead_mate_is_unmapped, __pyx_setprop_9csamtools_11AlignedRead_mate_is_unmapped, __Pyx_DOCSTR(__pyx_k_139), 0},
31226 {(char *)"is_reverse", __pyx_getprop_9csamtools_11AlignedRead_is_reverse, __pyx_setprop_9csamtools_11AlignedRead_is_reverse, __Pyx_DOCSTR(__pyx_k_140), 0},
31227 {(char *)"mate_is_reverse", __pyx_getprop_9csamtools_11AlignedRead_mate_is_reverse, __pyx_setprop_9csamtools_11AlignedRead_mate_is_reverse, __Pyx_DOCSTR(__pyx_k_141), 0},
31228 {(char *)"is_read1", __pyx_getprop_9csamtools_11AlignedRead_is_read1, __pyx_setprop_9csamtools_11AlignedRead_is_read1, __Pyx_DOCSTR(__pyx_k_142), 0},
31229 {(char *)"is_read2", __pyx_getprop_9csamtools_11AlignedRead_is_read2, __pyx_setprop_9csamtools_11AlignedRead_is_read2, __Pyx_DOCSTR(__pyx_k_143), 0},
31230 {(char *)"is_secondary", __pyx_getprop_9csamtools_11AlignedRead_is_secondary, __pyx_setprop_9csamtools_11AlignedRead_is_secondary, __Pyx_DOCSTR(__pyx_k_144), 0},
31231 {(char *)"is_qcfail", __pyx_getprop_9csamtools_11AlignedRead_is_qcfail, __pyx_setprop_9csamtools_11AlignedRead_is_qcfail, __Pyx_DOCSTR(__pyx_k_145), 0},
31232 {(char *)"is_duplicate", __pyx_getprop_9csamtools_11AlignedRead_is_duplicate, __pyx_setprop_9csamtools_11AlignedRead_is_duplicate, __Pyx_DOCSTR(__pyx_k_146), 0},
31233 {(char *)"positions", __pyx_getprop_9csamtools_11AlignedRead_positions, 0, __Pyx_DOCSTR(__pyx_k_147), 0},
31237 static PyNumberMethods __pyx_tp_as_number_AlignedRead = {
31241 #if PY_MAJOR_VERSION < 3
31244 0, /*nb_remainder*/
31257 #if PY_MAJOR_VERSION < 3
31261 #if PY_MAJOR_VERSION < 3
31267 #if PY_MAJOR_VERSION < 3
31270 #if PY_MAJOR_VERSION < 3
31273 0, /*nb_inplace_add*/
31274 0, /*nb_inplace_subtract*/
31275 0, /*nb_inplace_multiply*/
31276 #if PY_MAJOR_VERSION < 3
31277 0, /*nb_inplace_divide*/
31279 0, /*nb_inplace_remainder*/
31280 0, /*nb_inplace_power*/
31281 0, /*nb_inplace_lshift*/
31282 0, /*nb_inplace_rshift*/
31283 0, /*nb_inplace_and*/
31284 0, /*nb_inplace_xor*/
31285 0, /*nb_inplace_or*/
31286 0, /*nb_floor_divide*/
31287 0, /*nb_true_divide*/
31288 0, /*nb_inplace_floor_divide*/
31289 0, /*nb_inplace_true_divide*/
31290 #if PY_VERSION_HEX >= 0x02050000
31295 static PySequenceMethods __pyx_tp_as_sequence_AlignedRead = {
31302 0, /*sq_ass_slice*/
31304 0, /*sq_inplace_concat*/
31305 0, /*sq_inplace_repeat*/
31308 static PyMappingMethods __pyx_tp_as_mapping_AlignedRead = {
31310 0, /*mp_subscript*/
31311 0, /*mp_ass_subscript*/
31314 static PyBufferProcs __pyx_tp_as_buffer_AlignedRead = {
31315 #if PY_MAJOR_VERSION < 3
31316 0, /*bf_getreadbuffer*/
31318 #if PY_MAJOR_VERSION < 3
31319 0, /*bf_getwritebuffer*/
31321 #if PY_MAJOR_VERSION < 3
31322 0, /*bf_getsegcount*/
31324 #if PY_MAJOR_VERSION < 3
31325 0, /*bf_getcharbuffer*/
31327 #if PY_VERSION_HEX >= 0x02060000
31328 0, /*bf_getbuffer*/
31330 #if PY_VERSION_HEX >= 0x02060000
31331 0, /*bf_releasebuffer*/
31335 PyTypeObject __pyx_type_9csamtools_AlignedRead = {
31336 PyVarObject_HEAD_INIT(0, 0)
31337 __Pyx_NAMESTR("csamtools.AlignedRead"), /*tp_name*/
31338 sizeof(struct __pyx_obj_9csamtools_AlignedRead), /*tp_basicsize*/
31340 __pyx_tp_dealloc_9csamtools_AlignedRead, /*tp_dealloc*/
31344 #if PY_MAJOR_VERSION < 3
31350 &__pyx_tp_as_number_AlignedRead, /*tp_as_number*/
31351 &__pyx_tp_as_sequence_AlignedRead, /*tp_as_sequence*/
31352 &__pyx_tp_as_mapping_AlignedRead, /*tp_as_mapping*/
31353 __pyx_pf_9csamtools_11AlignedRead___hash__, /*tp_hash*/
31355 __pyx_pf_9csamtools_11AlignedRead___str__, /*tp_str*/
31358 &__pyx_tp_as_buffer_AlignedRead, /*tp_as_buffer*/
31359 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER, /*tp_flags*/
31360 __Pyx_DOCSTR("AlignedRead()\n\n Class representing an aligned read. see SAM format specification for \n the meaning of fields (http://samtools.sourceforge.net/).\n\n This class stores a handle to the samtools C-structure representing\n an aligned read. Member read access is forwarded to the C-structure\n and converted into python objects. This implementation should be fast,\n as only the data needed is converted.\n\n For write access, the C-structure is updated in-place. This is\n not the most efficient way to build BAM entries, as the variable\n length data is concatenated and thus needs to resized if\n a field is updated. Furthermore, the BAM entry might be\n in an inconsistent state. The :meth:`~validate` method can\n be used to check if an entry is consistent.\n\n One issue to look out for is that the sequence should always\n be set *before* the quality scores. Setting the sequence will\n also erase any quality scores that were set previously.\n "), /*tp_doc*/
31363 0, /*tp_richcompare*/
31364 0, /*tp_weaklistoffset*/
31367 __pyx_methods_9csamtools_AlignedRead, /*tp_methods*/
31369 __pyx_getsets_9csamtools_AlignedRead, /*tp_getset*/
31372 0, /*tp_descr_get*/
31373 0, /*tp_descr_set*/
31374 0, /*tp_dictoffset*/
31375 __pyx_pf_9csamtools_11AlignedRead___init__, /*tp_init*/
31377 __pyx_tp_new_9csamtools_AlignedRead, /*tp_new*/
31383 0, /*tp_subclasses*/
31386 #if PY_VERSION_HEX >= 0x02060000
31387 0, /*tp_version_tag*/
31390 static struct __pyx_vtabstruct_9csamtools_Samfile __pyx_vtable_9csamtools_Samfile;
31392 static PyObject *__pyx_tp_new_9csamtools_Samfile(PyTypeObject *t, PyObject *a, PyObject *k) {
31393 struct __pyx_obj_9csamtools_Samfile *p;
31394 PyObject *o = (*t->tp_alloc)(t, 0);
31396 p = ((struct __pyx_obj_9csamtools_Samfile *)o);
31397 p->__pyx_vtab = __pyx_vtabptr_9csamtools_Samfile;
31398 if (__pyx_pf_9csamtools_7Samfile___cinit__(o, a, k) < 0) {
31399 Py_DECREF(o); o = 0;
31404 static void __pyx_tp_dealloc_9csamtools_Samfile(PyObject *o) {
31406 PyObject *etype, *eval, *etb;
31407 PyErr_Fetch(&etype, &eval, &etb);
31409 __pyx_pf_9csamtools_7Samfile___dealloc__(o);
31410 if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
31412 PyErr_Restore(etype, eval, etb);
31414 (*Py_TYPE(o)->tp_free)(o);
31417 static PyObject *__pyx_getprop_9csamtools_7Samfile_filename(PyObject *o, void *x) {
31418 return __pyx_pf_9csamtools_7Samfile_8filename___get__(o);
31421 static PyObject *__pyx_getprop_9csamtools_7Samfile_nreferences(PyObject *o, void *x) {
31422 return __pyx_pf_9csamtools_7Samfile_11nreferences___get__(o);
31425 static PyObject *__pyx_getprop_9csamtools_7Samfile_references(PyObject *o, void *x) {
31426 return __pyx_pf_9csamtools_7Samfile_10references___get__(o);
31429 static PyObject *__pyx_getprop_9csamtools_7Samfile_lengths(PyObject *o, void *x) {
31430 return __pyx_pf_9csamtools_7Samfile_7lengths___get__(o);
31433 static PyObject *__pyx_getprop_9csamtools_7Samfile_text(PyObject *o, void *x) {
31434 return __pyx_pf_9csamtools_7Samfile_4text___get__(o);
31437 static PyObject *__pyx_getprop_9csamtools_7Samfile_header(PyObject *o, void *x) {
31438 return __pyx_pf_9csamtools_7Samfile_6header___get__(o);
31441 static PyMethodDef __pyx_methods_9csamtools_Samfile[] = {
31442 {__Pyx_NAMESTR("_isOpen"), (PyCFunction)__pyx_pf_9csamtools_7Samfile__isOpen, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_9csamtools_7Samfile__isOpen)},
31443 {__Pyx_NAMESTR("_hasIndex"), (PyCFunction)__pyx_pf_9csamtools_7Samfile__hasIndex, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_9csamtools_7Samfile__hasIndex)},
31444 {__Pyx_NAMESTR("_open"), (PyCFunction)__pyx_pf_9csamtools_7Samfile__open, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_9csamtools_7Samfile__open)},
31445 {__Pyx_NAMESTR("gettid"), (PyCFunction)__pyx_pf_9csamtools_7Samfile_gettid, METH_O, __Pyx_DOCSTR(__pyx_doc_9csamtools_7Samfile_gettid)},
31446 {__Pyx_NAMESTR("getrname"), (PyCFunction)__pyx_pf_9csamtools_7Samfile_getrname, METH_O, __Pyx_DOCSTR(__pyx_doc_9csamtools_7Samfile_getrname)},
31447 {__Pyx_NAMESTR("_parseRegion"), (PyCFunction)__pyx_pf_9csamtools_7Samfile__parseRegion, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_9csamtools_7Samfile__parseRegion)},
31448 {__Pyx_NAMESTR("seek"), (PyCFunction)__pyx_pf_9csamtools_7Samfile_seek, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_9csamtools_7Samfile_seek)},
31449 {__Pyx_NAMESTR("tell"), (PyCFunction)__pyx_pf_9csamtools_7Samfile_tell, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_9csamtools_7Samfile_tell)},
31450 {__Pyx_NAMESTR("fetch"), (PyCFunction)__pyx_pf_9csamtools_7Samfile_fetch, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_9csamtools_7Samfile_fetch)},
31451 {__Pyx_NAMESTR("mate"), (PyCFunction)__pyx_pf_9csamtools_7Samfile_mate, METH_O, __Pyx_DOCSTR(__pyx_doc_9csamtools_7Samfile_mate)},
31452 {__Pyx_NAMESTR("count"), (PyCFunction)__pyx_pf_9csamtools_7Samfile_count, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_9csamtools_7Samfile_count)},
31453 {__Pyx_NAMESTR("pileup"), (PyCFunction)__pyx_pf_9csamtools_7Samfile_pileup, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_9csamtools_7Samfile_pileup)},
31454 {__Pyx_NAMESTR("close"), (PyCFunction)__pyx_pf_9csamtools_7Samfile_close, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_9csamtools_7Samfile_close)},
31455 {__Pyx_NAMESTR("write"), (PyCFunction)__pyx_pf_9csamtools_7Samfile_write, METH_O, __Pyx_DOCSTR(__pyx_doc_9csamtools_7Samfile_write)},
31456 {__Pyx_NAMESTR("__enter__"), (PyCFunction)__pyx_pf_9csamtools_7Samfile___enter__, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_9csamtools_7Samfile___enter__)},
31457 {__Pyx_NAMESTR("__exit__"), (PyCFunction)__pyx_pf_9csamtools_7Samfile___exit__, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_9csamtools_7Samfile___exit__)},
31458 {__Pyx_NAMESTR("_buildLine"), (PyCFunction)__pyx_pf_9csamtools_7Samfile__buildLine, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_9csamtools_7Samfile__buildLine)},
31459 {__Pyx_NAMESTR("__next__"), (PyCFunction)__pyx_pf_9csamtools_7Samfile___next__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(__pyx_doc_9csamtools_7Samfile___next__)},
31463 static struct PyGetSetDef __pyx_getsets_9csamtools_Samfile[] = {
31464 {(char *)"filename", __pyx_getprop_9csamtools_7Samfile_filename, 0, __Pyx_DOCSTR(__pyx_k_148), 0},
31465 {(char *)"nreferences", __pyx_getprop_9csamtools_7Samfile_nreferences, 0, __Pyx_DOCSTR(__pyx_k_149), 0},
31466 {(char *)"references", __pyx_getprop_9csamtools_7Samfile_references, 0, __Pyx_DOCSTR(__pyx_k_150), 0},
31467 {(char *)"lengths", __pyx_getprop_9csamtools_7Samfile_lengths, 0, __Pyx_DOCSTR(__pyx_k_151), 0},
31468 {(char *)"text", __pyx_getprop_9csamtools_7Samfile_text, 0, __Pyx_DOCSTR(__pyx_k_152), 0},
31469 {(char *)"header", __pyx_getprop_9csamtools_7Samfile_header, 0, __Pyx_DOCSTR(__pyx_k_153), 0},
31473 static PyNumberMethods __pyx_tp_as_number_Samfile = {
31477 #if PY_MAJOR_VERSION < 3
31480 0, /*nb_remainder*/
31493 #if PY_MAJOR_VERSION < 3
31497 #if PY_MAJOR_VERSION < 3
31503 #if PY_MAJOR_VERSION < 3
31506 #if PY_MAJOR_VERSION < 3
31509 0, /*nb_inplace_add*/
31510 0, /*nb_inplace_subtract*/
31511 0, /*nb_inplace_multiply*/
31512 #if PY_MAJOR_VERSION < 3
31513 0, /*nb_inplace_divide*/
31515 0, /*nb_inplace_remainder*/
31516 0, /*nb_inplace_power*/
31517 0, /*nb_inplace_lshift*/
31518 0, /*nb_inplace_rshift*/
31519 0, /*nb_inplace_and*/
31520 0, /*nb_inplace_xor*/
31521 0, /*nb_inplace_or*/
31522 0, /*nb_floor_divide*/
31523 0, /*nb_true_divide*/
31524 0, /*nb_inplace_floor_divide*/
31525 0, /*nb_inplace_true_divide*/
31526 #if PY_VERSION_HEX >= 0x02050000
31531 static PySequenceMethods __pyx_tp_as_sequence_Samfile = {
31538 0, /*sq_ass_slice*/
31540 0, /*sq_inplace_concat*/
31541 0, /*sq_inplace_repeat*/
31544 static PyMappingMethods __pyx_tp_as_mapping_Samfile = {
31546 0, /*mp_subscript*/
31547 0, /*mp_ass_subscript*/
31550 static PyBufferProcs __pyx_tp_as_buffer_Samfile = {
31551 #if PY_MAJOR_VERSION < 3
31552 0, /*bf_getreadbuffer*/
31554 #if PY_MAJOR_VERSION < 3
31555 0, /*bf_getwritebuffer*/
31557 #if PY_MAJOR_VERSION < 3
31558 0, /*bf_getsegcount*/
31560 #if PY_MAJOR_VERSION < 3
31561 0, /*bf_getcharbuffer*/
31563 #if PY_VERSION_HEX >= 0x02060000
31564 0, /*bf_getbuffer*/
31566 #if PY_VERSION_HEX >= 0x02060000
31567 0, /*bf_releasebuffer*/
31571 PyTypeObject __pyx_type_9csamtools_Samfile = {
31572 PyVarObject_HEAD_INIT(0, 0)
31573 __Pyx_NAMESTR("csamtools.Samfile"), /*tp_name*/
31574 sizeof(struct __pyx_obj_9csamtools_Samfile), /*tp_basicsize*/
31576 __pyx_tp_dealloc_9csamtools_Samfile, /*tp_dealloc*/
31580 #if PY_MAJOR_VERSION < 3
31586 &__pyx_tp_as_number_Samfile, /*tp_as_number*/
31587 &__pyx_tp_as_sequence_Samfile, /*tp_as_sequence*/
31588 &__pyx_tp_as_mapping_Samfile, /*tp_as_mapping*/
31594 &__pyx_tp_as_buffer_Samfile, /*tp_as_buffer*/
31595 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER, /*tp_flags*/
31596 __Pyx_DOCSTR("*(filename, mode=None, template = None, referencenames = None, referencelengths = None, text = NULL, header = None)*\n \n A :term:`SAM`/:term:`BAM` formatted file. The file is automatically opened.\n \n *mode* should be ``r`` for reading or ``w`` for writing. The default is text mode (:term:`SAM`). For binary \n (:term:`BAM`) I/O you should append ``b`` for compressed or ``u`` for uncompressed :term:`BAM` output. \n Use ``h`` to output header information in text (:term:`TAM`) mode.\n\n If ``b`` is present, it must immediately follow ``r`` or ``w``. \n Valid modes are ``r``, ``w``, ``wh``, ``rb``, ``wb`` and ``wbu``. For instance, to open \n a :term:`BAM` formatted file for reading, type::\n\n f = pysam.Samfile('ex1.bam','rb')\n\n If mode is not specified, we will try to auto-detect in the order 'r', 'rb', thus both the following\n should work::\n\n f1 = pysam.Samfile('ex1.bam' )\n f2 = pysam.Samfile('ex1.bam' )\n\n If an index for a BAM file exists (.bai), it will be opened automatically. Without an index random\n access to reads via :meth:`fetch` and :meth:`pileup` is disabled.\n\n For writing, the header of a :term:`SAM` file/:term:`BAM` file can be constituted from several\n sources (see also the samtools format specification):\n\n 1. If *template* is given, the header is copied from a another *Samfile* \n (*template* must be of type *Samfile*).\n\n 2. If *header* is given, the header is built from a multi-level dictionary. The first level \n are the four types ('HD', 'SQ', ...). The second level are a list of lines, with each line \n being a list of tag-value pairs.\n\n 3. If *text* is given, new header text is copied from raw text.\n\n 4. The names (*referencenames*) and lengths (*referencelengths*) are supplied directly as lists. \n\n "), /*tp_doc*/
31599 0, /*tp_richcompare*/
31600 0, /*tp_weaklistoffset*/
31601 __pyx_pf_9csamtools_7Samfile___iter__, /*tp_iter*/
31602 __pyx_pf_9csamtools_7Samfile___next__, /*tp_iternext*/
31603 __pyx_methods_9csamtools_Samfile, /*tp_methods*/
31605 __pyx_getsets_9csamtools_Samfile, /*tp_getset*/
31608 0, /*tp_descr_get*/
31609 0, /*tp_descr_set*/
31610 0, /*tp_dictoffset*/
31613 __pyx_tp_new_9csamtools_Samfile, /*tp_new*/
31619 0, /*tp_subclasses*/
31622 #if PY_VERSION_HEX >= 0x02060000
31623 0, /*tp_version_tag*/
31627 static PyObject *__pyx_tp_new_9csamtools_PileupProxy(PyTypeObject *t, PyObject *a, PyObject *k) {
31628 PyObject *o = (*t->tp_alloc)(t, 0);
31633 static void __pyx_tp_dealloc_9csamtools_PileupProxy(PyObject *o) {
31634 (*Py_TYPE(o)->tp_free)(o);
31637 static PyObject *__pyx_getprop_9csamtools_11PileupProxy_tid(PyObject *o, void *x) {
31638 return __pyx_pf_9csamtools_11PileupProxy_3tid___get__(o);
31641 static PyObject *__pyx_getprop_9csamtools_11PileupProxy_n(PyObject *o, void *x) {
31642 return __pyx_pf_9csamtools_11PileupProxy_1n___get__(o);
31645 static int __pyx_setprop_9csamtools_11PileupProxy_n(PyObject *o, PyObject *v, void *x) {
31647 return __pyx_pf_9csamtools_11PileupProxy_1n___set__(o, v);
31650 PyErr_SetString(PyExc_NotImplementedError, "__del__");
31655 static PyObject *__pyx_getprop_9csamtools_11PileupProxy_pos(PyObject *o, void *x) {
31656 return __pyx_pf_9csamtools_11PileupProxy_3pos___get__(o);
31659 static PyObject *__pyx_getprop_9csamtools_11PileupProxy_pileups(PyObject *o, void *x) {
31660 return __pyx_pf_9csamtools_11PileupProxy_7pileups___get__(o);
31663 static PyMethodDef __pyx_methods_9csamtools_PileupProxy[] = {
31667 static struct PyGetSetDef __pyx_getsets_9csamtools_PileupProxy[] = {
31668 {(char *)"tid", __pyx_getprop_9csamtools_11PileupProxy_tid, 0, __Pyx_DOCSTR(__pyx_k_154), 0},
31669 {(char *)"n", __pyx_getprop_9csamtools_11PileupProxy_n, __pyx_setprop_9csamtools_11PileupProxy_n, __Pyx_DOCSTR(__pyx_k_155), 0},
31670 {(char *)"pos", __pyx_getprop_9csamtools_11PileupProxy_pos, 0, 0, 0},
31671 {(char *)"pileups", __pyx_getprop_9csamtools_11PileupProxy_pileups, 0, __Pyx_DOCSTR(__pyx_k_156), 0},
31675 static PyNumberMethods __pyx_tp_as_number_PileupProxy = {
31679 #if PY_MAJOR_VERSION < 3
31682 0, /*nb_remainder*/
31695 #if PY_MAJOR_VERSION < 3
31699 #if PY_MAJOR_VERSION < 3
31705 #if PY_MAJOR_VERSION < 3
31708 #if PY_MAJOR_VERSION < 3
31711 0, /*nb_inplace_add*/
31712 0, /*nb_inplace_subtract*/
31713 0, /*nb_inplace_multiply*/
31714 #if PY_MAJOR_VERSION < 3
31715 0, /*nb_inplace_divide*/
31717 0, /*nb_inplace_remainder*/
31718 0, /*nb_inplace_power*/
31719 0, /*nb_inplace_lshift*/
31720 0, /*nb_inplace_rshift*/
31721 0, /*nb_inplace_and*/
31722 0, /*nb_inplace_xor*/
31723 0, /*nb_inplace_or*/
31724 0, /*nb_floor_divide*/
31725 0, /*nb_true_divide*/
31726 0, /*nb_inplace_floor_divide*/
31727 0, /*nb_inplace_true_divide*/
31728 #if PY_VERSION_HEX >= 0x02050000
31733 static PySequenceMethods __pyx_tp_as_sequence_PileupProxy = {
31740 0, /*sq_ass_slice*/
31742 0, /*sq_inplace_concat*/
31743 0, /*sq_inplace_repeat*/
31746 static PyMappingMethods __pyx_tp_as_mapping_PileupProxy = {
31748 0, /*mp_subscript*/
31749 0, /*mp_ass_subscript*/
31752 static PyBufferProcs __pyx_tp_as_buffer_PileupProxy = {
31753 #if PY_MAJOR_VERSION < 3
31754 0, /*bf_getreadbuffer*/
31756 #if PY_MAJOR_VERSION < 3
31757 0, /*bf_getwritebuffer*/
31759 #if PY_MAJOR_VERSION < 3
31760 0, /*bf_getsegcount*/
31762 #if PY_MAJOR_VERSION < 3
31763 0, /*bf_getcharbuffer*/
31765 #if PY_VERSION_HEX >= 0x02060000
31766 0, /*bf_getbuffer*/
31768 #if PY_VERSION_HEX >= 0x02060000
31769 0, /*bf_releasebuffer*/
31773 PyTypeObject __pyx_type_9csamtools_PileupProxy = {
31774 PyVarObject_HEAD_INIT(0, 0)
31775 __Pyx_NAMESTR("csamtools.PileupProxy"), /*tp_name*/
31776 sizeof(struct __pyx_obj_9csamtools_PileupProxy), /*tp_basicsize*/
31778 __pyx_tp_dealloc_9csamtools_PileupProxy, /*tp_dealloc*/
31782 #if PY_MAJOR_VERSION < 3
31788 &__pyx_tp_as_number_PileupProxy, /*tp_as_number*/
31789 &__pyx_tp_as_sequence_PileupProxy, /*tp_as_sequence*/
31790 &__pyx_tp_as_mapping_PileupProxy, /*tp_as_mapping*/
31793 __pyx_pf_9csamtools_11PileupProxy___str__, /*tp_str*/
31796 &__pyx_tp_as_buffer_PileupProxy, /*tp_as_buffer*/
31797 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER, /*tp_flags*/
31798 __Pyx_DOCSTR("PileupProxy()\nA pileup column. A pileup column contains\n all the reads that map to a certain target base.\n\n tid\n chromosome ID as is defined in the header\n pos\n the target base coordinate (0-based)\n n\n number of reads mapping to this column \n pileups\n list of reads (:class:`pysam.PileupRead`) aligned to this column\n\n This class is a proxy for results returned by the samtools pileup engine.\n If the underlying engine iterator advances, the results of this column\n will change.\n "), /*tp_doc*/
31801 0, /*tp_richcompare*/
31802 0, /*tp_weaklistoffset*/
31805 __pyx_methods_9csamtools_PileupProxy, /*tp_methods*/
31807 __pyx_getsets_9csamtools_PileupProxy, /*tp_getset*/
31810 0, /*tp_descr_get*/
31811 0, /*tp_descr_set*/
31812 0, /*tp_dictoffset*/
31813 __pyx_pf_9csamtools_11PileupProxy___init__, /*tp_init*/
31815 __pyx_tp_new_9csamtools_PileupProxy, /*tp_new*/
31821 0, /*tp_subclasses*/
31824 #if PY_VERSION_HEX >= 0x02060000
31825 0, /*tp_version_tag*/
31829 static PyObject *__pyx_tp_new_9csamtools_PileupRead(PyTypeObject *t, PyObject *a, PyObject *k) {
31830 struct __pyx_obj_9csamtools_PileupRead *p;
31831 PyObject *o = (*t->tp_alloc)(t, 0);
31833 p = ((struct __pyx_obj_9csamtools_PileupRead *)o);
31834 p->_alignment = ((struct __pyx_obj_9csamtools_AlignedRead *)Py_None); Py_INCREF(Py_None);
31838 static void __pyx_tp_dealloc_9csamtools_PileupRead(PyObject *o) {
31839 struct __pyx_obj_9csamtools_PileupRead *p = (struct __pyx_obj_9csamtools_PileupRead *)o;
31840 Py_XDECREF(((PyObject *)p->_alignment));
31841 (*Py_TYPE(o)->tp_free)(o);
31844 static int __pyx_tp_traverse_9csamtools_PileupRead(PyObject *o, visitproc v, void *a) {
31846 struct __pyx_obj_9csamtools_PileupRead *p = (struct __pyx_obj_9csamtools_PileupRead *)o;
31847 if (p->_alignment) {
31848 e = (*v)(((PyObject*)p->_alignment), a); if (e) return e;
31853 static int __pyx_tp_clear_9csamtools_PileupRead(PyObject *o) {
31854 struct __pyx_obj_9csamtools_PileupRead *p = (struct __pyx_obj_9csamtools_PileupRead *)o;
31856 tmp = ((PyObject*)p->_alignment);
31857 p->_alignment = ((struct __pyx_obj_9csamtools_AlignedRead *)Py_None); Py_INCREF(Py_None);
31862 static PyObject *__pyx_getprop_9csamtools_10PileupRead_alignment(PyObject *o, void *x) {
31863 return __pyx_pf_9csamtools_10PileupRead_9alignment___get__(o);
31866 static PyObject *__pyx_getprop_9csamtools_10PileupRead_qpos(PyObject *o, void *x) {
31867 return __pyx_pf_9csamtools_10PileupRead_4qpos___get__(o);
31870 static PyObject *__pyx_getprop_9csamtools_10PileupRead_indel(PyObject *o, void *x) {
31871 return __pyx_pf_9csamtools_10PileupRead_5indel___get__(o);
31874 static PyObject *__pyx_getprop_9csamtools_10PileupRead_is_del(PyObject *o, void *x) {
31875 return __pyx_pf_9csamtools_10PileupRead_6is_del___get__(o);
31878 static PyObject *__pyx_getprop_9csamtools_10PileupRead_is_head(PyObject *o, void *x) {
31879 return __pyx_pf_9csamtools_10PileupRead_7is_head___get__(o);
31882 static PyObject *__pyx_getprop_9csamtools_10PileupRead_is_tail(PyObject *o, void *x) {
31883 return __pyx_pf_9csamtools_10PileupRead_7is_tail___get__(o);
31886 static PyObject *__pyx_getprop_9csamtools_10PileupRead_level(PyObject *o, void *x) {
31887 return __pyx_pf_9csamtools_10PileupRead_5level___get__(o);
31890 static PyMethodDef __pyx_methods_9csamtools_PileupRead[] = {
31894 static struct PyGetSetDef __pyx_getsets_9csamtools_PileupRead[] = {
31895 {(char *)"alignment", __pyx_getprop_9csamtools_10PileupRead_alignment, 0, __Pyx_DOCSTR(__pyx_k_157), 0},
31896 {(char *)"qpos", __pyx_getprop_9csamtools_10PileupRead_qpos, 0, __Pyx_DOCSTR(__pyx_k_158), 0},
31897 {(char *)"indel", __pyx_getprop_9csamtools_10PileupRead_indel, 0, __Pyx_DOCSTR(__pyx_k_159), 0},
31898 {(char *)"is_del", __pyx_getprop_9csamtools_10PileupRead_is_del, 0, __Pyx_DOCSTR(__pyx_k_160), 0},
31899 {(char *)"is_head", __pyx_getprop_9csamtools_10PileupRead_is_head, 0, 0, 0},
31900 {(char *)"is_tail", __pyx_getprop_9csamtools_10PileupRead_is_tail, 0, 0, 0},
31901 {(char *)"level", __pyx_getprop_9csamtools_10PileupRead_level, 0, 0, 0},
31905 static PyNumberMethods __pyx_tp_as_number_PileupRead = {
31909 #if PY_MAJOR_VERSION < 3
31912 0, /*nb_remainder*/
31925 #if PY_MAJOR_VERSION < 3
31929 #if PY_MAJOR_VERSION < 3
31935 #if PY_MAJOR_VERSION < 3
31938 #if PY_MAJOR_VERSION < 3
31941 0, /*nb_inplace_add*/
31942 0, /*nb_inplace_subtract*/
31943 0, /*nb_inplace_multiply*/
31944 #if PY_MAJOR_VERSION < 3
31945 0, /*nb_inplace_divide*/
31947 0, /*nb_inplace_remainder*/
31948 0, /*nb_inplace_power*/
31949 0, /*nb_inplace_lshift*/
31950 0, /*nb_inplace_rshift*/
31951 0, /*nb_inplace_and*/
31952 0, /*nb_inplace_xor*/
31953 0, /*nb_inplace_or*/
31954 0, /*nb_floor_divide*/
31955 0, /*nb_true_divide*/
31956 0, /*nb_inplace_floor_divide*/
31957 0, /*nb_inplace_true_divide*/
31958 #if PY_VERSION_HEX >= 0x02050000
31963 static PySequenceMethods __pyx_tp_as_sequence_PileupRead = {
31970 0, /*sq_ass_slice*/
31972 0, /*sq_inplace_concat*/
31973 0, /*sq_inplace_repeat*/
31976 static PyMappingMethods __pyx_tp_as_mapping_PileupRead = {
31978 0, /*mp_subscript*/
31979 0, /*mp_ass_subscript*/
31982 static PyBufferProcs __pyx_tp_as_buffer_PileupRead = {
31983 #if PY_MAJOR_VERSION < 3
31984 0, /*bf_getreadbuffer*/
31986 #if PY_MAJOR_VERSION < 3
31987 0, /*bf_getwritebuffer*/
31989 #if PY_MAJOR_VERSION < 3
31990 0, /*bf_getsegcount*/
31992 #if PY_MAJOR_VERSION < 3
31993 0, /*bf_getcharbuffer*/
31995 #if PY_VERSION_HEX >= 0x02060000
31996 0, /*bf_getbuffer*/
31998 #if PY_VERSION_HEX >= 0x02060000
31999 0, /*bf_releasebuffer*/
32003 PyTypeObject __pyx_type_9csamtools_PileupRead = {
32004 PyVarObject_HEAD_INIT(0, 0)
32005 __Pyx_NAMESTR("csamtools.PileupRead"), /*tp_name*/
32006 sizeof(struct __pyx_obj_9csamtools_PileupRead), /*tp_basicsize*/
32008 __pyx_tp_dealloc_9csamtools_PileupRead, /*tp_dealloc*/
32012 #if PY_MAJOR_VERSION < 3
32018 &__pyx_tp_as_number_PileupRead, /*tp_as_number*/
32019 &__pyx_tp_as_sequence_PileupRead, /*tp_as_sequence*/
32020 &__pyx_tp_as_mapping_PileupRead, /*tp_as_mapping*/
32023 __pyx_pf_9csamtools_10PileupRead___str__, /*tp_str*/
32026 &__pyx_tp_as_buffer_PileupRead, /*tp_as_buffer*/
32027 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
32028 __Pyx_DOCSTR("PileupRead()\nA read aligned to a column.\n "), /*tp_doc*/
32029 __pyx_tp_traverse_9csamtools_PileupRead, /*tp_traverse*/
32030 __pyx_tp_clear_9csamtools_PileupRead, /*tp_clear*/
32031 0, /*tp_richcompare*/
32032 0, /*tp_weaklistoffset*/
32035 __pyx_methods_9csamtools_PileupRead, /*tp_methods*/
32037 __pyx_getsets_9csamtools_PileupRead, /*tp_getset*/
32040 0, /*tp_descr_get*/
32041 0, /*tp_descr_set*/
32042 0, /*tp_dictoffset*/
32043 __pyx_pf_9csamtools_10PileupRead___init__, /*tp_init*/
32045 __pyx_tp_new_9csamtools_PileupRead, /*tp_new*/
32051 0, /*tp_subclasses*/
32054 #if PY_VERSION_HEX >= 0x02060000
32055 0, /*tp_version_tag*/
32058 static struct __pyx_vtabstruct_9csamtools_Fastafile __pyx_vtable_9csamtools_Fastafile;
32060 static PyObject *__pyx_tp_new_9csamtools_Fastafile(PyTypeObject *t, PyObject *a, PyObject *k) {
32061 struct __pyx_obj_9csamtools_Fastafile *p;
32062 PyObject *o = (*t->tp_alloc)(t, 0);
32064 p = ((struct __pyx_obj_9csamtools_Fastafile *)o);
32065 p->__pyx_vtab = __pyx_vtabptr_9csamtools_Fastafile;
32066 if (__pyx_pf_9csamtools_9Fastafile___cinit__(o, a, k) < 0) {
32067 Py_DECREF(o); o = 0;
32072 static void __pyx_tp_dealloc_9csamtools_Fastafile(PyObject *o) {
32074 PyObject *etype, *eval, *etb;
32075 PyErr_Fetch(&etype, &eval, &etb);
32077 __pyx_pf_9csamtools_9Fastafile___dealloc__(o);
32078 if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
32080 PyErr_Restore(etype, eval, etb);
32082 (*Py_TYPE(o)->tp_free)(o);
32085 static PyObject *__pyx_getprop_9csamtools_9Fastafile_filename(PyObject *o, void *x) {
32086 return __pyx_pf_9csamtools_9Fastafile_8filename___get__(o);
32089 static PyMethodDef __pyx_methods_9csamtools_Fastafile[] = {
32090 {__Pyx_NAMESTR("_isOpen"), (PyCFunction)__pyx_pf_9csamtools_9Fastafile__isOpen, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_9csamtools_9Fastafile__isOpen)},
32091 {__Pyx_NAMESTR("_open"), (PyCFunction)__pyx_pf_9csamtools_9Fastafile__open, METH_O, __Pyx_DOCSTR(__pyx_doc_9csamtools_9Fastafile__open)},
32092 {__Pyx_NAMESTR("close"), (PyCFunction)__pyx_pf_9csamtools_9Fastafile_close, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_9csamtools_9Fastafile_close)},
32093 {__Pyx_NAMESTR("fetch"), (PyCFunction)__pyx_pf_9csamtools_9Fastafile_fetch, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_9csamtools_9Fastafile_fetch)},
32097 static struct PyGetSetDef __pyx_getsets_9csamtools_Fastafile[] = {
32098 {(char *)"filename", __pyx_getprop_9csamtools_9Fastafile_filename, 0, __Pyx_DOCSTR(__pyx_k_148), 0},
32102 static PyNumberMethods __pyx_tp_as_number_Fastafile = {
32106 #if PY_MAJOR_VERSION < 3
32109 0, /*nb_remainder*/
32122 #if PY_MAJOR_VERSION < 3
32126 #if PY_MAJOR_VERSION < 3
32132 #if PY_MAJOR_VERSION < 3
32135 #if PY_MAJOR_VERSION < 3
32138 0, /*nb_inplace_add*/
32139 0, /*nb_inplace_subtract*/
32140 0, /*nb_inplace_multiply*/
32141 #if PY_MAJOR_VERSION < 3
32142 0, /*nb_inplace_divide*/
32144 0, /*nb_inplace_remainder*/
32145 0, /*nb_inplace_power*/
32146 0, /*nb_inplace_lshift*/
32147 0, /*nb_inplace_rshift*/
32148 0, /*nb_inplace_and*/
32149 0, /*nb_inplace_xor*/
32150 0, /*nb_inplace_or*/
32151 0, /*nb_floor_divide*/
32152 0, /*nb_true_divide*/
32153 0, /*nb_inplace_floor_divide*/
32154 0, /*nb_inplace_true_divide*/
32155 #if PY_VERSION_HEX >= 0x02050000
32160 static PySequenceMethods __pyx_tp_as_sequence_Fastafile = {
32161 __pyx_pf_9csamtools_9Fastafile___len__, /*sq_length*/
32167 0, /*sq_ass_slice*/
32169 0, /*sq_inplace_concat*/
32170 0, /*sq_inplace_repeat*/
32173 static PyMappingMethods __pyx_tp_as_mapping_Fastafile = {
32174 __pyx_pf_9csamtools_9Fastafile___len__, /*mp_length*/
32175 0, /*mp_subscript*/
32176 0, /*mp_ass_subscript*/
32179 static PyBufferProcs __pyx_tp_as_buffer_Fastafile = {
32180 #if PY_MAJOR_VERSION < 3
32181 0, /*bf_getreadbuffer*/
32183 #if PY_MAJOR_VERSION < 3
32184 0, /*bf_getwritebuffer*/
32186 #if PY_MAJOR_VERSION < 3
32187 0, /*bf_getsegcount*/
32189 #if PY_MAJOR_VERSION < 3
32190 0, /*bf_getcharbuffer*/
32192 #if PY_VERSION_HEX >= 0x02060000
32193 0, /*bf_getbuffer*/
32195 #if PY_VERSION_HEX >= 0x02060000
32196 0, /*bf_releasebuffer*/
32200 PyTypeObject __pyx_type_9csamtools_Fastafile = {
32201 PyVarObject_HEAD_INIT(0, 0)
32202 __Pyx_NAMESTR("csamtools.Fastafile"), /*tp_name*/
32203 sizeof(struct __pyx_obj_9csamtools_Fastafile), /*tp_basicsize*/
32205 __pyx_tp_dealloc_9csamtools_Fastafile, /*tp_dealloc*/
32209 #if PY_MAJOR_VERSION < 3
32215 &__pyx_tp_as_number_Fastafile, /*tp_as_number*/
32216 &__pyx_tp_as_sequence_Fastafile, /*tp_as_sequence*/
32217 &__pyx_tp_as_mapping_Fastafile, /*tp_as_mapping*/
32223 &__pyx_tp_as_buffer_Fastafile, /*tp_as_buffer*/
32224 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER, /*tp_flags*/
32225 __Pyx_DOCSTR("*(filename)*\n \n A *FASTA* file. The file is automatically opened.\n\n The file expects an indexed fasta file.\n\n TODO: \n add automatic indexing.\n add function to get sequence names.\n "), /*tp_doc*/
32228 0, /*tp_richcompare*/
32229 0, /*tp_weaklistoffset*/
32232 __pyx_methods_9csamtools_Fastafile, /*tp_methods*/
32234 __pyx_getsets_9csamtools_Fastafile, /*tp_getset*/
32237 0, /*tp_descr_get*/
32238 0, /*tp_descr_set*/
32239 0, /*tp_dictoffset*/
32242 __pyx_tp_new_9csamtools_Fastafile, /*tp_new*/
32248 0, /*tp_subclasses*/
32251 #if PY_VERSION_HEX >= 0x02060000
32252 0, /*tp_version_tag*/
32256 static PyObject *__pyx_tp_new_9csamtools_IteratorRow(PyTypeObject *t, PyObject *a, PyObject *k) {
32257 PyObject *o = (*t->tp_alloc)(t, 0);
32262 static void __pyx_tp_dealloc_9csamtools_IteratorRow(PyObject *o) {
32263 (*Py_TYPE(o)->tp_free)(o);
32266 static PyMethodDef __pyx_methods_9csamtools_IteratorRow[] = {
32270 static PyNumberMethods __pyx_tp_as_number_IteratorRow = {
32274 #if PY_MAJOR_VERSION < 3
32277 0, /*nb_remainder*/
32290 #if PY_MAJOR_VERSION < 3
32294 #if PY_MAJOR_VERSION < 3
32300 #if PY_MAJOR_VERSION < 3
32303 #if PY_MAJOR_VERSION < 3
32306 0, /*nb_inplace_add*/
32307 0, /*nb_inplace_subtract*/
32308 0, /*nb_inplace_multiply*/
32309 #if PY_MAJOR_VERSION < 3
32310 0, /*nb_inplace_divide*/
32312 0, /*nb_inplace_remainder*/
32313 0, /*nb_inplace_power*/
32314 0, /*nb_inplace_lshift*/
32315 0, /*nb_inplace_rshift*/
32316 0, /*nb_inplace_and*/
32317 0, /*nb_inplace_xor*/
32318 0, /*nb_inplace_or*/
32319 0, /*nb_floor_divide*/
32320 0, /*nb_true_divide*/
32321 0, /*nb_inplace_floor_divide*/
32322 0, /*nb_inplace_true_divide*/
32323 #if PY_VERSION_HEX >= 0x02050000
32328 static PySequenceMethods __pyx_tp_as_sequence_IteratorRow = {
32335 0, /*sq_ass_slice*/
32337 0, /*sq_inplace_concat*/
32338 0, /*sq_inplace_repeat*/
32341 static PyMappingMethods __pyx_tp_as_mapping_IteratorRow = {
32343 0, /*mp_subscript*/
32344 0, /*mp_ass_subscript*/
32347 static PyBufferProcs __pyx_tp_as_buffer_IteratorRow = {
32348 #if PY_MAJOR_VERSION < 3
32349 0, /*bf_getreadbuffer*/
32351 #if PY_MAJOR_VERSION < 3
32352 0, /*bf_getwritebuffer*/
32354 #if PY_MAJOR_VERSION < 3
32355 0, /*bf_getsegcount*/
32357 #if PY_MAJOR_VERSION < 3
32358 0, /*bf_getcharbuffer*/
32360 #if PY_VERSION_HEX >= 0x02060000
32361 0, /*bf_getbuffer*/
32363 #if PY_VERSION_HEX >= 0x02060000
32364 0, /*bf_releasebuffer*/
32368 PyTypeObject __pyx_type_9csamtools_IteratorRow = {
32369 PyVarObject_HEAD_INIT(0, 0)
32370 __Pyx_NAMESTR("csamtools.IteratorRow"), /*tp_name*/
32371 sizeof(struct __pyx_obj_9csamtools_IteratorRow), /*tp_basicsize*/
32373 __pyx_tp_dealloc_9csamtools_IteratorRow, /*tp_dealloc*/
32377 #if PY_MAJOR_VERSION < 3
32383 &__pyx_tp_as_number_IteratorRow, /*tp_as_number*/
32384 &__pyx_tp_as_sequence_IteratorRow, /*tp_as_sequence*/
32385 &__pyx_tp_as_mapping_IteratorRow, /*tp_as_mapping*/
32391 &__pyx_tp_as_buffer_IteratorRow, /*tp_as_buffer*/
32392 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER, /*tp_flags*/
32393 __Pyx_DOCSTR("abstract base class for iterators over mapped reads.\n\n Various iterators implement different behaviours for wrapping around\n contig boundaries. Examples include:\n\n :class:`pysam.IteratorRowRegion`\n iterate within a single contig and a defined region.\n\n :class:`pysam.IteratorRowAll`\n iterate until EOF. This iterator will also include unmapped reads.\n\n :class:`pysam.IteratorRowAllRefs`\n iterate over all reads in all reference sequences.\n \n The method :meth:`Samfile.fetch` returns an IteratorRow.\n "), /*tp_doc*/
32396 0, /*tp_richcompare*/
32397 0, /*tp_weaklistoffset*/
32400 __pyx_methods_9csamtools_IteratorRow, /*tp_methods*/
32405 0, /*tp_descr_get*/
32406 0, /*tp_descr_set*/
32407 0, /*tp_dictoffset*/
32410 __pyx_tp_new_9csamtools_IteratorRow, /*tp_new*/
32416 0, /*tp_subclasses*/
32419 #if PY_VERSION_HEX >= 0x02060000
32420 0, /*tp_version_tag*/
32423 static struct __pyx_vtabstruct_9csamtools_IteratorRowRegion __pyx_vtable_9csamtools_IteratorRowRegion;
32425 static PyObject *__pyx_tp_new_9csamtools_IteratorRowRegion(PyTypeObject *t, PyObject *a, PyObject *k) {
32426 struct __pyx_obj_9csamtools_IteratorRowRegion *p;
32427 PyObject *o = __pyx_tp_new_9csamtools_IteratorRow(t, a, k);
32429 p = ((struct __pyx_obj_9csamtools_IteratorRowRegion *)o);
32430 p->__pyx_vtab = __pyx_vtabptr_9csamtools_IteratorRowRegion;
32431 p->samfile = ((struct __pyx_obj_9csamtools_Samfile *)Py_None); Py_INCREF(Py_None);
32432 if (__pyx_pf_9csamtools_17IteratorRowRegion___cinit__(o, a, k) < 0) {
32433 Py_DECREF(o); o = 0;
32438 static void __pyx_tp_dealloc_9csamtools_IteratorRowRegion(PyObject *o) {
32439 struct __pyx_obj_9csamtools_IteratorRowRegion *p = (struct __pyx_obj_9csamtools_IteratorRowRegion *)o;
32441 PyObject *etype, *eval, *etb;
32442 PyErr_Fetch(&etype, &eval, &etb);
32444 __pyx_pf_9csamtools_17IteratorRowRegion___dealloc__(o);
32445 if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
32447 PyErr_Restore(etype, eval, etb);
32449 Py_XDECREF(((PyObject *)p->samfile));
32450 __pyx_tp_dealloc_9csamtools_IteratorRow(o);
32453 static int __pyx_tp_traverse_9csamtools_IteratorRowRegion(PyObject *o, visitproc v, void *a) {
32455 struct __pyx_obj_9csamtools_IteratorRowRegion *p = (struct __pyx_obj_9csamtools_IteratorRowRegion *)o;
32456 if (__pyx_ptype_9csamtools_IteratorRow->tp_traverse) {
32457 e = __pyx_ptype_9csamtools_IteratorRow->tp_traverse(o, v, a); if (e) return e;
32460 e = (*v)(((PyObject*)p->samfile), a); if (e) return e;
32465 static int __pyx_tp_clear_9csamtools_IteratorRowRegion(PyObject *o) {
32466 struct __pyx_obj_9csamtools_IteratorRowRegion *p = (struct __pyx_obj_9csamtools_IteratorRowRegion *)o;
32468 if (__pyx_ptype_9csamtools_IteratorRow->tp_clear) {
32469 __pyx_ptype_9csamtools_IteratorRow->tp_clear(o);
32471 tmp = ((PyObject*)p->samfile);
32472 p->samfile = ((struct __pyx_obj_9csamtools_Samfile *)Py_None); Py_INCREF(Py_None);
32477 static PyMethodDef __pyx_methods_9csamtools_IteratorRowRegion[] = {
32478 {__Pyx_NAMESTR("__next__"), (PyCFunction)__pyx_pf_9csamtools_17IteratorRowRegion___next__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(__pyx_doc_9csamtools_17IteratorRowRegion___next__)},
32482 static PyNumberMethods __pyx_tp_as_number_IteratorRowRegion = {
32486 #if PY_MAJOR_VERSION < 3
32489 0, /*nb_remainder*/
32502 #if PY_MAJOR_VERSION < 3
32506 #if PY_MAJOR_VERSION < 3
32512 #if PY_MAJOR_VERSION < 3
32515 #if PY_MAJOR_VERSION < 3
32518 0, /*nb_inplace_add*/
32519 0, /*nb_inplace_subtract*/
32520 0, /*nb_inplace_multiply*/
32521 #if PY_MAJOR_VERSION < 3
32522 0, /*nb_inplace_divide*/
32524 0, /*nb_inplace_remainder*/
32525 0, /*nb_inplace_power*/
32526 0, /*nb_inplace_lshift*/
32527 0, /*nb_inplace_rshift*/
32528 0, /*nb_inplace_and*/
32529 0, /*nb_inplace_xor*/
32530 0, /*nb_inplace_or*/
32531 0, /*nb_floor_divide*/
32532 0, /*nb_true_divide*/
32533 0, /*nb_inplace_floor_divide*/
32534 0, /*nb_inplace_true_divide*/
32535 #if PY_VERSION_HEX >= 0x02050000
32540 static PySequenceMethods __pyx_tp_as_sequence_IteratorRowRegion = {
32547 0, /*sq_ass_slice*/
32549 0, /*sq_inplace_concat*/
32550 0, /*sq_inplace_repeat*/
32553 static PyMappingMethods __pyx_tp_as_mapping_IteratorRowRegion = {
32555 0, /*mp_subscript*/
32556 0, /*mp_ass_subscript*/
32559 static PyBufferProcs __pyx_tp_as_buffer_IteratorRowRegion = {
32560 #if PY_MAJOR_VERSION < 3
32561 0, /*bf_getreadbuffer*/
32563 #if PY_MAJOR_VERSION < 3
32564 0, /*bf_getwritebuffer*/
32566 #if PY_MAJOR_VERSION < 3
32567 0, /*bf_getsegcount*/
32569 #if PY_MAJOR_VERSION < 3
32570 0, /*bf_getcharbuffer*/
32572 #if PY_VERSION_HEX >= 0x02060000
32573 0, /*bf_getbuffer*/
32575 #if PY_VERSION_HEX >= 0x02060000
32576 0, /*bf_releasebuffer*/
32580 PyTypeObject __pyx_type_9csamtools_IteratorRowRegion = {
32581 PyVarObject_HEAD_INIT(0, 0)
32582 __Pyx_NAMESTR("csamtools.IteratorRowRegion"), /*tp_name*/
32583 sizeof(struct __pyx_obj_9csamtools_IteratorRowRegion), /*tp_basicsize*/
32585 __pyx_tp_dealloc_9csamtools_IteratorRowRegion, /*tp_dealloc*/
32589 #if PY_MAJOR_VERSION < 3
32595 &__pyx_tp_as_number_IteratorRowRegion, /*tp_as_number*/
32596 &__pyx_tp_as_sequence_IteratorRowRegion, /*tp_as_sequence*/
32597 &__pyx_tp_as_mapping_IteratorRowRegion, /*tp_as_mapping*/
32603 &__pyx_tp_as_buffer_IteratorRowRegion, /*tp_as_buffer*/
32604 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
32605 __Pyx_DOCSTR("*(Samfile samfile, int tid, int beg, int end, int reopen = True )*\n\n iterate over mapped reads in a region.\n\n By default, the file is re-openend to avoid conflicts between\n multiple iterators working on the same file. Set *reopen* = False\n to not re-open *samfile*.\n\n The samtools iterators assume that the file\n position between iterations do not change.\n As a consequence, no two iterators can work\n on the same file. To permit this, each iterator\n creates its own file handle by re-opening the\n file.\n\n Note that the index will be shared between \n samfile and the iterator.\n "), /*tp_doc*/
32606 __pyx_tp_traverse_9csamtools_IteratorRowRegion, /*tp_traverse*/
32607 __pyx_tp_clear_9csamtools_IteratorRowRegion, /*tp_clear*/
32608 0, /*tp_richcompare*/
32609 0, /*tp_weaklistoffset*/
32610 __pyx_pf_9csamtools_17IteratorRowRegion___iter__, /*tp_iter*/
32611 __pyx_pf_9csamtools_17IteratorRowRegion___next__, /*tp_iternext*/
32612 __pyx_methods_9csamtools_IteratorRowRegion, /*tp_methods*/
32617 0, /*tp_descr_get*/
32618 0, /*tp_descr_set*/
32619 0, /*tp_dictoffset*/
32622 __pyx_tp_new_9csamtools_IteratorRowRegion, /*tp_new*/
32628 0, /*tp_subclasses*/
32631 #if PY_VERSION_HEX >= 0x02060000
32632 0, /*tp_version_tag*/
32635 static struct __pyx_vtabstruct_9csamtools_IteratorRowAll __pyx_vtable_9csamtools_IteratorRowAll;
32637 static PyObject *__pyx_tp_new_9csamtools_IteratorRowAll(PyTypeObject *t, PyObject *a, PyObject *k) {
32638 struct __pyx_obj_9csamtools_IteratorRowAll *p;
32639 PyObject *o = __pyx_tp_new_9csamtools_IteratorRow(t, a, k);
32641 p = ((struct __pyx_obj_9csamtools_IteratorRowAll *)o);
32642 p->__pyx_vtab = __pyx_vtabptr_9csamtools_IteratorRowAll;
32643 if (__pyx_pf_9csamtools_14IteratorRowAll___cinit__(o, a, k) < 0) {
32644 Py_DECREF(o); o = 0;
32649 static void __pyx_tp_dealloc_9csamtools_IteratorRowAll(PyObject *o) {
32651 PyObject *etype, *eval, *etb;
32652 PyErr_Fetch(&etype, &eval, &etb);
32654 __pyx_pf_9csamtools_14IteratorRowAll___dealloc__(o);
32655 if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
32657 PyErr_Restore(etype, eval, etb);
32659 __pyx_tp_dealloc_9csamtools_IteratorRow(o);
32662 static PyMethodDef __pyx_methods_9csamtools_IteratorRowAll[] = {
32663 {__Pyx_NAMESTR("__next__"), (PyCFunction)__pyx_pf_9csamtools_14IteratorRowAll___next__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(__pyx_doc_9csamtools_14IteratorRowAll___next__)},
32667 static PyNumberMethods __pyx_tp_as_number_IteratorRowAll = {
32671 #if PY_MAJOR_VERSION < 3
32674 0, /*nb_remainder*/
32687 #if PY_MAJOR_VERSION < 3
32691 #if PY_MAJOR_VERSION < 3
32697 #if PY_MAJOR_VERSION < 3
32700 #if PY_MAJOR_VERSION < 3
32703 0, /*nb_inplace_add*/
32704 0, /*nb_inplace_subtract*/
32705 0, /*nb_inplace_multiply*/
32706 #if PY_MAJOR_VERSION < 3
32707 0, /*nb_inplace_divide*/
32709 0, /*nb_inplace_remainder*/
32710 0, /*nb_inplace_power*/
32711 0, /*nb_inplace_lshift*/
32712 0, /*nb_inplace_rshift*/
32713 0, /*nb_inplace_and*/
32714 0, /*nb_inplace_xor*/
32715 0, /*nb_inplace_or*/
32716 0, /*nb_floor_divide*/
32717 0, /*nb_true_divide*/
32718 0, /*nb_inplace_floor_divide*/
32719 0, /*nb_inplace_true_divide*/
32720 #if PY_VERSION_HEX >= 0x02050000
32725 static PySequenceMethods __pyx_tp_as_sequence_IteratorRowAll = {
32732 0, /*sq_ass_slice*/
32734 0, /*sq_inplace_concat*/
32735 0, /*sq_inplace_repeat*/
32738 static PyMappingMethods __pyx_tp_as_mapping_IteratorRowAll = {
32740 0, /*mp_subscript*/
32741 0, /*mp_ass_subscript*/
32744 static PyBufferProcs __pyx_tp_as_buffer_IteratorRowAll = {
32745 #if PY_MAJOR_VERSION < 3
32746 0, /*bf_getreadbuffer*/
32748 #if PY_MAJOR_VERSION < 3
32749 0, /*bf_getwritebuffer*/
32751 #if PY_MAJOR_VERSION < 3
32752 0, /*bf_getsegcount*/
32754 #if PY_MAJOR_VERSION < 3
32755 0, /*bf_getcharbuffer*/
32757 #if PY_VERSION_HEX >= 0x02060000
32758 0, /*bf_getbuffer*/
32760 #if PY_VERSION_HEX >= 0x02060000
32761 0, /*bf_releasebuffer*/
32765 PyTypeObject __pyx_type_9csamtools_IteratorRowAll = {
32766 PyVarObject_HEAD_INIT(0, 0)
32767 __Pyx_NAMESTR("csamtools.IteratorRowAll"), /*tp_name*/
32768 sizeof(struct __pyx_obj_9csamtools_IteratorRowAll), /*tp_basicsize*/
32770 __pyx_tp_dealloc_9csamtools_IteratorRowAll, /*tp_dealloc*/
32774 #if PY_MAJOR_VERSION < 3
32780 &__pyx_tp_as_number_IteratorRowAll, /*tp_as_number*/
32781 &__pyx_tp_as_sequence_IteratorRowAll, /*tp_as_sequence*/
32782 &__pyx_tp_as_mapping_IteratorRowAll, /*tp_as_mapping*/
32788 &__pyx_tp_as_buffer_IteratorRowAll, /*tp_as_buffer*/
32789 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER, /*tp_flags*/
32790 __Pyx_DOCSTR("*(Samfile samfile, int reopen = True)*\n\n iterate over all reads in *samfile*\n\n By default, the file is re-openend to avoid conflicts between\n multiple iterators working on the same file. Set *reopen* = False\n to not re-open *samfile*.\n "), /*tp_doc*/
32793 0, /*tp_richcompare*/
32794 0, /*tp_weaklistoffset*/
32795 __pyx_pf_9csamtools_14IteratorRowAll___iter__, /*tp_iter*/
32796 __pyx_pf_9csamtools_14IteratorRowAll___next__, /*tp_iternext*/
32797 __pyx_methods_9csamtools_IteratorRowAll, /*tp_methods*/
32802 0, /*tp_descr_get*/
32803 0, /*tp_descr_set*/
32804 0, /*tp_dictoffset*/
32807 __pyx_tp_new_9csamtools_IteratorRowAll, /*tp_new*/
32813 0, /*tp_subclasses*/
32816 #if PY_VERSION_HEX >= 0x02060000
32817 0, /*tp_version_tag*/
32821 static PyObject *__pyx_tp_new_9csamtools_IteratorRowAllRefs(PyTypeObject *t, PyObject *a, PyObject *k) {
32822 struct __pyx_obj_9csamtools_IteratorRowAllRefs *p;
32823 PyObject *o = __pyx_tp_new_9csamtools_IteratorRow(t, a, k);
32825 p = ((struct __pyx_obj_9csamtools_IteratorRowAllRefs *)o);
32826 p->samfile = ((struct __pyx_obj_9csamtools_Samfile *)Py_None); Py_INCREF(Py_None);
32827 p->rowiter = ((struct __pyx_obj_9csamtools_IteratorRowRegion *)Py_None); Py_INCREF(Py_None);
32828 if (__pyx_pf_9csamtools_18IteratorRowAllRefs___cinit__(o, a, k) < 0) {
32829 Py_DECREF(o); o = 0;
32834 static void __pyx_tp_dealloc_9csamtools_IteratorRowAllRefs(PyObject *o) {
32835 struct __pyx_obj_9csamtools_IteratorRowAllRefs *p = (struct __pyx_obj_9csamtools_IteratorRowAllRefs *)o;
32836 Py_XDECREF(((PyObject *)p->samfile));
32837 Py_XDECREF(((PyObject *)p->rowiter));
32838 __pyx_tp_dealloc_9csamtools_IteratorRow(o);
32841 static int __pyx_tp_traverse_9csamtools_IteratorRowAllRefs(PyObject *o, visitproc v, void *a) {
32843 struct __pyx_obj_9csamtools_IteratorRowAllRefs *p = (struct __pyx_obj_9csamtools_IteratorRowAllRefs *)o;
32844 if (__pyx_ptype_9csamtools_IteratorRow->tp_traverse) {
32845 e = __pyx_ptype_9csamtools_IteratorRow->tp_traverse(o, v, a); if (e) return e;
32848 e = (*v)(((PyObject*)p->samfile), a); if (e) return e;
32851 e = (*v)(((PyObject*)p->rowiter), a); if (e) return e;
32856 static int __pyx_tp_clear_9csamtools_IteratorRowAllRefs(PyObject *o) {
32857 struct __pyx_obj_9csamtools_IteratorRowAllRefs *p = (struct __pyx_obj_9csamtools_IteratorRowAllRefs *)o;
32859 if (__pyx_ptype_9csamtools_IteratorRow->tp_clear) {
32860 __pyx_ptype_9csamtools_IteratorRow->tp_clear(o);
32862 tmp = ((PyObject*)p->samfile);
32863 p->samfile = ((struct __pyx_obj_9csamtools_Samfile *)Py_None); Py_INCREF(Py_None);
32865 tmp = ((PyObject*)p->rowiter);
32866 p->rowiter = ((struct __pyx_obj_9csamtools_IteratorRowRegion *)Py_None); Py_INCREF(Py_None);
32871 static PyMethodDef __pyx_methods_9csamtools_IteratorRowAllRefs[] = {
32872 {__Pyx_NAMESTR("nextiter"), (PyCFunction)__pyx_pf_9csamtools_18IteratorRowAllRefs_nextiter, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_9csamtools_18IteratorRowAllRefs_nextiter)},
32873 {__Pyx_NAMESTR("__next__"), (PyCFunction)__pyx_pf_9csamtools_18IteratorRowAllRefs___next__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(__pyx_doc_9csamtools_18IteratorRowAllRefs___next__)},
32877 static PyNumberMethods __pyx_tp_as_number_IteratorRowAllRefs = {
32881 #if PY_MAJOR_VERSION < 3
32884 0, /*nb_remainder*/
32897 #if PY_MAJOR_VERSION < 3
32901 #if PY_MAJOR_VERSION < 3
32907 #if PY_MAJOR_VERSION < 3
32910 #if PY_MAJOR_VERSION < 3
32913 0, /*nb_inplace_add*/
32914 0, /*nb_inplace_subtract*/
32915 0, /*nb_inplace_multiply*/
32916 #if PY_MAJOR_VERSION < 3
32917 0, /*nb_inplace_divide*/
32919 0, /*nb_inplace_remainder*/
32920 0, /*nb_inplace_power*/
32921 0, /*nb_inplace_lshift*/
32922 0, /*nb_inplace_rshift*/
32923 0, /*nb_inplace_and*/
32924 0, /*nb_inplace_xor*/
32925 0, /*nb_inplace_or*/
32926 0, /*nb_floor_divide*/
32927 0, /*nb_true_divide*/
32928 0, /*nb_inplace_floor_divide*/
32929 0, /*nb_inplace_true_divide*/
32930 #if PY_VERSION_HEX >= 0x02050000
32935 static PySequenceMethods __pyx_tp_as_sequence_IteratorRowAllRefs = {
32942 0, /*sq_ass_slice*/
32944 0, /*sq_inplace_concat*/
32945 0, /*sq_inplace_repeat*/
32948 static PyMappingMethods __pyx_tp_as_mapping_IteratorRowAllRefs = {
32950 0, /*mp_subscript*/
32951 0, /*mp_ass_subscript*/
32954 static PyBufferProcs __pyx_tp_as_buffer_IteratorRowAllRefs = {
32955 #if PY_MAJOR_VERSION < 3
32956 0, /*bf_getreadbuffer*/
32958 #if PY_MAJOR_VERSION < 3
32959 0, /*bf_getwritebuffer*/
32961 #if PY_MAJOR_VERSION < 3
32962 0, /*bf_getsegcount*/
32964 #if PY_MAJOR_VERSION < 3
32965 0, /*bf_getcharbuffer*/
32967 #if PY_VERSION_HEX >= 0x02060000
32968 0, /*bf_getbuffer*/
32970 #if PY_VERSION_HEX >= 0x02060000
32971 0, /*bf_releasebuffer*/
32975 PyTypeObject __pyx_type_9csamtools_IteratorRowAllRefs = {
32976 PyVarObject_HEAD_INIT(0, 0)
32977 __Pyx_NAMESTR("csamtools.IteratorRowAllRefs"), /*tp_name*/
32978 sizeof(struct __pyx_obj_9csamtools_IteratorRowAllRefs), /*tp_basicsize*/
32980 __pyx_tp_dealloc_9csamtools_IteratorRowAllRefs, /*tp_dealloc*/
32984 #if PY_MAJOR_VERSION < 3
32990 &__pyx_tp_as_number_IteratorRowAllRefs, /*tp_as_number*/
32991 &__pyx_tp_as_sequence_IteratorRowAllRefs, /*tp_as_sequence*/
32992 &__pyx_tp_as_mapping_IteratorRowAllRefs, /*tp_as_mapping*/
32998 &__pyx_tp_as_buffer_IteratorRowAllRefs, /*tp_as_buffer*/
32999 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
33000 __Pyx_DOCSTR("iterates over all mapped reads by chaining iterators over each reference\n "), /*tp_doc*/
33001 __pyx_tp_traverse_9csamtools_IteratorRowAllRefs, /*tp_traverse*/
33002 __pyx_tp_clear_9csamtools_IteratorRowAllRefs, /*tp_clear*/
33003 0, /*tp_richcompare*/
33004 0, /*tp_weaklistoffset*/
33005 __pyx_pf_9csamtools_18IteratorRowAllRefs___iter__, /*tp_iter*/
33006 __pyx_pf_9csamtools_18IteratorRowAllRefs___next__, /*tp_iternext*/
33007 __pyx_methods_9csamtools_IteratorRowAllRefs, /*tp_methods*/
33012 0, /*tp_descr_get*/
33013 0, /*tp_descr_set*/
33014 0, /*tp_dictoffset*/
33017 __pyx_tp_new_9csamtools_IteratorRowAllRefs, /*tp_new*/
33023 0, /*tp_subclasses*/
33026 #if PY_VERSION_HEX >= 0x02060000
33027 0, /*tp_version_tag*/
33030 static struct __pyx_vtabstruct_9csamtools_IteratorRowSelection __pyx_vtable_9csamtools_IteratorRowSelection;
33032 static PyObject *__pyx_tp_new_9csamtools_IteratorRowSelection(PyTypeObject *t, PyObject *a, PyObject *k) {
33033 struct __pyx_obj_9csamtools_IteratorRowSelection *p;
33034 PyObject *o = __pyx_tp_new_9csamtools_IteratorRow(t, a, k);
33036 p = ((struct __pyx_obj_9csamtools_IteratorRowSelection *)o);
33037 p->__pyx_vtab = __pyx_vtabptr_9csamtools_IteratorRowSelection;
33038 p->positions = Py_None; Py_INCREF(Py_None);
33039 if (__pyx_pf_9csamtools_20IteratorRowSelection___cinit__(o, a, k) < 0) {
33040 Py_DECREF(o); o = 0;
33045 static void __pyx_tp_dealloc_9csamtools_IteratorRowSelection(PyObject *o) {
33046 struct __pyx_obj_9csamtools_IteratorRowSelection *p = (struct __pyx_obj_9csamtools_IteratorRowSelection *)o;
33048 PyObject *etype, *eval, *etb;
33049 PyErr_Fetch(&etype, &eval, &etb);
33051 __pyx_pf_9csamtools_20IteratorRowSelection___dealloc__(o);
33052 if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
33054 PyErr_Restore(etype, eval, etb);
33056 Py_XDECREF(p->positions);
33057 __pyx_tp_dealloc_9csamtools_IteratorRow(o);
33060 static int __pyx_tp_traverse_9csamtools_IteratorRowSelection(PyObject *o, visitproc v, void *a) {
33062 struct __pyx_obj_9csamtools_IteratorRowSelection *p = (struct __pyx_obj_9csamtools_IteratorRowSelection *)o;
33063 if (__pyx_ptype_9csamtools_IteratorRow->tp_traverse) {
33064 e = __pyx_ptype_9csamtools_IteratorRow->tp_traverse(o, v, a); if (e) return e;
33066 if (p->positions) {
33067 e = (*v)(p->positions, a); if (e) return e;
33072 static int __pyx_tp_clear_9csamtools_IteratorRowSelection(PyObject *o) {
33073 struct __pyx_obj_9csamtools_IteratorRowSelection *p = (struct __pyx_obj_9csamtools_IteratorRowSelection *)o;
33075 if (__pyx_ptype_9csamtools_IteratorRow->tp_clear) {
33076 __pyx_ptype_9csamtools_IteratorRow->tp_clear(o);
33078 tmp = ((PyObject*)p->positions);
33079 p->positions = Py_None; Py_INCREF(Py_None);
33084 static PyMethodDef __pyx_methods_9csamtools_IteratorRowSelection[] = {
33085 {__Pyx_NAMESTR("__next__"), (PyCFunction)__pyx_pf_9csamtools_20IteratorRowSelection___next__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(__pyx_doc_9csamtools_20IteratorRowSelection___next__)},
33089 static PyNumberMethods __pyx_tp_as_number_IteratorRowSelection = {
33093 #if PY_MAJOR_VERSION < 3
33096 0, /*nb_remainder*/
33109 #if PY_MAJOR_VERSION < 3
33113 #if PY_MAJOR_VERSION < 3
33119 #if PY_MAJOR_VERSION < 3
33122 #if PY_MAJOR_VERSION < 3
33125 0, /*nb_inplace_add*/
33126 0, /*nb_inplace_subtract*/
33127 0, /*nb_inplace_multiply*/
33128 #if PY_MAJOR_VERSION < 3
33129 0, /*nb_inplace_divide*/
33131 0, /*nb_inplace_remainder*/
33132 0, /*nb_inplace_power*/
33133 0, /*nb_inplace_lshift*/
33134 0, /*nb_inplace_rshift*/
33135 0, /*nb_inplace_and*/
33136 0, /*nb_inplace_xor*/
33137 0, /*nb_inplace_or*/
33138 0, /*nb_floor_divide*/
33139 0, /*nb_true_divide*/
33140 0, /*nb_inplace_floor_divide*/
33141 0, /*nb_inplace_true_divide*/
33142 #if PY_VERSION_HEX >= 0x02050000
33147 static PySequenceMethods __pyx_tp_as_sequence_IteratorRowSelection = {
33154 0, /*sq_ass_slice*/
33156 0, /*sq_inplace_concat*/
33157 0, /*sq_inplace_repeat*/
33160 static PyMappingMethods __pyx_tp_as_mapping_IteratorRowSelection = {
33162 0, /*mp_subscript*/
33163 0, /*mp_ass_subscript*/
33166 static PyBufferProcs __pyx_tp_as_buffer_IteratorRowSelection = {
33167 #if PY_MAJOR_VERSION < 3
33168 0, /*bf_getreadbuffer*/
33170 #if PY_MAJOR_VERSION < 3
33171 0, /*bf_getwritebuffer*/
33173 #if PY_MAJOR_VERSION < 3
33174 0, /*bf_getsegcount*/
33176 #if PY_MAJOR_VERSION < 3
33177 0, /*bf_getcharbuffer*/
33179 #if PY_VERSION_HEX >= 0x02060000
33180 0, /*bf_getbuffer*/
33182 #if PY_VERSION_HEX >= 0x02060000
33183 0, /*bf_releasebuffer*/
33187 PyTypeObject __pyx_type_9csamtools_IteratorRowSelection = {
33188 PyVarObject_HEAD_INIT(0, 0)
33189 __Pyx_NAMESTR("csamtools.IteratorRowSelection"), /*tp_name*/
33190 sizeof(struct __pyx_obj_9csamtools_IteratorRowSelection), /*tp_basicsize*/
33192 __pyx_tp_dealloc_9csamtools_IteratorRowSelection, /*tp_dealloc*/
33196 #if PY_MAJOR_VERSION < 3
33202 &__pyx_tp_as_number_IteratorRowSelection, /*tp_as_number*/
33203 &__pyx_tp_as_sequence_IteratorRowSelection, /*tp_as_sequence*/
33204 &__pyx_tp_as_mapping_IteratorRowSelection, /*tp_as_mapping*/
33210 &__pyx_tp_as_buffer_IteratorRowSelection, /*tp_as_buffer*/
33211 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
33212 __Pyx_DOCSTR("*(Samfile samfile)*\n\n iterate over reads in *samfile* at a given list of file positions.\n "), /*tp_doc*/
33213 __pyx_tp_traverse_9csamtools_IteratorRowSelection, /*tp_traverse*/
33214 __pyx_tp_clear_9csamtools_IteratorRowSelection, /*tp_clear*/
33215 0, /*tp_richcompare*/
33216 0, /*tp_weaklistoffset*/
33217 __pyx_pf_9csamtools_20IteratorRowSelection___iter__, /*tp_iter*/
33218 __pyx_pf_9csamtools_20IteratorRowSelection___next__, /*tp_iternext*/
33219 __pyx_methods_9csamtools_IteratorRowSelection, /*tp_methods*/
33224 0, /*tp_descr_get*/
33225 0, /*tp_descr_set*/
33226 0, /*tp_dictoffset*/
33229 __pyx_tp_new_9csamtools_IteratorRowSelection, /*tp_new*/
33235 0, /*tp_subclasses*/
33238 #if PY_VERSION_HEX >= 0x02060000
33239 0, /*tp_version_tag*/
33242 static struct __pyx_vtabstruct_9csamtools_IteratorColumn __pyx_vtable_9csamtools_IteratorColumn;
33244 static PyObject *__pyx_tp_new_9csamtools_IteratorColumn(PyTypeObject *t, PyObject *a, PyObject *k) {
33245 struct __pyx_obj_9csamtools_IteratorColumn *p;
33246 PyObject *o = (*t->tp_alloc)(t, 0);
33248 p = ((struct __pyx_obj_9csamtools_IteratorColumn *)o);
33249 p->__pyx_vtab = __pyx_vtabptr_9csamtools_IteratorColumn;
33250 p->iter = ((struct __pyx_obj_9csamtools_IteratorRowRegion *)Py_None); Py_INCREF(Py_None);
33251 p->samfile = ((struct __pyx_obj_9csamtools_Samfile *)Py_None); Py_INCREF(Py_None);
33252 p->fastafile = ((struct __pyx_obj_9csamtools_Fastafile *)Py_None); Py_INCREF(Py_None);
33253 p->stepper = Py_None; Py_INCREF(Py_None);
33254 if (__pyx_pf_9csamtools_14IteratorColumn___cinit__(o, a, k) < 0) {
33255 Py_DECREF(o); o = 0;
33260 static void __pyx_tp_dealloc_9csamtools_IteratorColumn(PyObject *o) {
33261 struct __pyx_obj_9csamtools_IteratorColumn *p = (struct __pyx_obj_9csamtools_IteratorColumn *)o;
33263 PyObject *etype, *eval, *etb;
33264 PyErr_Fetch(&etype, &eval, &etb);
33266 __pyx_pf_9csamtools_14IteratorColumn___dealloc__(o);
33267 if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
33269 PyErr_Restore(etype, eval, etb);
33271 Py_XDECREF(((PyObject *)p->iter));
33272 Py_XDECREF(((PyObject *)p->samfile));
33273 Py_XDECREF(((PyObject *)p->fastafile));
33274 Py_XDECREF(p->stepper);
33275 (*Py_TYPE(o)->tp_free)(o);
33278 static int __pyx_tp_traverse_9csamtools_IteratorColumn(PyObject *o, visitproc v, void *a) {
33280 struct __pyx_obj_9csamtools_IteratorColumn *p = (struct __pyx_obj_9csamtools_IteratorColumn *)o;
33282 e = (*v)(((PyObject*)p->iter), a); if (e) return e;
33285 e = (*v)(((PyObject*)p->samfile), a); if (e) return e;
33287 if (p->fastafile) {
33288 e = (*v)(((PyObject*)p->fastafile), a); if (e) return e;
33291 e = (*v)(p->stepper, a); if (e) return e;
33296 static int __pyx_tp_clear_9csamtools_IteratorColumn(PyObject *o) {
33297 struct __pyx_obj_9csamtools_IteratorColumn *p = (struct __pyx_obj_9csamtools_IteratorColumn *)o;
33299 tmp = ((PyObject*)p->iter);
33300 p->iter = ((struct __pyx_obj_9csamtools_IteratorRowRegion *)Py_None); Py_INCREF(Py_None);
33302 tmp = ((PyObject*)p->samfile);
33303 p->samfile = ((struct __pyx_obj_9csamtools_Samfile *)Py_None); Py_INCREF(Py_None);
33305 tmp = ((PyObject*)p->fastafile);
33306 p->fastafile = ((struct __pyx_obj_9csamtools_Fastafile *)Py_None); Py_INCREF(Py_None);
33308 tmp = ((PyObject*)p->stepper);
33309 p->stepper = Py_None; Py_INCREF(Py_None);
33314 static PyObject *__pyx_getprop_9csamtools_14IteratorColumn_seq_len(PyObject *o, void *x) {
33315 return __pyx_pf_9csamtools_14IteratorColumn_7seq_len___get__(o);
33318 static PyMethodDef __pyx_methods_9csamtools_IteratorColumn[] = {
33319 {__Pyx_NAMESTR("addReference"), (PyCFunction)__pyx_pf_9csamtools_14IteratorColumn_addReference, METH_O, __Pyx_DOCSTR(__pyx_doc_9csamtools_14IteratorColumn_addReference)},
33320 {__Pyx_NAMESTR("hasReference"), (PyCFunction)__pyx_pf_9csamtools_14IteratorColumn_hasReference, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_9csamtools_14IteratorColumn_hasReference)},
33324 static struct PyGetSetDef __pyx_getsets_9csamtools_IteratorColumn[] = {
33325 {(char *)"seq_len", __pyx_getprop_9csamtools_14IteratorColumn_seq_len, 0, __Pyx_DOCSTR(__pyx_k_161), 0},
33329 static PyNumberMethods __pyx_tp_as_number_IteratorColumn = {
33333 #if PY_MAJOR_VERSION < 3
33336 0, /*nb_remainder*/
33349 #if PY_MAJOR_VERSION < 3
33353 #if PY_MAJOR_VERSION < 3
33359 #if PY_MAJOR_VERSION < 3
33362 #if PY_MAJOR_VERSION < 3
33365 0, /*nb_inplace_add*/
33366 0, /*nb_inplace_subtract*/
33367 0, /*nb_inplace_multiply*/
33368 #if PY_MAJOR_VERSION < 3
33369 0, /*nb_inplace_divide*/
33371 0, /*nb_inplace_remainder*/
33372 0, /*nb_inplace_power*/
33373 0, /*nb_inplace_lshift*/
33374 0, /*nb_inplace_rshift*/
33375 0, /*nb_inplace_and*/
33376 0, /*nb_inplace_xor*/
33377 0, /*nb_inplace_or*/
33378 0, /*nb_floor_divide*/
33379 0, /*nb_true_divide*/
33380 0, /*nb_inplace_floor_divide*/
33381 0, /*nb_inplace_true_divide*/
33382 #if PY_VERSION_HEX >= 0x02050000
33387 static PySequenceMethods __pyx_tp_as_sequence_IteratorColumn = {
33394 0, /*sq_ass_slice*/
33396 0, /*sq_inplace_concat*/
33397 0, /*sq_inplace_repeat*/
33400 static PyMappingMethods __pyx_tp_as_mapping_IteratorColumn = {
33402 0, /*mp_subscript*/
33403 0, /*mp_ass_subscript*/
33406 static PyBufferProcs __pyx_tp_as_buffer_IteratorColumn = {
33407 #if PY_MAJOR_VERSION < 3
33408 0, /*bf_getreadbuffer*/
33410 #if PY_MAJOR_VERSION < 3
33411 0, /*bf_getwritebuffer*/
33413 #if PY_MAJOR_VERSION < 3
33414 0, /*bf_getsegcount*/
33416 #if PY_MAJOR_VERSION < 3
33417 0, /*bf_getcharbuffer*/
33419 #if PY_VERSION_HEX >= 0x02060000
33420 0, /*bf_getbuffer*/
33422 #if PY_VERSION_HEX >= 0x02060000
33423 0, /*bf_releasebuffer*/
33427 PyTypeObject __pyx_type_9csamtools_IteratorColumn = {
33428 PyVarObject_HEAD_INIT(0, 0)
33429 __Pyx_NAMESTR("csamtools.IteratorColumn"), /*tp_name*/
33430 sizeof(struct __pyx_obj_9csamtools_IteratorColumn), /*tp_basicsize*/
33432 __pyx_tp_dealloc_9csamtools_IteratorColumn, /*tp_dealloc*/
33436 #if PY_MAJOR_VERSION < 3
33442 &__pyx_tp_as_number_IteratorColumn, /*tp_as_number*/
33443 &__pyx_tp_as_sequence_IteratorColumn, /*tp_as_sequence*/
33444 &__pyx_tp_as_mapping_IteratorColumn, /*tp_as_mapping*/
33450 &__pyx_tp_as_buffer_IteratorColumn, /*tp_as_buffer*/
33451 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
33452 __Pyx_DOCSTR("abstract base class for iterators over columns.\n\n IteratorColumn objects wrap the pileup functionality of samtools.\n \n For reasons of efficiency, the iterator points to the current \n pileup buffer. The pileup buffer is updated at every iteration.\n This might cause some unexpected behavious. For example,\n consider the conversion to a list::\n \n f = Samfile(\"file.bam\", \"rb\")\n result = list( f.pileup() )\n\n Here, ``result`` will contain ``n`` objects of type :class:`PileupProxy` for ``n`` columns, \n but each object in ``result`` will contain the same information.\n \n The desired behaviour can be achieved by list comprehension::\n\n result = [ x.pileups() for x in f.pileup() ]\n\n ``result`` will be a list of ``n`` lists of objects of type :class:`PileupRead`.\n\n If the iterator is associated with a :class:`Fastafile` using the :meth:`addReference`\n method, then the iterator will export the current sequence via the methods :meth:`getSequence`\n and :meth:`seq_len`.\n\n Optional kwargs to the iterator\n\n stepper\n The stepper controlls how the iterator advances. \n Possible options for the stepper are \n \n all\n use all reads for pileup.\n samtools\n same filter and read processing as in :term:`csamtools` pileup\n fastafile\n A :class:`FastaFile` object\n mask\n Skip all reads with bits set in mask.\n \n \n "), /*tp_doc*/
33453 __pyx_tp_traverse_9csamtools_IteratorColumn, /*tp_traverse*/
33454 __pyx_tp_clear_9csamtools_IteratorColumn, /*tp_clear*/
33455 0, /*tp_richcompare*/
33456 0, /*tp_weaklistoffset*/
33457 __pyx_pf_9csamtools_14IteratorColumn___iter__, /*tp_iter*/
33459 __pyx_methods_9csamtools_IteratorColumn, /*tp_methods*/
33461 __pyx_getsets_9csamtools_IteratorColumn, /*tp_getset*/
33464 0, /*tp_descr_get*/
33465 0, /*tp_descr_set*/
33466 0, /*tp_dictoffset*/
33469 __pyx_tp_new_9csamtools_IteratorColumn, /*tp_new*/
33475 0, /*tp_subclasses*/
33478 #if PY_VERSION_HEX >= 0x02060000
33479 0, /*tp_version_tag*/
33482 static struct __pyx_vtabstruct_9csamtools_IteratorColumnRegion __pyx_vtable_9csamtools_IteratorColumnRegion;
33484 static PyObject *__pyx_tp_new_9csamtools_IteratorColumnRegion(PyTypeObject *t, PyObject *a, PyObject *k) {
33485 struct __pyx_obj_9csamtools_IteratorColumnRegion *p;
33486 PyObject *o = __pyx_tp_new_9csamtools_IteratorColumn(t, a, k);
33488 p = ((struct __pyx_obj_9csamtools_IteratorColumnRegion *)o);
33489 p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_9csamtools_IteratorColumn*)__pyx_vtabptr_9csamtools_IteratorColumnRegion;
33490 if (__pyx_pf_9csamtools_20IteratorColumnRegion___cinit__(o, a, k) < 0) {
33491 Py_DECREF(o); o = 0;
33496 static PyMethodDef __pyx_methods_9csamtools_IteratorColumnRegion[] = {
33497 {__Pyx_NAMESTR("__next__"), (PyCFunction)__pyx_pf_9csamtools_20IteratorColumnRegion___next__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(__pyx_doc_9csamtools_20IteratorColumnRegion___next__)},
33501 static PyNumberMethods __pyx_tp_as_number_IteratorColumnRegion = {
33505 #if PY_MAJOR_VERSION < 3
33508 0, /*nb_remainder*/
33521 #if PY_MAJOR_VERSION < 3
33525 #if PY_MAJOR_VERSION < 3
33531 #if PY_MAJOR_VERSION < 3
33534 #if PY_MAJOR_VERSION < 3
33537 0, /*nb_inplace_add*/
33538 0, /*nb_inplace_subtract*/
33539 0, /*nb_inplace_multiply*/
33540 #if PY_MAJOR_VERSION < 3
33541 0, /*nb_inplace_divide*/
33543 0, /*nb_inplace_remainder*/
33544 0, /*nb_inplace_power*/
33545 0, /*nb_inplace_lshift*/
33546 0, /*nb_inplace_rshift*/
33547 0, /*nb_inplace_and*/
33548 0, /*nb_inplace_xor*/
33549 0, /*nb_inplace_or*/
33550 0, /*nb_floor_divide*/
33551 0, /*nb_true_divide*/
33552 0, /*nb_inplace_floor_divide*/
33553 0, /*nb_inplace_true_divide*/
33554 #if PY_VERSION_HEX >= 0x02050000
33559 static PySequenceMethods __pyx_tp_as_sequence_IteratorColumnRegion = {
33566 0, /*sq_ass_slice*/
33568 0, /*sq_inplace_concat*/
33569 0, /*sq_inplace_repeat*/
33572 static PyMappingMethods __pyx_tp_as_mapping_IteratorColumnRegion = {
33574 0, /*mp_subscript*/
33575 0, /*mp_ass_subscript*/
33578 static PyBufferProcs __pyx_tp_as_buffer_IteratorColumnRegion = {
33579 #if PY_MAJOR_VERSION < 3
33580 0, /*bf_getreadbuffer*/
33582 #if PY_MAJOR_VERSION < 3
33583 0, /*bf_getwritebuffer*/
33585 #if PY_MAJOR_VERSION < 3
33586 0, /*bf_getsegcount*/
33588 #if PY_MAJOR_VERSION < 3
33589 0, /*bf_getcharbuffer*/
33591 #if PY_VERSION_HEX >= 0x02060000
33592 0, /*bf_getbuffer*/
33594 #if PY_VERSION_HEX >= 0x02060000
33595 0, /*bf_releasebuffer*/
33599 PyTypeObject __pyx_type_9csamtools_IteratorColumnRegion = {
33600 PyVarObject_HEAD_INIT(0, 0)
33601 __Pyx_NAMESTR("csamtools.IteratorColumnRegion"), /*tp_name*/
33602 sizeof(struct __pyx_obj_9csamtools_IteratorColumnRegion), /*tp_basicsize*/
33604 __pyx_tp_dealloc_9csamtools_IteratorColumn, /*tp_dealloc*/
33608 #if PY_MAJOR_VERSION < 3
33614 &__pyx_tp_as_number_IteratorColumnRegion, /*tp_as_number*/
33615 &__pyx_tp_as_sequence_IteratorColumnRegion, /*tp_as_sequence*/
33616 &__pyx_tp_as_mapping_IteratorColumnRegion, /*tp_as_mapping*/
33622 &__pyx_tp_as_buffer_IteratorColumnRegion, /*tp_as_buffer*/
33623 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
33624 __Pyx_DOCSTR("iterates over a region only.\n "), /*tp_doc*/
33625 __pyx_tp_traverse_9csamtools_IteratorColumn, /*tp_traverse*/
33626 __pyx_tp_clear_9csamtools_IteratorColumn, /*tp_clear*/
33627 0, /*tp_richcompare*/
33628 0, /*tp_weaklistoffset*/
33630 __pyx_pf_9csamtools_20IteratorColumnRegion___next__, /*tp_iternext*/
33631 __pyx_methods_9csamtools_IteratorColumnRegion, /*tp_methods*/
33636 0, /*tp_descr_get*/
33637 0, /*tp_descr_set*/
33638 0, /*tp_dictoffset*/
33641 __pyx_tp_new_9csamtools_IteratorColumnRegion, /*tp_new*/
33647 0, /*tp_subclasses*/
33650 #if PY_VERSION_HEX >= 0x02060000
33651 0, /*tp_version_tag*/
33654 static struct __pyx_vtabstruct_9csamtools_IteratorColumnAllRefs __pyx_vtable_9csamtools_IteratorColumnAllRefs;
33656 static PyObject *__pyx_tp_new_9csamtools_IteratorColumnAllRefs(PyTypeObject *t, PyObject *a, PyObject *k) {
33657 struct __pyx_obj_9csamtools_IteratorColumnAllRefs *p;
33658 PyObject *o = __pyx_tp_new_9csamtools_IteratorColumn(t, a, k);
33660 p = ((struct __pyx_obj_9csamtools_IteratorColumnAllRefs *)o);
33661 p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_9csamtools_IteratorColumn*)__pyx_vtabptr_9csamtools_IteratorColumnAllRefs;
33662 if (__pyx_pf_9csamtools_21IteratorColumnAllRefs___cinit__(o, a, k) < 0) {
33663 Py_DECREF(o); o = 0;
33668 static PyMethodDef __pyx_methods_9csamtools_IteratorColumnAllRefs[] = {
33669 {__Pyx_NAMESTR("__next__"), (PyCFunction)__pyx_pf_9csamtools_21IteratorColumnAllRefs___next__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(__pyx_doc_9csamtools_21IteratorColumnAllRefs___next__)},
33673 static PyNumberMethods __pyx_tp_as_number_IteratorColumnAllRefs = {
33677 #if PY_MAJOR_VERSION < 3
33680 0, /*nb_remainder*/
33693 #if PY_MAJOR_VERSION < 3
33697 #if PY_MAJOR_VERSION < 3
33703 #if PY_MAJOR_VERSION < 3
33706 #if PY_MAJOR_VERSION < 3
33709 0, /*nb_inplace_add*/
33710 0, /*nb_inplace_subtract*/
33711 0, /*nb_inplace_multiply*/
33712 #if PY_MAJOR_VERSION < 3
33713 0, /*nb_inplace_divide*/
33715 0, /*nb_inplace_remainder*/
33716 0, /*nb_inplace_power*/
33717 0, /*nb_inplace_lshift*/
33718 0, /*nb_inplace_rshift*/
33719 0, /*nb_inplace_and*/
33720 0, /*nb_inplace_xor*/
33721 0, /*nb_inplace_or*/
33722 0, /*nb_floor_divide*/
33723 0, /*nb_true_divide*/
33724 0, /*nb_inplace_floor_divide*/
33725 0, /*nb_inplace_true_divide*/
33726 #if PY_VERSION_HEX >= 0x02050000
33731 static PySequenceMethods __pyx_tp_as_sequence_IteratorColumnAllRefs = {
33738 0, /*sq_ass_slice*/
33740 0, /*sq_inplace_concat*/
33741 0, /*sq_inplace_repeat*/
33744 static PyMappingMethods __pyx_tp_as_mapping_IteratorColumnAllRefs = {
33746 0, /*mp_subscript*/
33747 0, /*mp_ass_subscript*/
33750 static PyBufferProcs __pyx_tp_as_buffer_IteratorColumnAllRefs = {
33751 #if PY_MAJOR_VERSION < 3
33752 0, /*bf_getreadbuffer*/
33754 #if PY_MAJOR_VERSION < 3
33755 0, /*bf_getwritebuffer*/
33757 #if PY_MAJOR_VERSION < 3
33758 0, /*bf_getsegcount*/
33760 #if PY_MAJOR_VERSION < 3
33761 0, /*bf_getcharbuffer*/
33763 #if PY_VERSION_HEX >= 0x02060000
33764 0, /*bf_getbuffer*/
33766 #if PY_VERSION_HEX >= 0x02060000
33767 0, /*bf_releasebuffer*/
33771 PyTypeObject __pyx_type_9csamtools_IteratorColumnAllRefs = {
33772 PyVarObject_HEAD_INIT(0, 0)
33773 __Pyx_NAMESTR("csamtools.IteratorColumnAllRefs"), /*tp_name*/
33774 sizeof(struct __pyx_obj_9csamtools_IteratorColumnAllRefs), /*tp_basicsize*/
33776 __pyx_tp_dealloc_9csamtools_IteratorColumn, /*tp_dealloc*/
33780 #if PY_MAJOR_VERSION < 3
33786 &__pyx_tp_as_number_IteratorColumnAllRefs, /*tp_as_number*/
33787 &__pyx_tp_as_sequence_IteratorColumnAllRefs, /*tp_as_sequence*/
33788 &__pyx_tp_as_mapping_IteratorColumnAllRefs, /*tp_as_mapping*/
33794 &__pyx_tp_as_buffer_IteratorColumnAllRefs, /*tp_as_buffer*/
33795 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
33796 __Pyx_DOCSTR("iterates over all columns by chaining iterators over each reference\n "), /*tp_doc*/
33797 __pyx_tp_traverse_9csamtools_IteratorColumn, /*tp_traverse*/
33798 __pyx_tp_clear_9csamtools_IteratorColumn, /*tp_clear*/
33799 0, /*tp_richcompare*/
33800 0, /*tp_weaklistoffset*/
33802 __pyx_pf_9csamtools_21IteratorColumnAllRefs___next__, /*tp_iternext*/
33803 __pyx_methods_9csamtools_IteratorColumnAllRefs, /*tp_methods*/
33808 0, /*tp_descr_get*/
33809 0, /*tp_descr_set*/
33810 0, /*tp_dictoffset*/
33813 __pyx_tp_new_9csamtools_IteratorColumnAllRefs, /*tp_new*/
33819 0, /*tp_subclasses*/
33822 #if PY_VERSION_HEX >= 0x02060000
33823 0, /*tp_version_tag*/
33827 static PyObject *__pyx_tp_new_9csamtools_SNPCall(PyTypeObject *t, PyObject *a, PyObject *k) {
33828 PyObject *o = (*t->tp_alloc)(t, 0);
33833 static void __pyx_tp_dealloc_9csamtools_SNPCall(PyObject *o) {
33834 (*Py_TYPE(o)->tp_free)(o);
33837 static PyObject *__pyx_getprop_9csamtools_7SNPCall_tid(PyObject *o, void *x) {
33838 return __pyx_pf_9csamtools_7SNPCall_3tid___get__(o);
33841 static PyObject *__pyx_getprop_9csamtools_7SNPCall_pos(PyObject *o, void *x) {
33842 return __pyx_pf_9csamtools_7SNPCall_3pos___get__(o);
33845 static PyObject *__pyx_getprop_9csamtools_7SNPCall_reference_base(PyObject *o, void *x) {
33846 return __pyx_pf_9csamtools_7SNPCall_14reference_base___get__(o);
33849 static PyObject *__pyx_getprop_9csamtools_7SNPCall_genotype(PyObject *o, void *x) {
33850 return __pyx_pf_9csamtools_7SNPCall_8genotype___get__(o);
33853 static PyObject *__pyx_getprop_9csamtools_7SNPCall_consensus_quality(PyObject *o, void *x) {
33854 return __pyx_pf_9csamtools_7SNPCall_17consensus_quality___get__(o);
33857 static PyObject *__pyx_getprop_9csamtools_7SNPCall_snp_quality(PyObject *o, void *x) {
33858 return __pyx_pf_9csamtools_7SNPCall_11snp_quality___get__(o);
33861 static PyObject *__pyx_getprop_9csamtools_7SNPCall_mapping_quality(PyObject *o, void *x) {
33862 return __pyx_pf_9csamtools_7SNPCall_15mapping_quality___get__(o);
33865 static PyObject *__pyx_getprop_9csamtools_7SNPCall_coverage(PyObject *o, void *x) {
33866 return __pyx_pf_9csamtools_7SNPCall_8coverage___get__(o);
33869 static PyMethodDef __pyx_methods_9csamtools_SNPCall[] = {
33873 static struct PyGetSetDef __pyx_getsets_9csamtools_SNPCall[] = {
33874 {(char *)"tid", __pyx_getprop_9csamtools_7SNPCall_tid, 0, __Pyx_DOCSTR(__pyx_k_154), 0},
33875 {(char *)"pos", __pyx_getprop_9csamtools_7SNPCall_pos, 0, __Pyx_DOCSTR(__pyx_k_162), 0},
33876 {(char *)"reference_base", __pyx_getprop_9csamtools_7SNPCall_reference_base, 0, __Pyx_DOCSTR(__pyx_k_163), 0},
33877 {(char *)"genotype", __pyx_getprop_9csamtools_7SNPCall_genotype, 0, __Pyx_DOCSTR(__pyx_k_164), 0},
33878 {(char *)"consensus_quality", __pyx_getprop_9csamtools_7SNPCall_consensus_quality, 0, __Pyx_DOCSTR(__pyx_k_165), 0},
33879 {(char *)"snp_quality", __pyx_getprop_9csamtools_7SNPCall_snp_quality, 0, __Pyx_DOCSTR(__pyx_k_166), 0},
33880 {(char *)"mapping_quality", __pyx_getprop_9csamtools_7SNPCall_mapping_quality, 0, __Pyx_DOCSTR(__pyx_k_167), 0},
33881 {(char *)"coverage", __pyx_getprop_9csamtools_7SNPCall_coverage, 0, __Pyx_DOCSTR(__pyx_k_168), 0},
33885 static PyNumberMethods __pyx_tp_as_number_SNPCall = {
33889 #if PY_MAJOR_VERSION < 3
33892 0, /*nb_remainder*/
33905 #if PY_MAJOR_VERSION < 3
33909 #if PY_MAJOR_VERSION < 3
33915 #if PY_MAJOR_VERSION < 3
33918 #if PY_MAJOR_VERSION < 3
33921 0, /*nb_inplace_add*/
33922 0, /*nb_inplace_subtract*/
33923 0, /*nb_inplace_multiply*/
33924 #if PY_MAJOR_VERSION < 3
33925 0, /*nb_inplace_divide*/
33927 0, /*nb_inplace_remainder*/
33928 0, /*nb_inplace_power*/
33929 0, /*nb_inplace_lshift*/
33930 0, /*nb_inplace_rshift*/
33931 0, /*nb_inplace_and*/
33932 0, /*nb_inplace_xor*/
33933 0, /*nb_inplace_or*/
33934 0, /*nb_floor_divide*/
33935 0, /*nb_true_divide*/
33936 0, /*nb_inplace_floor_divide*/
33937 0, /*nb_inplace_true_divide*/
33938 #if PY_VERSION_HEX >= 0x02050000
33943 static PySequenceMethods __pyx_tp_as_sequence_SNPCall = {
33950 0, /*sq_ass_slice*/
33952 0, /*sq_inplace_concat*/
33953 0, /*sq_inplace_repeat*/
33956 static PyMappingMethods __pyx_tp_as_mapping_SNPCall = {
33958 0, /*mp_subscript*/
33959 0, /*mp_ass_subscript*/
33962 static PyBufferProcs __pyx_tp_as_buffer_SNPCall = {
33963 #if PY_MAJOR_VERSION < 3
33964 0, /*bf_getreadbuffer*/
33966 #if PY_MAJOR_VERSION < 3
33967 0, /*bf_getwritebuffer*/
33969 #if PY_MAJOR_VERSION < 3
33970 0, /*bf_getsegcount*/
33972 #if PY_MAJOR_VERSION < 3
33973 0, /*bf_getcharbuffer*/
33975 #if PY_VERSION_HEX >= 0x02060000
33976 0, /*bf_getbuffer*/
33978 #if PY_VERSION_HEX >= 0x02060000
33979 0, /*bf_releasebuffer*/
33983 PyTypeObject __pyx_type_9csamtools_SNPCall = {
33984 PyVarObject_HEAD_INIT(0, 0)
33985 __Pyx_NAMESTR("csamtools.SNPCall"), /*tp_name*/
33986 sizeof(struct __pyx_obj_9csamtools_SNPCall), /*tp_basicsize*/
33988 __pyx_tp_dealloc_9csamtools_SNPCall, /*tp_dealloc*/
33992 #if PY_MAJOR_VERSION < 3
33998 &__pyx_tp_as_number_SNPCall, /*tp_as_number*/
33999 &__pyx_tp_as_sequence_SNPCall, /*tp_as_sequence*/
34000 &__pyx_tp_as_mapping_SNPCall, /*tp_as_mapping*/
34003 __pyx_pf_9csamtools_7SNPCall___str__, /*tp_str*/
34006 &__pyx_tp_as_buffer_SNPCall, /*tp_as_buffer*/
34007 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER, /*tp_flags*/
34008 __Pyx_DOCSTR("the results of a SNP call."), /*tp_doc*/
34011 0, /*tp_richcompare*/
34012 0, /*tp_weaklistoffset*/
34015 __pyx_methods_9csamtools_SNPCall, /*tp_methods*/
34017 __pyx_getsets_9csamtools_SNPCall, /*tp_getset*/
34020 0, /*tp_descr_get*/
34021 0, /*tp_descr_set*/
34022 0, /*tp_dictoffset*/
34025 __pyx_tp_new_9csamtools_SNPCall, /*tp_new*/
34031 0, /*tp_subclasses*/
34034 #if PY_VERSION_HEX >= 0x02060000
34035 0, /*tp_version_tag*/
34038 static struct __pyx_vtabstruct_9csamtools_SNPCallerBase __pyx_vtable_9csamtools_SNPCallerBase;
34040 static PyObject *__pyx_tp_new_9csamtools_SNPCallerBase(PyTypeObject *t, PyObject *a, PyObject *k) {
34041 struct __pyx_obj_9csamtools_SNPCallerBase *p;
34042 PyObject *o = (*t->tp_alloc)(t, 0);
34044 p = ((struct __pyx_obj_9csamtools_SNPCallerBase *)o);
34045 p->__pyx_vtab = __pyx_vtabptr_9csamtools_SNPCallerBase;
34046 p->iter = ((struct __pyx_obj_9csamtools_IteratorColumn *)Py_None); Py_INCREF(Py_None);
34047 if (__pyx_pf_9csamtools_13SNPCallerBase___cinit__(o, a, k) < 0) {
34048 Py_DECREF(o); o = 0;
34053 static void __pyx_tp_dealloc_9csamtools_SNPCallerBase(PyObject *o) {
34054 struct __pyx_obj_9csamtools_SNPCallerBase *p = (struct __pyx_obj_9csamtools_SNPCallerBase *)o;
34056 PyObject *etype, *eval, *etb;
34057 PyErr_Fetch(&etype, &eval, &etb);
34059 __pyx_pf_9csamtools_13SNPCallerBase___dealloc__(o);
34060 if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
34062 PyErr_Restore(etype, eval, etb);
34064 Py_XDECREF(((PyObject *)p->iter));
34065 (*Py_TYPE(o)->tp_free)(o);
34068 static int __pyx_tp_traverse_9csamtools_SNPCallerBase(PyObject *o, visitproc v, void *a) {
34070 struct __pyx_obj_9csamtools_SNPCallerBase *p = (struct __pyx_obj_9csamtools_SNPCallerBase *)o;
34072 e = (*v)(((PyObject*)p->iter), a); if (e) return e;
34077 static int __pyx_tp_clear_9csamtools_SNPCallerBase(PyObject *o) {
34078 struct __pyx_obj_9csamtools_SNPCallerBase *p = (struct __pyx_obj_9csamtools_SNPCallerBase *)o;
34080 tmp = ((PyObject*)p->iter);
34081 p->iter = ((struct __pyx_obj_9csamtools_IteratorColumn *)Py_None); Py_INCREF(Py_None);
34086 static PyMethodDef __pyx_methods_9csamtools_SNPCallerBase[] = {
34090 static PyNumberMethods __pyx_tp_as_number_SNPCallerBase = {
34094 #if PY_MAJOR_VERSION < 3
34097 0, /*nb_remainder*/
34110 #if PY_MAJOR_VERSION < 3
34114 #if PY_MAJOR_VERSION < 3
34120 #if PY_MAJOR_VERSION < 3
34123 #if PY_MAJOR_VERSION < 3
34126 0, /*nb_inplace_add*/
34127 0, /*nb_inplace_subtract*/
34128 0, /*nb_inplace_multiply*/
34129 #if PY_MAJOR_VERSION < 3
34130 0, /*nb_inplace_divide*/
34132 0, /*nb_inplace_remainder*/
34133 0, /*nb_inplace_power*/
34134 0, /*nb_inplace_lshift*/
34135 0, /*nb_inplace_rshift*/
34136 0, /*nb_inplace_and*/
34137 0, /*nb_inplace_xor*/
34138 0, /*nb_inplace_or*/
34139 0, /*nb_floor_divide*/
34140 0, /*nb_true_divide*/
34141 0, /*nb_inplace_floor_divide*/
34142 0, /*nb_inplace_true_divide*/
34143 #if PY_VERSION_HEX >= 0x02050000
34148 static PySequenceMethods __pyx_tp_as_sequence_SNPCallerBase = {
34155 0, /*sq_ass_slice*/
34157 0, /*sq_inplace_concat*/
34158 0, /*sq_inplace_repeat*/
34161 static PyMappingMethods __pyx_tp_as_mapping_SNPCallerBase = {
34163 0, /*mp_subscript*/
34164 0, /*mp_ass_subscript*/
34167 static PyBufferProcs __pyx_tp_as_buffer_SNPCallerBase = {
34168 #if PY_MAJOR_VERSION < 3
34169 0, /*bf_getreadbuffer*/
34171 #if PY_MAJOR_VERSION < 3
34172 0, /*bf_getwritebuffer*/
34174 #if PY_MAJOR_VERSION < 3
34175 0, /*bf_getsegcount*/
34177 #if PY_MAJOR_VERSION < 3
34178 0, /*bf_getcharbuffer*/
34180 #if PY_VERSION_HEX >= 0x02060000
34181 0, /*bf_getbuffer*/
34183 #if PY_VERSION_HEX >= 0x02060000
34184 0, /*bf_releasebuffer*/
34188 PyTypeObject __pyx_type_9csamtools_SNPCallerBase = {
34189 PyVarObject_HEAD_INIT(0, 0)
34190 __Pyx_NAMESTR("csamtools.SNPCallerBase"), /*tp_name*/
34191 sizeof(struct __pyx_obj_9csamtools_SNPCallerBase), /*tp_basicsize*/
34193 __pyx_tp_dealloc_9csamtools_SNPCallerBase, /*tp_dealloc*/
34197 #if PY_MAJOR_VERSION < 3
34203 &__pyx_tp_as_number_SNPCallerBase, /*tp_as_number*/
34204 &__pyx_tp_as_sequence_SNPCallerBase, /*tp_as_sequence*/
34205 &__pyx_tp_as_mapping_SNPCallerBase, /*tp_as_mapping*/
34211 &__pyx_tp_as_buffer_SNPCallerBase, /*tp_as_buffer*/
34212 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
34213 __Pyx_DOCSTR("Base class for SNP callers.\n\n *min_baseQ*\n minimum base quality (possibly capped by BAQ)\n *capQ_threshold*\n coefficient for adjusting mapQ of poor mappings\n *theta*\n theta in maq consensus calling model\n *n_haplotypes*\n number of haplotypes in the sample\n *het_rate*\n prior of a difference between two haplotypes\n "), /*tp_doc*/
34214 __pyx_tp_traverse_9csamtools_SNPCallerBase, /*tp_traverse*/
34215 __pyx_tp_clear_9csamtools_SNPCallerBase, /*tp_clear*/
34216 0, /*tp_richcompare*/
34217 0, /*tp_weaklistoffset*/
34220 __pyx_methods_9csamtools_SNPCallerBase, /*tp_methods*/
34225 0, /*tp_descr_get*/
34226 0, /*tp_descr_set*/
34227 0, /*tp_dictoffset*/
34230 __pyx_tp_new_9csamtools_SNPCallerBase, /*tp_new*/
34236 0, /*tp_subclasses*/
34239 #if PY_VERSION_HEX >= 0x02060000
34240 0, /*tp_version_tag*/
34243 static struct __pyx_vtabstruct_9csamtools_IteratorSNPCalls __pyx_vtable_9csamtools_IteratorSNPCalls;
34245 static PyObject *__pyx_tp_new_9csamtools_IteratorSNPCalls(PyTypeObject *t, PyObject *a, PyObject *k) {
34246 struct __pyx_obj_9csamtools_IteratorSNPCalls *p;
34247 PyObject *o = __pyx_tp_new_9csamtools_SNPCallerBase(t, a, k);
34249 p = ((struct __pyx_obj_9csamtools_IteratorSNPCalls *)o);
34250 p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_9csamtools_SNPCallerBase*)__pyx_vtabptr_9csamtools_IteratorSNPCalls;
34251 if (__pyx_pf_9csamtools_16IteratorSNPCalls___cinit__(o, a, k) < 0) {
34252 Py_DECREF(o); o = 0;
34257 static PyMethodDef __pyx_methods_9csamtools_IteratorSNPCalls[] = {
34258 {__Pyx_NAMESTR("__next__"), (PyCFunction)__pyx_pf_9csamtools_16IteratorSNPCalls___next__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(__pyx_doc_9csamtools_16IteratorSNPCalls___next__)},
34262 static PyNumberMethods __pyx_tp_as_number_IteratorSNPCalls = {
34266 #if PY_MAJOR_VERSION < 3
34269 0, /*nb_remainder*/
34282 #if PY_MAJOR_VERSION < 3
34286 #if PY_MAJOR_VERSION < 3
34292 #if PY_MAJOR_VERSION < 3
34295 #if PY_MAJOR_VERSION < 3
34298 0, /*nb_inplace_add*/
34299 0, /*nb_inplace_subtract*/
34300 0, /*nb_inplace_multiply*/
34301 #if PY_MAJOR_VERSION < 3
34302 0, /*nb_inplace_divide*/
34304 0, /*nb_inplace_remainder*/
34305 0, /*nb_inplace_power*/
34306 0, /*nb_inplace_lshift*/
34307 0, /*nb_inplace_rshift*/
34308 0, /*nb_inplace_and*/
34309 0, /*nb_inplace_xor*/
34310 0, /*nb_inplace_or*/
34311 0, /*nb_floor_divide*/
34312 0, /*nb_true_divide*/
34313 0, /*nb_inplace_floor_divide*/
34314 0, /*nb_inplace_true_divide*/
34315 #if PY_VERSION_HEX >= 0x02050000
34320 static PySequenceMethods __pyx_tp_as_sequence_IteratorSNPCalls = {
34327 0, /*sq_ass_slice*/
34329 0, /*sq_inplace_concat*/
34330 0, /*sq_inplace_repeat*/
34333 static PyMappingMethods __pyx_tp_as_mapping_IteratorSNPCalls = {
34335 0, /*mp_subscript*/
34336 0, /*mp_ass_subscript*/
34339 static PyBufferProcs __pyx_tp_as_buffer_IteratorSNPCalls = {
34340 #if PY_MAJOR_VERSION < 3
34341 0, /*bf_getreadbuffer*/
34343 #if PY_MAJOR_VERSION < 3
34344 0, /*bf_getwritebuffer*/
34346 #if PY_MAJOR_VERSION < 3
34347 0, /*bf_getsegcount*/
34349 #if PY_MAJOR_VERSION < 3
34350 0, /*bf_getcharbuffer*/
34352 #if PY_VERSION_HEX >= 0x02060000
34353 0, /*bf_getbuffer*/
34355 #if PY_VERSION_HEX >= 0x02060000
34356 0, /*bf_releasebuffer*/
34360 PyTypeObject __pyx_type_9csamtools_IteratorSNPCalls = {
34361 PyVarObject_HEAD_INIT(0, 0)
34362 __Pyx_NAMESTR("csamtools.IteratorSNPCalls"), /*tp_name*/
34363 sizeof(struct __pyx_obj_9csamtools_IteratorSNPCalls), /*tp_basicsize*/
34365 __pyx_tp_dealloc_9csamtools_SNPCallerBase, /*tp_dealloc*/
34369 #if PY_MAJOR_VERSION < 3
34375 &__pyx_tp_as_number_IteratorSNPCalls, /*tp_as_number*/
34376 &__pyx_tp_as_sequence_IteratorSNPCalls, /*tp_as_sequence*/
34377 &__pyx_tp_as_mapping_IteratorSNPCalls, /*tp_as_mapping*/
34383 &__pyx_tp_as_buffer_IteratorSNPCalls, /*tp_as_buffer*/
34384 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
34385 __Pyx_DOCSTR("*(IteratorColumn iterator)*\n\n call SNPs within a region.\n\n *iterator* is a pileup iterator. SNPs will be called\n on all positions returned by this iterator.\n\n This caller is fast if SNPs are called over large continuous\n regions. It is slow, if instantiated frequently and in random\n order as the sequence will have to be reloaded.\n\n "), /*tp_doc*/
34386 __pyx_tp_traverse_9csamtools_SNPCallerBase, /*tp_traverse*/
34387 __pyx_tp_clear_9csamtools_SNPCallerBase, /*tp_clear*/
34388 0, /*tp_richcompare*/
34389 0, /*tp_weaklistoffset*/
34390 __pyx_pf_9csamtools_16IteratorSNPCalls___iter__, /*tp_iter*/
34391 __pyx_pf_9csamtools_16IteratorSNPCalls___next__, /*tp_iternext*/
34392 __pyx_methods_9csamtools_IteratorSNPCalls, /*tp_methods*/
34397 0, /*tp_descr_get*/
34398 0, /*tp_descr_set*/
34399 0, /*tp_dictoffset*/
34402 __pyx_tp_new_9csamtools_IteratorSNPCalls, /*tp_new*/
34408 0, /*tp_subclasses*/
34411 #if PY_VERSION_HEX >= 0x02060000
34412 0, /*tp_version_tag*/
34415 static struct __pyx_vtabstruct_9csamtools_SNPCaller __pyx_vtable_9csamtools_SNPCaller;
34417 static PyObject *__pyx_tp_new_9csamtools_SNPCaller(PyTypeObject *t, PyObject *a, PyObject *k) {
34418 struct __pyx_obj_9csamtools_SNPCaller *p;
34419 PyObject *o = __pyx_tp_new_9csamtools_SNPCallerBase(t, a, k);
34421 p = ((struct __pyx_obj_9csamtools_SNPCaller *)o);
34422 p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_9csamtools_SNPCallerBase*)__pyx_vtabptr_9csamtools_SNPCaller;
34423 if (__pyx_pf_9csamtools_9SNPCaller___cinit__(o, a, k) < 0) {
34424 Py_DECREF(o); o = 0;
34429 static PyMethodDef __pyx_methods_9csamtools_SNPCaller[] = {
34430 {__Pyx_NAMESTR("call"), (PyCFunction)__pyx_pf_9csamtools_9SNPCaller_call, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_9csamtools_9SNPCaller_call)},
34434 static PyNumberMethods __pyx_tp_as_number_SNPCaller = {
34438 #if PY_MAJOR_VERSION < 3
34441 0, /*nb_remainder*/
34454 #if PY_MAJOR_VERSION < 3
34458 #if PY_MAJOR_VERSION < 3
34464 #if PY_MAJOR_VERSION < 3
34467 #if PY_MAJOR_VERSION < 3
34470 0, /*nb_inplace_add*/
34471 0, /*nb_inplace_subtract*/
34472 0, /*nb_inplace_multiply*/
34473 #if PY_MAJOR_VERSION < 3
34474 0, /*nb_inplace_divide*/
34476 0, /*nb_inplace_remainder*/
34477 0, /*nb_inplace_power*/
34478 0, /*nb_inplace_lshift*/
34479 0, /*nb_inplace_rshift*/
34480 0, /*nb_inplace_and*/
34481 0, /*nb_inplace_xor*/
34482 0, /*nb_inplace_or*/
34483 0, /*nb_floor_divide*/
34484 0, /*nb_true_divide*/
34485 0, /*nb_inplace_floor_divide*/
34486 0, /*nb_inplace_true_divide*/
34487 #if PY_VERSION_HEX >= 0x02050000
34492 static PySequenceMethods __pyx_tp_as_sequence_SNPCaller = {
34499 0, /*sq_ass_slice*/
34501 0, /*sq_inplace_concat*/
34502 0, /*sq_inplace_repeat*/
34505 static PyMappingMethods __pyx_tp_as_mapping_SNPCaller = {
34507 0, /*mp_subscript*/
34508 0, /*mp_ass_subscript*/
34511 static PyBufferProcs __pyx_tp_as_buffer_SNPCaller = {
34512 #if PY_MAJOR_VERSION < 3
34513 0, /*bf_getreadbuffer*/
34515 #if PY_MAJOR_VERSION < 3
34516 0, /*bf_getwritebuffer*/
34518 #if PY_MAJOR_VERSION < 3
34519 0, /*bf_getsegcount*/
34521 #if PY_MAJOR_VERSION < 3
34522 0, /*bf_getcharbuffer*/
34524 #if PY_VERSION_HEX >= 0x02060000
34525 0, /*bf_getbuffer*/
34527 #if PY_VERSION_HEX >= 0x02060000
34528 0, /*bf_releasebuffer*/
34532 PyTypeObject __pyx_type_9csamtools_SNPCaller = {
34533 PyVarObject_HEAD_INIT(0, 0)
34534 __Pyx_NAMESTR("csamtools.SNPCaller"), /*tp_name*/
34535 sizeof(struct __pyx_obj_9csamtools_SNPCaller), /*tp_basicsize*/
34537 __pyx_tp_dealloc_9csamtools_SNPCallerBase, /*tp_dealloc*/
34541 #if PY_MAJOR_VERSION < 3
34547 &__pyx_tp_as_number_SNPCaller, /*tp_as_number*/
34548 &__pyx_tp_as_sequence_SNPCaller, /*tp_as_sequence*/
34549 &__pyx_tp_as_mapping_SNPCaller, /*tp_as_mapping*/
34555 &__pyx_tp_as_buffer_SNPCaller, /*tp_as_buffer*/
34556 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
34557 __Pyx_DOCSTR("*(IteratorColumn iterator_column )*\n\n The samtools SNP caller.\n\n This object will call SNPs in *samfile* against the reference\n sequence in *fasta*.\n\n This caller is fast for calling few SNPs in selected regions.\n\n It is slow, if called over large genomic regions.\n "), /*tp_doc*/
34558 __pyx_tp_traverse_9csamtools_SNPCallerBase, /*tp_traverse*/
34559 __pyx_tp_clear_9csamtools_SNPCallerBase, /*tp_clear*/
34560 0, /*tp_richcompare*/
34561 0, /*tp_weaklistoffset*/
34564 __pyx_methods_9csamtools_SNPCaller, /*tp_methods*/
34569 0, /*tp_descr_get*/
34570 0, /*tp_descr_set*/
34571 0, /*tp_dictoffset*/
34574 __pyx_tp_new_9csamtools_SNPCaller, /*tp_new*/
34580 0, /*tp_subclasses*/
34583 #if PY_VERSION_HEX >= 0x02060000
34584 0, /*tp_version_tag*/
34588 static PyObject *__pyx_tp_new_9csamtools_IndelCall(PyTypeObject *t, PyObject *a, PyObject *k) {
34589 PyObject *o = (*t->tp_alloc)(t, 0);
34591 if (__pyx_pf_9csamtools_9IndelCall___cinit__(o, __pyx_empty_tuple, NULL) < 0) {
34592 Py_DECREF(o); o = 0;
34597 static void __pyx_tp_dealloc_9csamtools_IndelCall(PyObject *o) {
34599 PyObject *etype, *eval, *etb;
34600 PyErr_Fetch(&etype, &eval, &etb);
34602 __pyx_pf_9csamtools_9IndelCall___dealloc__(o);
34603 if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
34605 PyErr_Restore(etype, eval, etb);
34607 (*Py_TYPE(o)->tp_free)(o);
34610 static PyObject *__pyx_getprop_9csamtools_9IndelCall_tid(PyObject *o, void *x) {
34611 return __pyx_pf_9csamtools_9IndelCall_3tid___get__(o);
34614 static PyObject *__pyx_getprop_9csamtools_9IndelCall_pos(PyObject *o, void *x) {
34615 return __pyx_pf_9csamtools_9IndelCall_3pos___get__(o);
34618 static PyObject *__pyx_getprop_9csamtools_9IndelCall_genotype(PyObject *o, void *x) {
34619 return __pyx_pf_9csamtools_9IndelCall_8genotype___get__(o);
34622 static PyObject *__pyx_getprop_9csamtools_9IndelCall_consensus_quality(PyObject *o, void *x) {
34623 return __pyx_pf_9csamtools_9IndelCall_17consensus_quality___get__(o);
34626 static PyObject *__pyx_getprop_9csamtools_9IndelCall_snp_quality(PyObject *o, void *x) {
34627 return __pyx_pf_9csamtools_9IndelCall_11snp_quality___get__(o);
34630 static PyObject *__pyx_getprop_9csamtools_9IndelCall_mapping_quality(PyObject *o, void *x) {
34631 return __pyx_pf_9csamtools_9IndelCall_15mapping_quality___get__(o);
34634 static PyObject *__pyx_getprop_9csamtools_9IndelCall_coverage(PyObject *o, void *x) {
34635 return __pyx_pf_9csamtools_9IndelCall_8coverage___get__(o);
34638 static PyObject *__pyx_getprop_9csamtools_9IndelCall_first_allele(PyObject *o, void *x) {
34639 return __pyx_pf_9csamtools_9IndelCall_12first_allele___get__(o);
34642 static PyObject *__pyx_getprop_9csamtools_9IndelCall_second_allele(PyObject *o, void *x) {
34643 return __pyx_pf_9csamtools_9IndelCall_13second_allele___get__(o);
34646 static PyObject *__pyx_getprop_9csamtools_9IndelCall_reads_first(PyObject *o, void *x) {
34647 return __pyx_pf_9csamtools_9IndelCall_11reads_first___get__(o);
34650 static PyObject *__pyx_getprop_9csamtools_9IndelCall_reads_second(PyObject *o, void *x) {
34651 return __pyx_pf_9csamtools_9IndelCall_12reads_second___get__(o);
34654 static PyObject *__pyx_getprop_9csamtools_9IndelCall_reads_diff(PyObject *o, void *x) {
34655 return __pyx_pf_9csamtools_9IndelCall_10reads_diff___get__(o);
34658 static PyMethodDef __pyx_methods_9csamtools_IndelCall[] = {
34662 static struct PyGetSetDef __pyx_getsets_9csamtools_IndelCall[] = {
34663 {(char *)"tid", __pyx_getprop_9csamtools_9IndelCall_tid, 0, __Pyx_DOCSTR(__pyx_k_154), 0},
34664 {(char *)"pos", __pyx_getprop_9csamtools_9IndelCall_pos, 0, __Pyx_DOCSTR(__pyx_k_162), 0},
34665 {(char *)"genotype", __pyx_getprop_9csamtools_9IndelCall_genotype, 0, __Pyx_DOCSTR(__pyx_k_164), 0},
34666 {(char *)"consensus_quality", __pyx_getprop_9csamtools_9IndelCall_consensus_quality, 0, __Pyx_DOCSTR(__pyx_k_165), 0},
34667 {(char *)"snp_quality", __pyx_getprop_9csamtools_9IndelCall_snp_quality, 0, __Pyx_DOCSTR(__pyx_k_166), 0},
34668 {(char *)"mapping_quality", __pyx_getprop_9csamtools_9IndelCall_mapping_quality, 0, __Pyx_DOCSTR(__pyx_k_167), 0},
34669 {(char *)"coverage", __pyx_getprop_9csamtools_9IndelCall_coverage, 0, __Pyx_DOCSTR(__pyx_k_168), 0},
34670 {(char *)"first_allele", __pyx_getprop_9csamtools_9IndelCall_first_allele, 0, __Pyx_DOCSTR(__pyx_k_169), 0},
34671 {(char *)"second_allele", __pyx_getprop_9csamtools_9IndelCall_second_allele, 0, __Pyx_DOCSTR(__pyx_k_170), 0},
34672 {(char *)"reads_first", __pyx_getprop_9csamtools_9IndelCall_reads_first, 0, __Pyx_DOCSTR(__pyx_k_171), 0},
34673 {(char *)"reads_second", __pyx_getprop_9csamtools_9IndelCall_reads_second, 0, __Pyx_DOCSTR(__pyx_k_171), 0},
34674 {(char *)"reads_diff", __pyx_getprop_9csamtools_9IndelCall_reads_diff, 0, __Pyx_DOCSTR(__pyx_k_171), 0},
34678 static PyNumberMethods __pyx_tp_as_number_IndelCall = {
34682 #if PY_MAJOR_VERSION < 3
34685 0, /*nb_remainder*/
34698 #if PY_MAJOR_VERSION < 3
34702 #if PY_MAJOR_VERSION < 3
34708 #if PY_MAJOR_VERSION < 3
34711 #if PY_MAJOR_VERSION < 3
34714 0, /*nb_inplace_add*/
34715 0, /*nb_inplace_subtract*/
34716 0, /*nb_inplace_multiply*/
34717 #if PY_MAJOR_VERSION < 3
34718 0, /*nb_inplace_divide*/
34720 0, /*nb_inplace_remainder*/
34721 0, /*nb_inplace_power*/
34722 0, /*nb_inplace_lshift*/
34723 0, /*nb_inplace_rshift*/
34724 0, /*nb_inplace_and*/
34725 0, /*nb_inplace_xor*/
34726 0, /*nb_inplace_or*/
34727 0, /*nb_floor_divide*/
34728 0, /*nb_true_divide*/
34729 0, /*nb_inplace_floor_divide*/
34730 0, /*nb_inplace_true_divide*/
34731 #if PY_VERSION_HEX >= 0x02050000
34736 static PySequenceMethods __pyx_tp_as_sequence_IndelCall = {
34743 0, /*sq_ass_slice*/
34745 0, /*sq_inplace_concat*/
34746 0, /*sq_inplace_repeat*/
34749 static PyMappingMethods __pyx_tp_as_mapping_IndelCall = {
34751 0, /*mp_subscript*/
34752 0, /*mp_ass_subscript*/
34755 static PyBufferProcs __pyx_tp_as_buffer_IndelCall = {
34756 #if PY_MAJOR_VERSION < 3
34757 0, /*bf_getreadbuffer*/
34759 #if PY_MAJOR_VERSION < 3
34760 0, /*bf_getwritebuffer*/
34762 #if PY_MAJOR_VERSION < 3
34763 0, /*bf_getsegcount*/
34765 #if PY_MAJOR_VERSION < 3
34766 0, /*bf_getcharbuffer*/
34768 #if PY_VERSION_HEX >= 0x02060000
34769 0, /*bf_getbuffer*/
34771 #if PY_VERSION_HEX >= 0x02060000
34772 0, /*bf_releasebuffer*/
34776 PyTypeObject __pyx_type_9csamtools_IndelCall = {
34777 PyVarObject_HEAD_INIT(0, 0)
34778 __Pyx_NAMESTR("csamtools.IndelCall"), /*tp_name*/
34779 sizeof(struct __pyx_obj_9csamtools_IndelCall), /*tp_basicsize*/
34781 __pyx_tp_dealloc_9csamtools_IndelCall, /*tp_dealloc*/
34785 #if PY_MAJOR_VERSION < 3
34791 &__pyx_tp_as_number_IndelCall, /*tp_as_number*/
34792 &__pyx_tp_as_sequence_IndelCall, /*tp_as_sequence*/
34793 &__pyx_tp_as_mapping_IndelCall, /*tp_as_mapping*/
34796 __pyx_pf_9csamtools_9IndelCall___str__, /*tp_str*/
34799 &__pyx_tp_as_buffer_IndelCall, /*tp_as_buffer*/
34800 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER, /*tp_flags*/
34801 __Pyx_DOCSTR("the results of an indel call."), /*tp_doc*/
34804 0, /*tp_richcompare*/
34805 0, /*tp_weaklistoffset*/
34808 __pyx_methods_9csamtools_IndelCall, /*tp_methods*/
34810 __pyx_getsets_9csamtools_IndelCall, /*tp_getset*/
34813 0, /*tp_descr_get*/
34814 0, /*tp_descr_set*/
34815 0, /*tp_dictoffset*/
34818 __pyx_tp_new_9csamtools_IndelCall, /*tp_new*/
34824 0, /*tp_subclasses*/
34827 #if PY_VERSION_HEX >= 0x02060000
34828 0, /*tp_version_tag*/
34832 static PyObject *__pyx_tp_new_9csamtools_IndelCallerBase(PyTypeObject *t, PyObject *a, PyObject *k) {
34833 struct __pyx_obj_9csamtools_IndelCallerBase *p;
34834 PyObject *o = (*t->tp_alloc)(t, 0);
34836 p = ((struct __pyx_obj_9csamtools_IndelCallerBase *)o);
34837 p->iter = ((struct __pyx_obj_9csamtools_IteratorColumn *)Py_None); Py_INCREF(Py_None);
34838 if (__pyx_pf_9csamtools_15IndelCallerBase___cinit__(o, a, k) < 0) {
34839 Py_DECREF(o); o = 0;
34844 static void __pyx_tp_dealloc_9csamtools_IndelCallerBase(PyObject *o) {
34845 struct __pyx_obj_9csamtools_IndelCallerBase *p = (struct __pyx_obj_9csamtools_IndelCallerBase *)o;
34847 PyObject *etype, *eval, *etb;
34848 PyErr_Fetch(&etype, &eval, &etb);
34850 __pyx_pf_9csamtools_15IndelCallerBase___dealloc__(o);
34851 if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
34853 PyErr_Restore(etype, eval, etb);
34855 Py_XDECREF(((PyObject *)p->iter));
34856 (*Py_TYPE(o)->tp_free)(o);
34859 static int __pyx_tp_traverse_9csamtools_IndelCallerBase(PyObject *o, visitproc v, void *a) {
34861 struct __pyx_obj_9csamtools_IndelCallerBase *p = (struct __pyx_obj_9csamtools_IndelCallerBase *)o;
34863 e = (*v)(((PyObject*)p->iter), a); if (e) return e;
34868 static int __pyx_tp_clear_9csamtools_IndelCallerBase(PyObject *o) {
34869 struct __pyx_obj_9csamtools_IndelCallerBase *p = (struct __pyx_obj_9csamtools_IndelCallerBase *)o;
34871 tmp = ((PyObject*)p->iter);
34872 p->iter = ((struct __pyx_obj_9csamtools_IteratorColumn *)Py_None); Py_INCREF(Py_None);
34877 static PyMethodDef __pyx_methods_9csamtools_IndelCallerBase[] = {
34878 {__Pyx_NAMESTR("_call"), (PyCFunction)__pyx_pf_9csamtools_15IndelCallerBase__call, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_9csamtools_15IndelCallerBase__call)},
34882 static PyNumberMethods __pyx_tp_as_number_IndelCallerBase = {
34886 #if PY_MAJOR_VERSION < 3
34889 0, /*nb_remainder*/
34902 #if PY_MAJOR_VERSION < 3
34906 #if PY_MAJOR_VERSION < 3
34912 #if PY_MAJOR_VERSION < 3
34915 #if PY_MAJOR_VERSION < 3
34918 0, /*nb_inplace_add*/
34919 0, /*nb_inplace_subtract*/
34920 0, /*nb_inplace_multiply*/
34921 #if PY_MAJOR_VERSION < 3
34922 0, /*nb_inplace_divide*/
34924 0, /*nb_inplace_remainder*/
34925 0, /*nb_inplace_power*/
34926 0, /*nb_inplace_lshift*/
34927 0, /*nb_inplace_rshift*/
34928 0, /*nb_inplace_and*/
34929 0, /*nb_inplace_xor*/
34930 0, /*nb_inplace_or*/
34931 0, /*nb_floor_divide*/
34932 0, /*nb_true_divide*/
34933 0, /*nb_inplace_floor_divide*/
34934 0, /*nb_inplace_true_divide*/
34935 #if PY_VERSION_HEX >= 0x02050000
34940 static PySequenceMethods __pyx_tp_as_sequence_IndelCallerBase = {
34947 0, /*sq_ass_slice*/
34949 0, /*sq_inplace_concat*/
34950 0, /*sq_inplace_repeat*/
34953 static PyMappingMethods __pyx_tp_as_mapping_IndelCallerBase = {
34955 0, /*mp_subscript*/
34956 0, /*mp_ass_subscript*/
34959 static PyBufferProcs __pyx_tp_as_buffer_IndelCallerBase = {
34960 #if PY_MAJOR_VERSION < 3
34961 0, /*bf_getreadbuffer*/
34963 #if PY_MAJOR_VERSION < 3
34964 0, /*bf_getwritebuffer*/
34966 #if PY_MAJOR_VERSION < 3
34967 0, /*bf_getsegcount*/
34969 #if PY_MAJOR_VERSION < 3
34970 0, /*bf_getcharbuffer*/
34972 #if PY_VERSION_HEX >= 0x02060000
34973 0, /*bf_getbuffer*/
34975 #if PY_VERSION_HEX >= 0x02060000
34976 0, /*bf_releasebuffer*/
34980 PyTypeObject __pyx_type_9csamtools_IndelCallerBase = {
34981 PyVarObject_HEAD_INIT(0, 0)
34982 __Pyx_NAMESTR("csamtools.IndelCallerBase"), /*tp_name*/
34983 sizeof(struct __pyx_obj_9csamtools_IndelCallerBase), /*tp_basicsize*/
34985 __pyx_tp_dealloc_9csamtools_IndelCallerBase, /*tp_dealloc*/
34989 #if PY_MAJOR_VERSION < 3
34995 &__pyx_tp_as_number_IndelCallerBase, /*tp_as_number*/
34996 &__pyx_tp_as_sequence_IndelCallerBase, /*tp_as_sequence*/
34997 &__pyx_tp_as_mapping_IndelCallerBase, /*tp_as_mapping*/
35003 &__pyx_tp_as_buffer_IndelCallerBase, /*tp_as_buffer*/
35004 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
35005 __Pyx_DOCSTR("Base class for SNP callers.\n\n *min_baseQ*\n minimum base quality (possibly capped by BAQ)\n *capQ_threshold*\n coefficient for adjusting mapQ of poor mappings\n *theta*\n theta in maq consensus calling model\n *n_haplotypes*\n number of haplotypes in the sample\n *het_rate*\n prior of a difference between two haplotypes\n "), /*tp_doc*/
35006 __pyx_tp_traverse_9csamtools_IndelCallerBase, /*tp_traverse*/
35007 __pyx_tp_clear_9csamtools_IndelCallerBase, /*tp_clear*/
35008 0, /*tp_richcompare*/
35009 0, /*tp_weaklistoffset*/
35012 __pyx_methods_9csamtools_IndelCallerBase, /*tp_methods*/
35017 0, /*tp_descr_get*/
35018 0, /*tp_descr_set*/
35019 0, /*tp_dictoffset*/
35022 __pyx_tp_new_9csamtools_IndelCallerBase, /*tp_new*/
35028 0, /*tp_subclasses*/
35031 #if PY_VERSION_HEX >= 0x02060000
35032 0, /*tp_version_tag*/
35036 static PyObject *__pyx_tp_new_9csamtools_IndelCaller(PyTypeObject *t, PyObject *a, PyObject *k) {
35037 PyObject *o = __pyx_tp_new_9csamtools_IndelCallerBase(t, a, k);
35039 if (__pyx_pf_9csamtools_11IndelCaller___cinit__(o, a, k) < 0) {
35040 Py_DECREF(o); o = 0;
35045 static PyMethodDef __pyx_methods_9csamtools_IndelCaller[] = {
35046 {__Pyx_NAMESTR("call"), (PyCFunction)__pyx_pf_9csamtools_11IndelCaller_call, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_9csamtools_11IndelCaller_call)},
35050 static PyNumberMethods __pyx_tp_as_number_IndelCaller = {
35054 #if PY_MAJOR_VERSION < 3
35057 0, /*nb_remainder*/
35070 #if PY_MAJOR_VERSION < 3
35074 #if PY_MAJOR_VERSION < 3
35080 #if PY_MAJOR_VERSION < 3
35083 #if PY_MAJOR_VERSION < 3
35086 0, /*nb_inplace_add*/
35087 0, /*nb_inplace_subtract*/
35088 0, /*nb_inplace_multiply*/
35089 #if PY_MAJOR_VERSION < 3
35090 0, /*nb_inplace_divide*/
35092 0, /*nb_inplace_remainder*/
35093 0, /*nb_inplace_power*/
35094 0, /*nb_inplace_lshift*/
35095 0, /*nb_inplace_rshift*/
35096 0, /*nb_inplace_and*/
35097 0, /*nb_inplace_xor*/
35098 0, /*nb_inplace_or*/
35099 0, /*nb_floor_divide*/
35100 0, /*nb_true_divide*/
35101 0, /*nb_inplace_floor_divide*/
35102 0, /*nb_inplace_true_divide*/
35103 #if PY_VERSION_HEX >= 0x02050000
35108 static PySequenceMethods __pyx_tp_as_sequence_IndelCaller = {
35115 0, /*sq_ass_slice*/
35117 0, /*sq_inplace_concat*/
35118 0, /*sq_inplace_repeat*/
35121 static PyMappingMethods __pyx_tp_as_mapping_IndelCaller = {
35123 0, /*mp_subscript*/
35124 0, /*mp_ass_subscript*/
35127 static PyBufferProcs __pyx_tp_as_buffer_IndelCaller = {
35128 #if PY_MAJOR_VERSION < 3
35129 0, /*bf_getreadbuffer*/
35131 #if PY_MAJOR_VERSION < 3
35132 0, /*bf_getwritebuffer*/
35134 #if PY_MAJOR_VERSION < 3
35135 0, /*bf_getsegcount*/
35137 #if PY_MAJOR_VERSION < 3
35138 0, /*bf_getcharbuffer*/
35140 #if PY_VERSION_HEX >= 0x02060000
35141 0, /*bf_getbuffer*/
35143 #if PY_VERSION_HEX >= 0x02060000
35144 0, /*bf_releasebuffer*/
35148 PyTypeObject __pyx_type_9csamtools_IndelCaller = {
35149 PyVarObject_HEAD_INIT(0, 0)
35150 __Pyx_NAMESTR("csamtools.IndelCaller"), /*tp_name*/
35151 sizeof(struct __pyx_obj_9csamtools_IndelCaller), /*tp_basicsize*/
35153 __pyx_tp_dealloc_9csamtools_IndelCallerBase, /*tp_dealloc*/
35157 #if PY_MAJOR_VERSION < 3
35163 &__pyx_tp_as_number_IndelCaller, /*tp_as_number*/
35164 &__pyx_tp_as_sequence_IndelCaller, /*tp_as_sequence*/
35165 &__pyx_tp_as_mapping_IndelCaller, /*tp_as_mapping*/
35171 &__pyx_tp_as_buffer_IndelCaller, /*tp_as_buffer*/
35172 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
35173 __Pyx_DOCSTR("*(IteratorColumn iterator_column )*\n\n The samtools SNP caller.\n\n This object will call SNPs in *samfile* against the reference\n sequence in *fasta*.\n\n This caller is fast for calling few SNPs in selected regions.\n\n It is slow, if called over large genomic regions.\n "), /*tp_doc*/
35174 __pyx_tp_traverse_9csamtools_IndelCallerBase, /*tp_traverse*/
35175 __pyx_tp_clear_9csamtools_IndelCallerBase, /*tp_clear*/
35176 0, /*tp_richcompare*/
35177 0, /*tp_weaklistoffset*/
35180 __pyx_methods_9csamtools_IndelCaller, /*tp_methods*/
35185 0, /*tp_descr_get*/
35186 0, /*tp_descr_set*/
35187 0, /*tp_dictoffset*/
35190 __pyx_tp_new_9csamtools_IndelCaller, /*tp_new*/
35196 0, /*tp_subclasses*/
35199 #if PY_VERSION_HEX >= 0x02060000
35200 0, /*tp_version_tag*/
35204 static PyObject *__pyx_tp_new_9csamtools_IteratorIndelCalls(PyTypeObject *t, PyObject *a, PyObject *k) {
35205 PyObject *o = __pyx_tp_new_9csamtools_IndelCallerBase(t, a, k);
35207 if (__pyx_pf_9csamtools_18IteratorIndelCalls___cinit__(o, a, k) < 0) {
35208 Py_DECREF(o); o = 0;
35213 static PyMethodDef __pyx_methods_9csamtools_IteratorIndelCalls[] = {
35214 {__Pyx_NAMESTR("__next__"), (PyCFunction)__pyx_pf_9csamtools_18IteratorIndelCalls___next__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(__pyx_doc_9csamtools_18IteratorIndelCalls___next__)},
35218 static PyNumberMethods __pyx_tp_as_number_IteratorIndelCalls = {
35222 #if PY_MAJOR_VERSION < 3
35225 0, /*nb_remainder*/
35238 #if PY_MAJOR_VERSION < 3
35242 #if PY_MAJOR_VERSION < 3
35248 #if PY_MAJOR_VERSION < 3
35251 #if PY_MAJOR_VERSION < 3
35254 0, /*nb_inplace_add*/
35255 0, /*nb_inplace_subtract*/
35256 0, /*nb_inplace_multiply*/
35257 #if PY_MAJOR_VERSION < 3
35258 0, /*nb_inplace_divide*/
35260 0, /*nb_inplace_remainder*/
35261 0, /*nb_inplace_power*/
35262 0, /*nb_inplace_lshift*/
35263 0, /*nb_inplace_rshift*/
35264 0, /*nb_inplace_and*/
35265 0, /*nb_inplace_xor*/
35266 0, /*nb_inplace_or*/
35267 0, /*nb_floor_divide*/
35268 0, /*nb_true_divide*/
35269 0, /*nb_inplace_floor_divide*/
35270 0, /*nb_inplace_true_divide*/
35271 #if PY_VERSION_HEX >= 0x02050000
35276 static PySequenceMethods __pyx_tp_as_sequence_IteratorIndelCalls = {
35283 0, /*sq_ass_slice*/
35285 0, /*sq_inplace_concat*/
35286 0, /*sq_inplace_repeat*/
35289 static PyMappingMethods __pyx_tp_as_mapping_IteratorIndelCalls = {
35291 0, /*mp_subscript*/
35292 0, /*mp_ass_subscript*/
35295 static PyBufferProcs __pyx_tp_as_buffer_IteratorIndelCalls = {
35296 #if PY_MAJOR_VERSION < 3
35297 0, /*bf_getreadbuffer*/
35299 #if PY_MAJOR_VERSION < 3
35300 0, /*bf_getwritebuffer*/
35302 #if PY_MAJOR_VERSION < 3
35303 0, /*bf_getsegcount*/
35305 #if PY_MAJOR_VERSION < 3
35306 0, /*bf_getcharbuffer*/
35308 #if PY_VERSION_HEX >= 0x02060000
35309 0, /*bf_getbuffer*/
35311 #if PY_VERSION_HEX >= 0x02060000
35312 0, /*bf_releasebuffer*/
35316 PyTypeObject __pyx_type_9csamtools_IteratorIndelCalls = {
35317 PyVarObject_HEAD_INIT(0, 0)
35318 __Pyx_NAMESTR("csamtools.IteratorIndelCalls"), /*tp_name*/
35319 sizeof(struct __pyx_obj_9csamtools_IteratorIndelCalls), /*tp_basicsize*/
35321 __pyx_tp_dealloc_9csamtools_IndelCallerBase, /*tp_dealloc*/
35325 #if PY_MAJOR_VERSION < 3
35331 &__pyx_tp_as_number_IteratorIndelCalls, /*tp_as_number*/
35332 &__pyx_tp_as_sequence_IteratorIndelCalls, /*tp_as_sequence*/
35333 &__pyx_tp_as_mapping_IteratorIndelCalls, /*tp_as_mapping*/
35339 &__pyx_tp_as_buffer_IteratorIndelCalls, /*tp_as_buffer*/
35340 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
35341 __Pyx_DOCSTR("*(IteratorColumn iterator)*\n\n call indels within a region.\n\n *iterator* is a pileup iterator. SNPs will be called\n on all positions returned by this iterator.\n\n This caller is fast if SNPs are called over large continuous\n regions. It is slow, if instantiated frequently and in random\n order as the sequence will have to be reloaded.\n\n "), /*tp_doc*/
35342 __pyx_tp_traverse_9csamtools_IndelCallerBase, /*tp_traverse*/
35343 __pyx_tp_clear_9csamtools_IndelCallerBase, /*tp_clear*/
35344 0, /*tp_richcompare*/
35345 0, /*tp_weaklistoffset*/
35346 __pyx_pf_9csamtools_18IteratorIndelCalls___iter__, /*tp_iter*/
35347 __pyx_pf_9csamtools_18IteratorIndelCalls___next__, /*tp_iternext*/
35348 __pyx_methods_9csamtools_IteratorIndelCalls, /*tp_methods*/
35353 0, /*tp_descr_get*/
35354 0, /*tp_descr_set*/
35355 0, /*tp_dictoffset*/
35358 __pyx_tp_new_9csamtools_IteratorIndelCalls, /*tp_new*/
35364 0, /*tp_subclasses*/
35367 #if PY_VERSION_HEX >= 0x02060000
35368 0, /*tp_version_tag*/
35372 static PyObject *__pyx_tp_new_9csamtools_IndexedReads(PyTypeObject *t, PyObject *a, PyObject *k) {
35373 struct __pyx_obj_9csamtools_IndexedReads *p;
35374 PyObject *o = (*t->tp_alloc)(t, 0);
35376 p = ((struct __pyx_obj_9csamtools_IndexedReads *)o);
35377 p->samfile = ((struct __pyx_obj_9csamtools_Samfile *)Py_None); Py_INCREF(Py_None);
35378 p->index = Py_None; Py_INCREF(Py_None);
35382 static void __pyx_tp_dealloc_9csamtools_IndexedReads(PyObject *o) {
35383 struct __pyx_obj_9csamtools_IndexedReads *p = (struct __pyx_obj_9csamtools_IndexedReads *)o;
35385 PyObject *etype, *eval, *etb;
35386 PyErr_Fetch(&etype, &eval, &etb);
35388 __pyx_pf_9csamtools_12IndexedReads___dealloc__(o);
35389 if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
35391 PyErr_Restore(etype, eval, etb);
35393 Py_XDECREF(((PyObject *)p->samfile));
35394 Py_XDECREF(p->index);
35395 (*Py_TYPE(o)->tp_free)(o);
35398 static int __pyx_tp_traverse_9csamtools_IndexedReads(PyObject *o, visitproc v, void *a) {
35400 struct __pyx_obj_9csamtools_IndexedReads *p = (struct __pyx_obj_9csamtools_IndexedReads *)o;
35402 e = (*v)(((PyObject*)p->samfile), a); if (e) return e;
35405 e = (*v)(p->index, a); if (e) return e;
35410 static int __pyx_tp_clear_9csamtools_IndexedReads(PyObject *o) {
35411 struct __pyx_obj_9csamtools_IndexedReads *p = (struct __pyx_obj_9csamtools_IndexedReads *)o;
35413 tmp = ((PyObject*)p->samfile);
35414 p->samfile = ((struct __pyx_obj_9csamtools_Samfile *)Py_None); Py_INCREF(Py_None);
35416 tmp = ((PyObject*)p->index);
35417 p->index = Py_None; Py_INCREF(Py_None);
35422 static PyMethodDef __pyx_methods_9csamtools_IndexedReads[] = {
35423 {__Pyx_NAMESTR("build"), (PyCFunction)__pyx_pf_9csamtools_12IndexedReads_build, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_9csamtools_12IndexedReads_build)},
35424 {__Pyx_NAMESTR("find"), (PyCFunction)__pyx_pf_9csamtools_12IndexedReads_find, METH_O, __Pyx_DOCSTR(__pyx_doc_9csamtools_12IndexedReads_find)},
35428 static PyNumberMethods __pyx_tp_as_number_IndexedReads = {
35432 #if PY_MAJOR_VERSION < 3
35435 0, /*nb_remainder*/
35448 #if PY_MAJOR_VERSION < 3
35452 #if PY_MAJOR_VERSION < 3
35458 #if PY_MAJOR_VERSION < 3
35461 #if PY_MAJOR_VERSION < 3
35464 0, /*nb_inplace_add*/
35465 0, /*nb_inplace_subtract*/
35466 0, /*nb_inplace_multiply*/
35467 #if PY_MAJOR_VERSION < 3
35468 0, /*nb_inplace_divide*/
35470 0, /*nb_inplace_remainder*/
35471 0, /*nb_inplace_power*/
35472 0, /*nb_inplace_lshift*/
35473 0, /*nb_inplace_rshift*/
35474 0, /*nb_inplace_and*/
35475 0, /*nb_inplace_xor*/
35476 0, /*nb_inplace_or*/
35477 0, /*nb_floor_divide*/
35478 0, /*nb_true_divide*/
35479 0, /*nb_inplace_floor_divide*/
35480 0, /*nb_inplace_true_divide*/
35481 #if PY_VERSION_HEX >= 0x02050000
35486 static PySequenceMethods __pyx_tp_as_sequence_IndexedReads = {
35493 0, /*sq_ass_slice*/
35495 0, /*sq_inplace_concat*/
35496 0, /*sq_inplace_repeat*/
35499 static PyMappingMethods __pyx_tp_as_mapping_IndexedReads = {
35501 0, /*mp_subscript*/
35502 0, /*mp_ass_subscript*/
35505 static PyBufferProcs __pyx_tp_as_buffer_IndexedReads = {
35506 #if PY_MAJOR_VERSION < 3
35507 0, /*bf_getreadbuffer*/
35509 #if PY_MAJOR_VERSION < 3
35510 0, /*bf_getwritebuffer*/
35512 #if PY_MAJOR_VERSION < 3
35513 0, /*bf_getsegcount*/
35515 #if PY_MAJOR_VERSION < 3
35516 0, /*bf_getcharbuffer*/
35518 #if PY_VERSION_HEX >= 0x02060000
35519 0, /*bf_getbuffer*/
35521 #if PY_VERSION_HEX >= 0x02060000
35522 0, /*bf_releasebuffer*/
35526 PyTypeObject __pyx_type_9csamtools_IndexedReads = {
35527 PyVarObject_HEAD_INIT(0, 0)
35528 __Pyx_NAMESTR("csamtools.IndexedReads"), /*tp_name*/
35529 sizeof(struct __pyx_obj_9csamtools_IndexedReads), /*tp_basicsize*/
35531 __pyx_tp_dealloc_9csamtools_IndexedReads, /*tp_dealloc*/
35535 #if PY_MAJOR_VERSION < 3
35541 &__pyx_tp_as_number_IndexedReads, /*tp_as_number*/
35542 &__pyx_tp_as_sequence_IndexedReads, /*tp_as_sequence*/
35543 &__pyx_tp_as_mapping_IndexedReads, /*tp_as_mapping*/
35549 &__pyx_tp_as_buffer_IndexedReads, /*tp_as_buffer*/
35550 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
35551 __Pyx_DOCSTR("IndexedReads(Samfile samfile, int reopen=True)\nindex a bamfile by read.\n\n The index is kept in memory.\n\n By default, the file is re-openend to avoid conflicts if\n multiple operators work on the same file. Set *reopen* = False\n to not re-open *samfile*.\n "), /*tp_doc*/
35552 __pyx_tp_traverse_9csamtools_IndexedReads, /*tp_traverse*/
35553 __pyx_tp_clear_9csamtools_IndexedReads, /*tp_clear*/
35554 0, /*tp_richcompare*/
35555 0, /*tp_weaklistoffset*/
35558 __pyx_methods_9csamtools_IndexedReads, /*tp_methods*/
35563 0, /*tp_descr_get*/
35564 0, /*tp_descr_set*/
35565 0, /*tp_dictoffset*/
35566 __pyx_pf_9csamtools_12IndexedReads___init__, /*tp_init*/
35568 __pyx_tp_new_9csamtools_IndexedReads, /*tp_new*/
35574 0, /*tp_subclasses*/
35577 #if PY_VERSION_HEX >= 0x02060000
35578 0, /*tp_version_tag*/
35582 static PyMethodDef __pyx_methods[] = {
35583 {__Pyx_NAMESTR("_samtools_dispatch"), (PyCFunction)__pyx_pf_9csamtools__samtools_dispatch, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_9csamtools__samtools_dispatch)},
35587 #if PY_MAJOR_VERSION >= 3
35588 static struct PyModuleDef __pyx_moduledef = {
35589 PyModuleDef_HEAD_INIT,
35590 __Pyx_NAMESTR("csamtools"),
35593 __pyx_methods /* m_methods */,
35594 NULL, /* m_reload */
35595 NULL, /* m_traverse */
35596 NULL, /* m_clear */
35601 static __Pyx_StringTabEntry __pyx_string_tab[] = {
35602 {&__pyx_kp_s_1, __pyx_k_1, sizeof(__pyx_k_1), 0, 0, 1, 0},
35603 {&__pyx_kp_s_10, __pyx_k_10, sizeof(__pyx_k_10), 0, 0, 1, 0},
35604 {&__pyx_kp_s_100, __pyx_k_100, sizeof(__pyx_k_100), 0, 0, 1, 0},
35605 {&__pyx_kp_s_101, __pyx_k_101, sizeof(__pyx_k_101), 0, 0, 1, 0},
35606 {&__pyx_kp_s_102, __pyx_k_102, sizeof(__pyx_k_102), 0, 0, 1, 0},
35607 {&__pyx_n_s_103, __pyx_k_103, sizeof(__pyx_k_103), 0, 0, 1, 1},
35608 {&__pyx_kp_s_104, __pyx_k_104, sizeof(__pyx_k_104), 0, 0, 1, 0},
35609 {&__pyx_kp_s_105, __pyx_k_105, sizeof(__pyx_k_105), 0, 0, 1, 0},
35610 {&__pyx_kp_s_107, __pyx_k_107, sizeof(__pyx_k_107), 0, 0, 1, 0},
35611 {&__pyx_kp_s_108, __pyx_k_108, sizeof(__pyx_k_108), 0, 0, 1, 0},
35612 {&__pyx_kp_s_109, __pyx_k_109, sizeof(__pyx_k_109), 0, 0, 1, 0},
35613 {&__pyx_kp_s_11, __pyx_k_11, sizeof(__pyx_k_11), 0, 0, 1, 0},
35614 {&__pyx_kp_s_110, __pyx_k_110, sizeof(__pyx_k_110), 0, 0, 1, 0},
35615 {&__pyx_kp_s_111, __pyx_k_111, sizeof(__pyx_k_111), 0, 0, 1, 0},
35616 {&__pyx_kp_s_112, __pyx_k_112, sizeof(__pyx_k_112), 0, 0, 1, 0},
35617 {&__pyx_kp_s_113, __pyx_k_113, sizeof(__pyx_k_113), 0, 0, 1, 0},
35618 {&__pyx_kp_s_12, __pyx_k_12, sizeof(__pyx_k_12), 0, 0, 1, 0},
35619 {&__pyx_kp_s_15, __pyx_k_15, sizeof(__pyx_k_15), 0, 0, 1, 0},
35620 {&__pyx_kp_s_16, __pyx_k_16, sizeof(__pyx_k_16), 0, 0, 1, 0},
35621 {&__pyx_kp_s_173, __pyx_k_173, sizeof(__pyx_k_173), 0, 0, 1, 0},
35622 {&__pyx_kp_s_174, __pyx_k_174, sizeof(__pyx_k_174), 0, 0, 1, 0},
35623 {&__pyx_kp_s_175, __pyx_k_175, sizeof(__pyx_k_175), 0, 0, 1, 0},
35624 {&__pyx_kp_s_176, __pyx_k_176, sizeof(__pyx_k_176), 0, 0, 1, 0},
35625 {&__pyx_kp_u_177, __pyx_k_177, sizeof(__pyx_k_177), 0, 1, 0, 0},
35626 {&__pyx_kp_u_178, __pyx_k_178, sizeof(__pyx_k_178), 0, 1, 0, 0},
35627 {&__pyx_kp_u_179, __pyx_k_179, sizeof(__pyx_k_179), 0, 1, 0, 0},
35628 {&__pyx_kp_s_18, __pyx_k_18, sizeof(__pyx_k_18), 0, 0, 1, 0},
35629 {&__pyx_kp_u_180, __pyx_k_180, sizeof(__pyx_k_180), 0, 1, 0, 0},
35630 {&__pyx_kp_u_181, __pyx_k_181, sizeof(__pyx_k_181), 0, 1, 0, 0},
35631 {&__pyx_kp_u_182, __pyx_k_182, sizeof(__pyx_k_182), 0, 1, 0, 0},
35632 {&__pyx_kp_u_183, __pyx_k_183, sizeof(__pyx_k_183), 0, 1, 0, 0},
35633 {&__pyx_kp_u_184, __pyx_k_184, sizeof(__pyx_k_184), 0, 1, 0, 0},
35634 {&__pyx_kp_u_185, __pyx_k_185, sizeof(__pyx_k_185), 0, 1, 0, 0},
35635 {&__pyx_kp_u_186, __pyx_k_186, sizeof(__pyx_k_186), 0, 1, 0, 0},
35636 {&__pyx_kp_u_187, __pyx_k_187, sizeof(__pyx_k_187), 0, 1, 0, 0},
35637 {&__pyx_kp_u_188, __pyx_k_188, sizeof(__pyx_k_188), 0, 1, 0, 0},
35638 {&__pyx_kp_u_189, __pyx_k_189, sizeof(__pyx_k_189), 0, 1, 0, 0},
35639 {&__pyx_kp_s_19, __pyx_k_19, sizeof(__pyx_k_19), 0, 0, 1, 0},
35640 {&__pyx_kp_u_190, __pyx_k_190, sizeof(__pyx_k_190), 0, 1, 0, 0},
35641 {&__pyx_kp_u_191, __pyx_k_191, sizeof(__pyx_k_191), 0, 1, 0, 0},
35642 {&__pyx_kp_u_192, __pyx_k_192, sizeof(__pyx_k_192), 0, 1, 0, 0},
35643 {&__pyx_kp_u_193, __pyx_k_193, sizeof(__pyx_k_193), 0, 1, 0, 0},
35644 {&__pyx_kp_u_194, __pyx_k_194, sizeof(__pyx_k_194), 0, 1, 0, 0},
35645 {&__pyx_kp_u_195, __pyx_k_195, sizeof(__pyx_k_195), 0, 1, 0, 0},
35646 {&__pyx_kp_u_196, __pyx_k_196, sizeof(__pyx_k_196), 0, 1, 0, 0},
35647 {&__pyx_kp_u_197, __pyx_k_197, sizeof(__pyx_k_197), 0, 1, 0, 0},
35648 {&__pyx_kp_u_198, __pyx_k_198, sizeof(__pyx_k_198), 0, 1, 0, 0},
35649 {&__pyx_kp_u_199, __pyx_k_199, sizeof(__pyx_k_199), 0, 1, 0, 0},
35650 {&__pyx_kp_s_2, __pyx_k_2, sizeof(__pyx_k_2), 0, 0, 1, 0},
35651 {&__pyx_kp_s_20, __pyx_k_20, sizeof(__pyx_k_20), 0, 0, 1, 0},
35652 {&__pyx_n_s_200, __pyx_k_200, sizeof(__pyx_k_200), 0, 0, 1, 1},
35653 {&__pyx_kp_u_201, __pyx_k_201, sizeof(__pyx_k_201), 0, 1, 0, 0},
35654 {&__pyx_kp_u_202, __pyx_k_202, sizeof(__pyx_k_202), 0, 1, 0, 0},
35655 {&__pyx_kp_u_203, __pyx_k_203, sizeof(__pyx_k_203), 0, 1, 0, 0},
35656 {&__pyx_n_s_204, __pyx_k_204, sizeof(__pyx_k_204), 0, 0, 1, 1},
35657 {&__pyx_kp_u_205, __pyx_k_205, sizeof(__pyx_k_205), 0, 1, 0, 0},
35658 {&__pyx_n_s_206, __pyx_k_206, sizeof(__pyx_k_206), 0, 0, 1, 1},
35659 {&__pyx_kp_u_207, __pyx_k_207, sizeof(__pyx_k_207), 0, 1, 0, 0},
35660 {&__pyx_kp_u_208, __pyx_k_208, sizeof(__pyx_k_208), 0, 1, 0, 0},
35661 {&__pyx_kp_u_209, __pyx_k_209, sizeof(__pyx_k_209), 0, 1, 0, 0},
35662 {&__pyx_kp_s_21, __pyx_k_21, sizeof(__pyx_k_21), 0, 0, 1, 0},
35663 {&__pyx_kp_u_210, __pyx_k_210, sizeof(__pyx_k_210), 0, 1, 0, 0},
35664 {&__pyx_kp_u_211, __pyx_k_211, sizeof(__pyx_k_211), 0, 1, 0, 0},
35665 {&__pyx_kp_u_212, __pyx_k_212, sizeof(__pyx_k_212), 0, 1, 0, 0},
35666 {&__pyx_kp_u_213, __pyx_k_213, sizeof(__pyx_k_213), 0, 1, 0, 0},
35667 {&__pyx_kp_u_214, __pyx_k_214, sizeof(__pyx_k_214), 0, 1, 0, 0},
35668 {&__pyx_kp_u_215, __pyx_k_215, sizeof(__pyx_k_215), 0, 1, 0, 0},
35669 {&__pyx_kp_u_216, __pyx_k_216, sizeof(__pyx_k_216), 0, 1, 0, 0},
35670 {&__pyx_kp_u_217, __pyx_k_217, sizeof(__pyx_k_217), 0, 1, 0, 0},
35671 {&__pyx_kp_u_218, __pyx_k_218, sizeof(__pyx_k_218), 0, 1, 0, 0},
35672 {&__pyx_kp_u_219, __pyx_k_219, sizeof(__pyx_k_219), 0, 1, 0, 0},
35673 {&__pyx_kp_s_22, __pyx_k_22, sizeof(__pyx_k_22), 0, 0, 1, 0},
35674 {&__pyx_kp_u_220, __pyx_k_220, sizeof(__pyx_k_220), 0, 1, 0, 0},
35675 {&__pyx_kp_s_23, __pyx_k_23, sizeof(__pyx_k_23), 0, 0, 1, 0},
35676 {&__pyx_kp_s_24, __pyx_k_24, sizeof(__pyx_k_24), 0, 0, 1, 0},
35677 {&__pyx_kp_s_25, __pyx_k_25, sizeof(__pyx_k_25), 0, 0, 1, 0},
35678 {&__pyx_kp_s_26, __pyx_k_26, sizeof(__pyx_k_26), 0, 0, 1, 0},
35679 {&__pyx_kp_s_27, __pyx_k_27, sizeof(__pyx_k_27), 0, 0, 1, 0},
35680 {&__pyx_kp_s_28, __pyx_k_28, sizeof(__pyx_k_28), 0, 0, 1, 0},
35681 {&__pyx_kp_s_3, __pyx_k_3, sizeof(__pyx_k_3), 0, 0, 1, 0},
35682 {&__pyx_kp_s_30, __pyx_k_30, sizeof(__pyx_k_30), 0, 0, 1, 0},
35683 {&__pyx_kp_s_31, __pyx_k_31, sizeof(__pyx_k_31), 0, 0, 1, 0},
35684 {&__pyx_kp_s_32, __pyx_k_32, sizeof(__pyx_k_32), 0, 0, 1, 0},
35685 {&__pyx_kp_s_33, __pyx_k_33, sizeof(__pyx_k_33), 0, 0, 1, 0},
35686 {&__pyx_kp_s_34, __pyx_k_34, sizeof(__pyx_k_34), 0, 0, 1, 0},
35687 {&__pyx_kp_s_35, __pyx_k_35, sizeof(__pyx_k_35), 0, 0, 1, 0},
35688 {&__pyx_kp_s_36, __pyx_k_36, sizeof(__pyx_k_36), 0, 0, 1, 0},
35689 {&__pyx_kp_s_37, __pyx_k_37, sizeof(__pyx_k_37), 0, 0, 1, 0},
35690 {&__pyx_kp_s_38, __pyx_k_38, sizeof(__pyx_k_38), 0, 0, 1, 0},
35691 {&__pyx_kp_s_4, __pyx_k_4, sizeof(__pyx_k_4), 0, 0, 1, 0},
35692 {&__pyx_kp_s_40, __pyx_k_40, sizeof(__pyx_k_40), 0, 0, 1, 0},
35693 {&__pyx_kp_s_41, __pyx_k_41, sizeof(__pyx_k_41), 0, 0, 1, 0},
35694 {&__pyx_kp_s_42, __pyx_k_42, sizeof(__pyx_k_42), 0, 0, 1, 0},
35695 {&__pyx_kp_s_43, __pyx_k_43, sizeof(__pyx_k_43), 0, 0, 1, 0},
35696 {&__pyx_kp_s_44, __pyx_k_44, sizeof(__pyx_k_44), 0, 0, 1, 0},
35697 {&__pyx_kp_s_45, __pyx_k_45, sizeof(__pyx_k_45), 0, 0, 1, 0},
35698 {&__pyx_kp_s_46, __pyx_k_46, sizeof(__pyx_k_46), 0, 0, 1, 0},
35699 {&__pyx_kp_s_47, __pyx_k_47, sizeof(__pyx_k_47), 0, 0, 1, 0},
35700 {&__pyx_kp_s_48, __pyx_k_48, sizeof(__pyx_k_48), 0, 0, 1, 0},
35701 {&__pyx_kp_s_49, __pyx_k_49, sizeof(__pyx_k_49), 0, 0, 1, 0},
35702 {&__pyx_kp_s_5, __pyx_k_5, sizeof(__pyx_k_5), 0, 0, 1, 0},
35703 {&__pyx_kp_s_50, __pyx_k_50, sizeof(__pyx_k_50), 0, 0, 1, 0},
35704 {&__pyx_kp_s_51, __pyx_k_51, sizeof(__pyx_k_51), 0, 0, 1, 0},
35705 {&__pyx_kp_s_52, __pyx_k_52, sizeof(__pyx_k_52), 0, 0, 1, 0},
35706 {&__pyx_kp_s_53, __pyx_k_53, sizeof(__pyx_k_53), 0, 0, 1, 0},
35707 {&__pyx_kp_s_54, __pyx_k_54, sizeof(__pyx_k_54), 0, 0, 1, 0},
35708 {&__pyx_kp_s_55, __pyx_k_55, sizeof(__pyx_k_55), 0, 0, 1, 0},
35709 {&__pyx_kp_s_56, __pyx_k_56, sizeof(__pyx_k_56), 0, 0, 1, 0},
35710 {&__pyx_kp_s_57, __pyx_k_57, sizeof(__pyx_k_57), 0, 0, 1, 0},
35711 {&__pyx_kp_s_59, __pyx_k_59, sizeof(__pyx_k_59), 0, 0, 1, 0},
35712 {&__pyx_kp_s_6, __pyx_k_6, sizeof(__pyx_k_6), 0, 0, 1, 0},
35713 {&__pyx_kp_s_61, __pyx_k_61, sizeof(__pyx_k_61), 0, 0, 1, 0},
35714 {&__pyx_kp_s_62, __pyx_k_62, sizeof(__pyx_k_62), 0, 0, 1, 0},
35715 {&__pyx_n_s_63, __pyx_k_63, sizeof(__pyx_k_63), 0, 0, 1, 1},
35716 {&__pyx_kp_s_64, __pyx_k_64, sizeof(__pyx_k_64), 0, 0, 1, 0},
35717 {&__pyx_kp_s_65, __pyx_k_65, sizeof(__pyx_k_65), 0, 0, 1, 0},
35718 {&__pyx_kp_s_66, __pyx_k_66, sizeof(__pyx_k_66), 0, 0, 1, 0},
35719 {&__pyx_kp_s_67, __pyx_k_67, sizeof(__pyx_k_67), 0, 0, 1, 0},
35720 {&__pyx_kp_s_68, __pyx_k_68, sizeof(__pyx_k_68), 0, 0, 1, 0},
35721 {&__pyx_kp_s_69, __pyx_k_69, sizeof(__pyx_k_69), 0, 0, 1, 0},
35722 {&__pyx_kp_s_7, __pyx_k_7, sizeof(__pyx_k_7), 0, 0, 1, 0},
35723 {&__pyx_kp_s_70, __pyx_k_70, sizeof(__pyx_k_70), 0, 0, 1, 0},
35724 {&__pyx_kp_s_71, __pyx_k_71, sizeof(__pyx_k_71), 0, 0, 1, 0},
35725 {&__pyx_kp_s_72, __pyx_k_72, sizeof(__pyx_k_72), 0, 0, 1, 0},
35726 {&__pyx_kp_s_73, __pyx_k_73, sizeof(__pyx_k_73), 0, 0, 1, 0},
35727 {&__pyx_kp_s_74, __pyx_k_74, sizeof(__pyx_k_74), 0, 0, 1, 0},
35728 {&__pyx_kp_s_75, __pyx_k_75, sizeof(__pyx_k_75), 0, 0, 1, 0},
35729 {&__pyx_kp_s_76, __pyx_k_76, sizeof(__pyx_k_76), 0, 0, 1, 0},
35730 {&__pyx_kp_s_77, __pyx_k_77, sizeof(__pyx_k_77), 0, 0, 1, 0},
35731 {&__pyx_kp_s_78, __pyx_k_78, sizeof(__pyx_k_78), 0, 0, 1, 0},
35732 {&__pyx_kp_s_79, __pyx_k_79, sizeof(__pyx_k_79), 0, 0, 1, 0},
35733 {&__pyx_kp_s_8, __pyx_k_8, sizeof(__pyx_k_8), 0, 0, 1, 0},
35734 {&__pyx_kp_s_80, __pyx_k_80, sizeof(__pyx_k_80), 0, 0, 1, 0},
35735 {&__pyx_kp_s_81, __pyx_k_81, sizeof(__pyx_k_81), 0, 0, 1, 0},
35736 {&__pyx_kp_s_82, __pyx_k_82, sizeof(__pyx_k_82), 0, 0, 1, 0},
35737 {&__pyx_kp_s_83, __pyx_k_83, sizeof(__pyx_k_83), 0, 0, 1, 0},
35738 {&__pyx_kp_s_84, __pyx_k_84, sizeof(__pyx_k_84), 0, 0, 1, 0},
35739 {&__pyx_kp_s_85, __pyx_k_85, sizeof(__pyx_k_85), 0, 0, 1, 0},
35740 {&__pyx_kp_s_86, __pyx_k_86, sizeof(__pyx_k_86), 0, 0, 1, 0},
35741 {&__pyx_kp_s_87, __pyx_k_87, sizeof(__pyx_k_87), 0, 0, 1, 0},
35742 {&__pyx_kp_s_88, __pyx_k_88, sizeof(__pyx_k_88), 0, 0, 1, 0},
35743 {&__pyx_kp_s_89, __pyx_k_89, sizeof(__pyx_k_89), 0, 0, 1, 0},
35744 {&__pyx_kp_s_9, __pyx_k_9, sizeof(__pyx_k_9), 0, 0, 1, 0},
35745 {&__pyx_kp_s_90, __pyx_k_90, sizeof(__pyx_k_90), 0, 0, 1, 0},
35746 {&__pyx_kp_s_91, __pyx_k_91, sizeof(__pyx_k_91), 0, 0, 1, 0},
35747 {&__pyx_kp_s_92, __pyx_k_92, sizeof(__pyx_k_92), 0, 0, 1, 0},
35748 {&__pyx_kp_s_93, __pyx_k_93, sizeof(__pyx_k_93), 0, 0, 1, 0},
35749 {&__pyx_kp_s_94, __pyx_k_94, sizeof(__pyx_k_94), 0, 0, 1, 0},
35750 {&__pyx_kp_s_95, __pyx_k_95, sizeof(__pyx_k_95), 0, 0, 1, 0},
35751 {&__pyx_kp_s_96, __pyx_k_96, sizeof(__pyx_k_96), 0, 0, 1, 0},
35752 {&__pyx_kp_s_97, __pyx_k_97, sizeof(__pyx_k_97), 0, 0, 1, 0},
35753 {&__pyx_n_s__A, __pyx_k__A, sizeof(__pyx_k__A), 0, 0, 1, 1},
35754 {&__pyx_n_s__AS, __pyx_k__AS, sizeof(__pyx_k__AS), 0, 0, 1, 1},
35755 {&__pyx_n_s__AlignedRead, __pyx_k__AlignedRead, sizeof(__pyx_k__AlignedRead), 0, 0, 1, 1},
35756 {&__pyx_n_s__C, __pyx_k__C, sizeof(__pyx_k__C), 0, 0, 1, 1},
35757 {&__pyx_n_s__CL, __pyx_k__CL, sizeof(__pyx_k__CL), 0, 0, 1, 1},
35758 {&__pyx_n_s__CN, __pyx_k__CN, sizeof(__pyx_k__CN), 0, 0, 1, 1},
35759 {&__pyx_n_s__CO, __pyx_k__CO, sizeof(__pyx_k__CO), 0, 0, 1, 1},
35760 {&__pyx_n_s__D, __pyx_k__D, sizeof(__pyx_k__D), 0, 0, 1, 1},
35761 {&__pyx_n_s__DS, __pyx_k__DS, sizeof(__pyx_k__DS), 0, 0, 1, 1},
35762 {&__pyx_n_s__DT, __pyx_k__DT, sizeof(__pyx_k__DT), 0, 0, 1, 1},
35763 {&__pyx_n_s__DictType, __pyx_k__DictType, sizeof(__pyx_k__DictType), 0, 0, 1, 1},
35764 {&__pyx_n_s__F, __pyx_k__F, sizeof(__pyx_k__F), 0, 0, 1, 1},
35765 {&__pyx_n_s__Fastafile, __pyx_k__Fastafile, sizeof(__pyx_k__Fastafile), 0, 0, 1, 1},
35766 {&__pyx_n_s__FloatType, __pyx_k__FloatType, sizeof(__pyx_k__FloatType), 0, 0, 1, 1},
35767 {&__pyx_n_s__GO, __pyx_k__GO, sizeof(__pyx_k__GO), 0, 0, 1, 1},
35768 {&__pyx_n_s__HD, __pyx_k__HD, sizeof(__pyx_k__HD), 0, 0, 1, 1},
35769 {&__pyx_n_s__I, __pyx_k__I, sizeof(__pyx_k__I), 0, 0, 1, 1},
35770 {&__pyx_n_s__ID, __pyx_k__ID, sizeof(__pyx_k__ID), 0, 0, 1, 1},
35771 {&__pyx_n_s__IOError, __pyx_k__IOError, sizeof(__pyx_k__IOError), 0, 0, 1, 1},
35772 {&__pyx_n_s__IndelCaller, __pyx_k__IndelCaller, sizeof(__pyx_k__IndelCaller), 0, 0, 1, 1},
35773 {&__pyx_n_s__IndexedReads, __pyx_k__IndexedReads, sizeof(__pyx_k__IndexedReads), 0, 0, 1, 1},
35774 {&__pyx_n_s__IntType, __pyx_k__IntType, sizeof(__pyx_k__IntType), 0, 0, 1, 1},
35775 {&__pyx_n_s__IteratorColumn, __pyx_k__IteratorColumn, sizeof(__pyx_k__IteratorColumn), 0, 0, 1, 1},
35776 {&__pyx_n_s__IteratorIndelCalls, __pyx_k__IteratorIndelCalls, sizeof(__pyx_k__IteratorIndelCalls), 0, 0, 1, 1},
35777 {&__pyx_n_s__IteratorRow, __pyx_k__IteratorRow, sizeof(__pyx_k__IteratorRow), 0, 0, 1, 1},
35778 {&__pyx_n_s__IteratorRowAll, __pyx_k__IteratorRowAll, sizeof(__pyx_k__IteratorRowAll), 0, 0, 1, 1},
35779 {&__pyx_n_s__IteratorRowAllRefs, __pyx_k__IteratorRowAllRefs, sizeof(__pyx_k__IteratorRowAllRefs), 0, 0, 1, 1},
35780 {&__pyx_n_s__IteratorRowRegion, __pyx_k__IteratorRowRegion, sizeof(__pyx_k__IteratorRowRegion), 0, 0, 1, 1},
35781 {&__pyx_n_s__IteratorSNPCalls, __pyx_k__IteratorSNPCalls, sizeof(__pyx_k__IteratorSNPCalls), 0, 0, 1, 1},
35782 {&__pyx_n_s__KeyError, __pyx_k__KeyError, sizeof(__pyx_k__KeyError), 0, 0, 1, 1},
35783 {&__pyx_n_s__LB, __pyx_k__LB, sizeof(__pyx_k__LB), 0, 0, 1, 1},
35784 {&__pyx_n_s__LN, __pyx_k__LN, sizeof(__pyx_k__LN), 0, 0, 1, 1},
35785 {&__pyx_n_s__M5, __pyx_k__M5, sizeof(__pyx_k__M5), 0, 0, 1, 1},
35786 {&__pyx_n_s__NotImplementedError, __pyx_k__NotImplementedError, sizeof(__pyx_k__NotImplementedError), 0, 0, 1, 1},
35787 {&__pyx_n_s__O_CREAT, __pyx_k__O_CREAT, sizeof(__pyx_k__O_CREAT), 0, 0, 1, 1},
35788 {&__pyx_n_s__O_WRONLY, __pyx_k__O_WRONLY, sizeof(__pyx_k__O_WRONLY), 0, 0, 1, 1},
35789 {&__pyx_n_s__Outs, __pyx_k__Outs, sizeof(__pyx_k__Outs), 0, 0, 1, 1},
35790 {&__pyx_n_s__OverflowError, __pyx_k__OverflowError, sizeof(__pyx_k__OverflowError), 0, 0, 1, 1},
35791 {&__pyx_n_s__PG, __pyx_k__PG, sizeof(__pyx_k__PG), 0, 0, 1, 1},
35792 {&__pyx_n_s__PI, __pyx_k__PI, sizeof(__pyx_k__PI), 0, 0, 1, 1},
35793 {&__pyx_n_s__PL, __pyx_k__PL, sizeof(__pyx_k__PL), 0, 0, 1, 1},
35794 {&__pyx_n_s__PN, __pyx_k__PN, sizeof(__pyx_k__PN), 0, 0, 1, 1},
35795 {&__pyx_n_s__PU, __pyx_k__PU, sizeof(__pyx_k__PU), 0, 0, 1, 1},
35796 {&__pyx_n_s__PileupColumn, __pyx_k__PileupColumn, sizeof(__pyx_k__PileupColumn), 0, 0, 1, 1},
35797 {&__pyx_n_s__PileupProxy, __pyx_k__PileupProxy, sizeof(__pyx_k__PileupProxy), 0, 0, 1, 1},
35798 {&__pyx_n_s__PileupRead, __pyx_k__PileupRead, sizeof(__pyx_k__PileupRead), 0, 0, 1, 1},
35799 {&__pyx_n_s__RG, __pyx_k__RG, sizeof(__pyx_k__RG), 0, 0, 1, 1},
35800 {&__pyx_n_s__S, __pyx_k__S, sizeof(__pyx_k__S), 0, 0, 1, 1},
35801 {&__pyx_n_s__SM, __pyx_k__SM, sizeof(__pyx_k__SM), 0, 0, 1, 1},
35802 {&__pyx_n_s__SN, __pyx_k__SN, sizeof(__pyx_k__SN), 0, 0, 1, 1},
35803 {&__pyx_n_s__SNPCaller, __pyx_k__SNPCaller, sizeof(__pyx_k__SNPCaller), 0, 0, 1, 1},
35804 {&__pyx_n_s__SO, __pyx_k__SO, sizeof(__pyx_k__SO), 0, 0, 1, 1},
35805 {&__pyx_n_s__SP, __pyx_k__SP, sizeof(__pyx_k__SP), 0, 0, 1, 1},
35806 {&__pyx_n_s__SQ, __pyx_k__SQ, sizeof(__pyx_k__SQ), 0, 0, 1, 1},
35807 {&__pyx_n_s__Samfile, __pyx_k__Samfile, sizeof(__pyx_k__Samfile), 0, 0, 1, 1},
35808 {&__pyx_n_s__StderrStore, __pyx_k__StderrStore, sizeof(__pyx_k__StderrStore), 0, 0, 1, 1},
35809 {&__pyx_n_s__StderrStoreWindows, __pyx_k__StderrStoreWindows, sizeof(__pyx_k__StderrStoreWindows), 0, 0, 1, 1},
35810 {&__pyx_n_s__StopIteration, __pyx_k__StopIteration, sizeof(__pyx_k__StopIteration), 0, 0, 1, 1},
35811 {&__pyx_n_s__TypeError, __pyx_k__TypeError, sizeof(__pyx_k__TypeError), 0, 0, 1, 1},
35812 {&__pyx_n_s__UR, __pyx_k__UR, sizeof(__pyx_k__UR), 0, 0, 1, 1},
35813 {&__pyx_n_s__VALID_HEADERS, __pyx_k__VALID_HEADERS, sizeof(__pyx_k__VALID_HEADERS), 0, 0, 1, 1},
35814 {&__pyx_n_s__VALID_HEADER_FIELDS, __pyx_k__VALID_HEADER_FIELDS, sizeof(__pyx_k__VALID_HEADER_FIELDS), 0, 0, 1, 1},
35815 {&__pyx_n_s__VALID_HEADER_ORDER, __pyx_k__VALID_HEADER_ORDER, sizeof(__pyx_k__VALID_HEADER_ORDER), 0, 0, 1, 1},
35816 {&__pyx_n_s__VALID_HEADER_TYPES, __pyx_k__VALID_HEADER_TYPES, sizeof(__pyx_k__VALID_HEADER_TYPES), 0, 0, 1, 1},
35817 {&__pyx_n_s__VN, __pyx_k__VN, sizeof(__pyx_k__VN), 0, 0, 1, 1},
35818 {&__pyx_n_s__ValueError, __pyx_k__ValueError, sizeof(__pyx_k__ValueError), 0, 0, 1, 1},
35819 {&__pyx_n_s__Windows, __pyx_k__Windows, sizeof(__pyx_k__Windows), 0, 0, 1, 1},
35820 {&__pyx_n_s__Z, __pyx_k__Z, sizeof(__pyx_k__Z), 0, 0, 1, 1},
35821 {&__pyx_n_s____all__, __pyx_k____all__, sizeof(__pyx_k____all__), 0, 0, 1, 1},
35822 {&__pyx_n_s____del__, __pyx_k____del__, sizeof(__pyx_k____del__), 0, 0, 1, 1},
35823 {&__pyx_n_s____dict__, __pyx_k____dict__, sizeof(__pyx_k____dict__), 0, 0, 1, 1},
35824 {&__pyx_n_s____getattribute__, __pyx_k____getattribute__, sizeof(__pyx_k____getattribute__), 0, 0, 1, 1},
35825 {&__pyx_n_s____init__, __pyx_k____init__, sizeof(__pyx_k____init__), 0, 0, 1, 1},
35826 {&__pyx_n_s____main__, __pyx_k____main__, sizeof(__pyx_k____main__), 0, 0, 1, 1},
35827 {&__pyx_n_s____next__, __pyx_k____next__, sizeof(__pyx_k____next__), 0, 0, 1, 1},
35828 {&__pyx_n_s____str__, __pyx_k____str__, sizeof(__pyx_k____str__), 0, 0, 1, 1},
35829 {&__pyx_n_s____test__, __pyx_k____test__, sizeof(__pyx_k____test__), 0, 0, 1, 1},
35830 {&__pyx_n_s___alignment, __pyx_k___alignment, sizeof(__pyx_k___alignment), 0, 0, 1, 1},
35831 {&__pyx_n_s___buildHeader, __pyx_k___buildHeader, sizeof(__pyx_k___buildHeader), 0, 0, 1, 1},
35832 {&__pyx_n_s___buildLine, __pyx_k___buildLine, sizeof(__pyx_k___buildLine), 0, 0, 1, 1},
35833 {&__pyx_n_s___call, __pyx_k___call, sizeof(__pyx_k___call), 0, 0, 1, 1},
35834 {&__pyx_n_s___consensus_quality, __pyx_k___consensus_quality, sizeof(__pyx_k___consensus_quality), 0, 0, 1, 1},
35835 {&__pyx_n_s___coverage, __pyx_k___coverage, sizeof(__pyx_k___coverage), 0, 0, 1, 1},
35836 {&__pyx_n_s___delegate, __pyx_k___delegate, sizeof(__pyx_k___delegate), 0, 0, 1, 1},
35837 {&__pyx_n_s___filename, __pyx_k___filename, sizeof(__pyx_k___filename), 0, 0, 1, 1},
35838 {&__pyx_n_s___genotype, __pyx_k___genotype, sizeof(__pyx_k___genotype), 0, 0, 1, 1},
35839 {&__pyx_n_s___hasIndex, __pyx_k___hasIndex, sizeof(__pyx_k___hasIndex), 0, 0, 1, 1},
35840 {&__pyx_n_s___indel, __pyx_k___indel, sizeof(__pyx_k___indel), 0, 0, 1, 1},
35841 {&__pyx_n_s___isOpen, __pyx_k___isOpen, sizeof(__pyx_k___isOpen), 0, 0, 1, 1},
35842 {&__pyx_n_s___is_del, __pyx_k___is_del, sizeof(__pyx_k___is_del), 0, 0, 1, 1},
35843 {&__pyx_n_s___is_head, __pyx_k___is_head, sizeof(__pyx_k___is_head), 0, 0, 1, 1},
35844 {&__pyx_n_s___is_tail, __pyx_k___is_tail, sizeof(__pyx_k___is_tail), 0, 0, 1, 1},
35845 {&__pyx_n_s___level, __pyx_k___level, sizeof(__pyx_k___level), 0, 0, 1, 1},
35846 {&__pyx_n_s___logfile, __pyx_k___logfile, sizeof(__pyx_k___logfile), 0, 0, 1, 1},
35847 {&__pyx_n_s___open, __pyx_k___open, sizeof(__pyx_k___open), 0, 0, 1, 1},
35848 {&__pyx_n_s___parseRegion, __pyx_k___parseRegion, sizeof(__pyx_k___parseRegion), 0, 0, 1, 1},
35849 {&__pyx_n_s___pos, __pyx_k___pos, sizeof(__pyx_k___pos), 0, 0, 1, 1},
35850 {&__pyx_n_s___qpos, __pyx_k___qpos, sizeof(__pyx_k___qpos), 0, 0, 1, 1},
35851 {&__pyx_n_s___r, __pyx_k___r, sizeof(__pyx_k___r), 0, 0, 1, 1},
35852 {&__pyx_n_s___reference_base, __pyx_k___reference_base, sizeof(__pyx_k___reference_base), 0, 0, 1, 1},
35853 {&__pyx_n_s___samtools_dispatch, __pyx_k___samtools_dispatch, sizeof(__pyx_k___samtools_dispatch), 0, 0, 1, 1},
35854 {&__pyx_n_s___snp_quality, __pyx_k___snp_quality, sizeof(__pyx_k___snp_quality), 0, 0, 1, 1},
35855 {&__pyx_n_s___tid, __pyx_k___tid, sizeof(__pyx_k___tid), 0, 0, 1, 1},
35856 {&__pyx_n_s__addReference, __pyx_k__addReference, sizeof(__pyx_k__addReference), 0, 0, 1, 1},
35857 {&__pyx_n_s__alignment, __pyx_k__alignment, sizeof(__pyx_k__alignment), 0, 0, 1, 1},
35858 {&__pyx_n_s__all, __pyx_k__all, sizeof(__pyx_k__all), 0, 0, 1, 1},
35859 {&__pyx_n_s__args, __pyx_k__args, sizeof(__pyx_k__args), 0, 0, 1, 1},
35860 {&__pyx_n_s__b, __pyx_k__b, sizeof(__pyx_k__b), 0, 0, 1, 1},
35861 {&__pyx_n_s__bam, __pyx_k__bam, sizeof(__pyx_k__bam), 0, 0, 1, 1},
35862 {&__pyx_n_s__beg, __pyx_k__beg, sizeof(__pyx_k__beg), 0, 0, 1, 1},
35863 {&__pyx_n_s__bin, __pyx_k__bin, sizeof(__pyx_k__bin), 0, 0, 1, 1},
35864 {&__pyx_n_s__bqual, __pyx_k__bqual, sizeof(__pyx_k__bqual), 0, 0, 1, 1},
35865 {&__pyx_n_s__build, __pyx_k__build, sizeof(__pyx_k__build), 0, 0, 1, 1},
35866 {&__pyx_n_s__c, __pyx_k__c, sizeof(__pyx_k__c), 0, 0, 1, 1},
35867 {&__pyx_n_s__calcsize, __pyx_k__calcsize, sizeof(__pyx_k__calcsize), 0, 0, 1, 1},
35868 {&__pyx_n_s__call, __pyx_k__call, sizeof(__pyx_k__call), 0, 0, 1, 1},
35869 {&__pyx_n_s__callback, __pyx_k__callback, sizeof(__pyx_k__callback), 0, 0, 1, 1},
35870 {&__pyx_n_s__cap_mapQ, __pyx_k__cap_mapQ, sizeof(__pyx_k__cap_mapQ), 0, 0, 1, 1},
35871 {&__pyx_n_s__catch_stderr, __pyx_k__catch_stderr, sizeof(__pyx_k__catch_stderr), 0, 0, 1, 1},
35872 {&__pyx_n_s__catch_stdout, __pyx_k__catch_stdout, sizeof(__pyx_k__catch_stdout), 0, 0, 1, 1},
35873 {&__pyx_n_s__chr, __pyx_k__chr, sizeof(__pyx_k__chr), 0, 0, 1, 1},
35874 {&__pyx_n_s__cigar, __pyx_k__cigar, sizeof(__pyx_k__cigar), 0, 0, 1, 1},
35875 {&__pyx_n_s__close, __pyx_k__close, sizeof(__pyx_k__close), 0, 0, 1, 1},
35876 {&__pyx_n_s__cmp, __pyx_k__cmp, sizeof(__pyx_k__cmp), 0, 0, 1, 1},
35877 {&__pyx_n_s__cnext, __pyx_k__cnext, sizeof(__pyx_k__cnext), 0, 0, 1, 1},
35878 {&__pyx_n_s__cnt1, __pyx_k__cnt1, sizeof(__pyx_k__cnt1), 0, 0, 1, 1},
35879 {&__pyx_n_s__cnt2, __pyx_k__cnt2, sizeof(__pyx_k__cnt2), 0, 0, 1, 1},
35880 {&__pyx_n_s__cnt_anti, __pyx_k__cnt_anti, sizeof(__pyx_k__cnt_anti), 0, 0, 1, 1},
35881 {&__pyx_n_s__collections, __pyx_k__collections, sizeof(__pyx_k__collections), 0, 0, 1, 1},
35882 {&__pyx_n_s__compare, __pyx_k__compare, sizeof(__pyx_k__compare), 0, 0, 1, 1},
35883 {&__pyx_n_s__consensus_quality, __pyx_k__consensus_quality, sizeof(__pyx_k__consensus_quality), 0, 0, 1, 1},
35884 {&__pyx_n_s__core, __pyx_k__core, sizeof(__pyx_k__core), 0, 0, 1, 1},
35885 {&__pyx_n_s__count, __pyx_k__count, sizeof(__pyx_k__count), 0, 0, 1, 1},
35886 {&__pyx_n_s__coverage, __pyx_k__coverage, sizeof(__pyx_k__coverage), 0, 0, 1, 1},
35887 {&__pyx_n_s__ctypes, __pyx_k__ctypes, sizeof(__pyx_k__ctypes), 0, 0, 1, 1},
35888 {&__pyx_n_s__current_pos, __pyx_k__current_pos, sizeof(__pyx_k__current_pos), 0, 0, 1, 1},
35889 {&__pyx_n_s__d, __pyx_k__d, sizeof(__pyx_k__d), 0, 0, 1, 1},
35890 {&__pyx_n_s__data, __pyx_k__data, sizeof(__pyx_k__data), 0, 0, 1, 1},
35891 {&__pyx_n_s__data_len, __pyx_k__data_len, sizeof(__pyx_k__data_len), 0, 0, 1, 1},
35892 {&__pyx_n_s__defaultdict, __pyx_k__defaultdict, sizeof(__pyx_k__defaultdict), 0, 0, 1, 1},
35893 {&__pyx_n_s__devnull, __pyx_k__devnull, sizeof(__pyx_k__devnull), 0, 0, 1, 1},
35894 {&__pyx_n_s__dup, __pyx_k__dup, sizeof(__pyx_k__dup), 0, 0, 1, 1},
35895 {&__pyx_n_s__dup2, __pyx_k__dup2, sizeof(__pyx_k__dup2), 0, 0, 1, 1},
35896 {&__pyx_n_s__end, __pyx_k__end, sizeof(__pyx_k__end), 0, 0, 1, 1},
35897 {&__pyx_n_s__errmod, __pyx_k__errmod, sizeof(__pyx_k__errmod), 0, 0, 1, 1},
35898 {&__pyx_n_s__exc_type, __pyx_k__exc_type, sizeof(__pyx_k__exc_type), 0, 0, 1, 1},
35899 {&__pyx_n_s__exc_value, __pyx_k__exc_value, sizeof(__pyx_k__exc_value), 0, 0, 1, 1},
35900 {&__pyx_n_s__exists, __pyx_k__exists, sizeof(__pyx_k__exists), 0, 0, 1, 1},
35901 {&__pyx_n_s__f, __pyx_k__f, sizeof(__pyx_k__f), 0, 0, 1, 1},
35902 {&__pyx_n_s__fancy_str, __pyx_k__fancy_str, sizeof(__pyx_k__fancy_str), 0, 0, 1, 1},
35903 {&__pyx_n_s__fastafile, __pyx_k__fastafile, sizeof(__pyx_k__fastafile), 0, 0, 1, 1},
35904 {&__pyx_n_s__fd, __pyx_k__fd, sizeof(__pyx_k__fd), 0, 0, 1, 1},
35905 {&__pyx_n_s__fetch, __pyx_k__fetch, sizeof(__pyx_k__fetch), 0, 0, 1, 1},
35906 {&__pyx_n_s__fields, __pyx_k__fields, sizeof(__pyx_k__fields), 0, 0, 1, 1},
35907 {&__pyx_n_s__filename, __pyx_k__filename, sizeof(__pyx_k__filename), 0, 0, 1, 1},
35908 {&__pyx_n_s__fileno, __pyx_k__fileno, sizeof(__pyx_k__fileno), 0, 0, 1, 1},
35909 {&__pyx_n_s__first_allele, __pyx_k__first_allele, sizeof(__pyx_k__first_allele), 0, 0, 1, 1},
35910 {&__pyx_n_s__flag, __pyx_k__flag, sizeof(__pyx_k__flag), 0, 0, 1, 1},
35911 {&__pyx_n_s__flush, __pyx_k__flush, sizeof(__pyx_k__flush), 0, 0, 1, 1},
35912 {&__pyx_n_s__fp, __pyx_k__fp, sizeof(__pyx_k__fp), 0, 0, 1, 1},
35913 {&__pyx_n_s__genotype, __pyx_k__genotype, sizeof(__pyx_k__genotype), 0, 0, 1, 1},
35914 {&__pyx_n_s__getSequence, __pyx_k__getSequence, sizeof(__pyx_k__getSequence), 0, 0, 1, 1},
35915 {&__pyx_n_s__getrname, __pyx_k__getrname, sizeof(__pyx_k__getrname), 0, 0, 1, 1},
35916 {&__pyx_n_s__gettid, __pyx_k__gettid, sizeof(__pyx_k__gettid), 0, 0, 1, 1},
35917 {&__pyx_n_s__hasReference, __pyx_k__hasReference, sizeof(__pyx_k__hasReference), 0, 0, 1, 1},
35918 {&__pyx_n_s__hash, __pyx_k__hash, sizeof(__pyx_k__hash), 0, 0, 1, 1},
35919 {&__pyx_n_s__header, __pyx_k__header, sizeof(__pyx_k__header), 0, 0, 1, 1},
35920 {&__pyx_n_s__het_rate, __pyx_k__het_rate, sizeof(__pyx_k__het_rate), 0, 0, 1, 1},
35921 {&__pyx_n_s__i, __pyx_k__i, sizeof(__pyx_k__i), 0, 0, 1, 1},
35922 {&__pyx_n_s__id, __pyx_k__id, sizeof(__pyx_k__id), 0, 0, 1, 1},
35923 {&__pyx_n_s__indel, __pyx_k__indel, sizeof(__pyx_k__indel), 0, 0, 1, 1},
35924 {&__pyx_n_s__indel1, __pyx_k__indel1, sizeof(__pyx_k__indel1), 0, 0, 1, 1},
35925 {&__pyx_n_s__indel2, __pyx_k__indel2, sizeof(__pyx_k__indel2), 0, 0, 1, 1},
35926 {&__pyx_n_s__index, __pyx_k__index, sizeof(__pyx_k__index), 0, 0, 1, 1},
35927 {&__pyx_n_s__is_del, __pyx_k__is_del, sizeof(__pyx_k__is_del), 0, 0, 1, 1},
35928 {&__pyx_n_s__is_head, __pyx_k__is_head, sizeof(__pyx_k__is_head), 0, 0, 1, 1},
35929 {&__pyx_n_s__is_tail, __pyx_k__is_tail, sizeof(__pyx_k__is_tail), 0, 0, 1, 1},
35930 {&__pyx_n_s__isbam, __pyx_k__isbam, sizeof(__pyx_k__isbam), 0, 0, 1, 1},
35931 {&__pyx_n_s__isize, __pyx_k__isize, sizeof(__pyx_k__isize), 0, 0, 1, 1},
35932 {&__pyx_n_s__isremote, __pyx_k__isremote, sizeof(__pyx_k__isremote), 0, 0, 1, 1},
35933 {&__pyx_n_s__isupper, __pyx_k__isupper, sizeof(__pyx_k__isupper), 0, 0, 1, 1},
35934 {&__pyx_n_s__iter, __pyx_k__iter, sizeof(__pyx_k__iter), 0, 0, 1, 1},
35935 {&__pyx_n_s__iterator_column, __pyx_k__iterator_column, sizeof(__pyx_k__iterator_column), 0, 0, 1, 1},
35936 {&__pyx_n_s__iterdata, __pyx_k__iterdata, sizeof(__pyx_k__iterdata), 0, 0, 1, 1},
35937 {&__pyx_n_s__itertools, __pyx_k__itertools, sizeof(__pyx_k__itertools), 0, 0, 1, 1},
35938 {&__pyx_n_s__join, __pyx_k__join, sizeof(__pyx_k__join), 0, 0, 1, 1},
35939 {&__pyx_n_s__l_aux, __pyx_k__l_aux, sizeof(__pyx_k__l_aux), 0, 0, 1, 1},
35940 {&__pyx_n_s__l_qname, __pyx_k__l_qname, sizeof(__pyx_k__l_qname), 0, 0, 1, 1},
35941 {&__pyx_n_s__l_qseq, __pyx_k__l_qseq, sizeof(__pyx_k__l_qseq), 0, 0, 1, 1},
35942 {&__pyx_n_s__l_text, __pyx_k__l_text, sizeof(__pyx_k__l_text), 0, 0, 1, 1},
35943 {&__pyx_n_s__level, __pyx_k__level, sizeof(__pyx_k__level), 0, 0, 1, 1},
35944 {&__pyx_n_s__m_data, __pyx_k__m_data, sizeof(__pyx_k__m_data), 0, 0, 1, 1},
35945 {&__pyx_n_s__map, __pyx_k__map, sizeof(__pyx_k__map), 0, 0, 1, 1},
35946 {&__pyx_n_s__mapping_quality, __pyx_k__mapping_quality, sizeof(__pyx_k__mapping_quality), 0, 0, 1, 1},
35947 {&__pyx_n_s__mapq, __pyx_k__mapq, sizeof(__pyx_k__mapq), 0, 0, 1, 1},
35948 {&__pyx_n_s__mask, __pyx_k__mask, sizeof(__pyx_k__mask), 0, 0, 1, 1},
35949 {&__pyx_n_s__mate, __pyx_k__mate, sizeof(__pyx_k__mate), 0, 0, 1, 1},
35950 {&__pyx_n_s__max_depth, __pyx_k__max_depth, sizeof(__pyx_k__max_depth), 0, 0, 1, 1},
35951 {&__pyx_n_s__method, __pyx_k__method, sizeof(__pyx_k__method), 0, 0, 1, 1},
35952 {&__pyx_n_s__min_baseQ, __pyx_k__min_baseQ, sizeof(__pyx_k__min_baseQ), 0, 0, 1, 1},
35953 {&__pyx_n_s__mkstemp, __pyx_k__mkstemp, sizeof(__pyx_k__mkstemp), 0, 0, 1, 1},
35954 {&__pyx_n_s__mode, __pyx_k__mode, sizeof(__pyx_k__mode), 0, 0, 1, 1},
35955 {&__pyx_n_s__mpos, __pyx_k__mpos, sizeof(__pyx_k__mpos), 0, 0, 1, 1},
35956 {&__pyx_n_s__mrnm, __pyx_k__mrnm, sizeof(__pyx_k__mrnm), 0, 0, 1, 1},
35957 {&__pyx_n_s__mtid, __pyx_k__mtid, sizeof(__pyx_k__mtid), 0, 0, 1, 1},
35958 {&__pyx_n_s__n, __pyx_k__n, sizeof(__pyx_k__n), 0, 0, 1, 1},
35959 {&__pyx_n_s__n_cigar, __pyx_k__n_cigar, sizeof(__pyx_k__n_cigar), 0, 0, 1, 1},
35960 {&__pyx_n_s__n_hap, __pyx_k__n_hap, sizeof(__pyx_k__n_hap), 0, 0, 1, 1},
35961 {&__pyx_n_s__n_haplotypes, __pyx_k__n_haplotypes, sizeof(__pyx_k__n_haplotypes), 0, 0, 1, 1},
35962 {&__pyx_n_s__n_plp, __pyx_k__n_plp, sizeof(__pyx_k__n_plp), 0, 0, 1, 1},
35963 {&__pyx_n_s__n_pu, __pyx_k__n_pu, sizeof(__pyx_k__n_pu), 0, 0, 1, 1},
35964 {&__pyx_n_s__n_targets, __pyx_k__n_targets, sizeof(__pyx_k__n_targets), 0, 0, 1, 1},
35965 {&__pyx_n_s__name, __pyx_k__name, sizeof(__pyx_k__name), 0, 0, 1, 1},
35966 {&__pyx_n_s__nextiter, __pyx_k__nextiter, sizeof(__pyx_k__nextiter), 0, 0, 1, 1},
35967 {&__pyx_n_s__nreferences, __pyx_k__nreferences, sizeof(__pyx_k__nreferences), 0, 0, 1, 1},
35968 {&__pyx_n_s__object, __pyx_k__object, sizeof(__pyx_k__object), 0, 0, 1, 1},
35969 {&__pyx_n_s__offset, __pyx_k__offset, sizeof(__pyx_k__offset), 0, 0, 1, 1},
35970 {&__pyx_n_s__open, __pyx_k__open, sizeof(__pyx_k__open), 0, 0, 1, 1},
35971 {&__pyx_n_s__opt, __pyx_k__opt, sizeof(__pyx_k__opt), 0, 0, 1, 1},
35972 {&__pyx_n_s__options, __pyx_k__options, sizeof(__pyx_k__options), 0, 0, 1, 1},
35973 {&__pyx_n_s__os, __pyx_k__os, sizeof(__pyx_k__os), 0, 0, 1, 1},
35974 {&__pyx_n_s__overlap, __pyx_k__overlap, sizeof(__pyx_k__overlap), 0, 0, 1, 1},
35975 {&__pyx_n_s__owns_samfile, __pyx_k__owns_samfile, sizeof(__pyx_k__owns_samfile), 0, 0, 1, 1},
35976 {&__pyx_n_s__pack_into, __pyx_k__pack_into, sizeof(__pyx_k__pack_into), 0, 0, 1, 1},
35977 {&__pyx_n_s__path, __pyx_k__path, sizeof(__pyx_k__path), 0, 0, 1, 1},
35978 {&__pyx_n_s__pileup, __pyx_k__pileup, sizeof(__pyx_k__pileup), 0, 0, 1, 1},
35979 {&__pyx_n_s__pileup_iter, __pyx_k__pileup_iter, sizeof(__pyx_k__pileup_iter), 0, 0, 1, 1},
35980 {&__pyx_n_s__pileups, __pyx_k__pileups, sizeof(__pyx_k__pileups), 0, 0, 1, 1},
35981 {&__pyx_n_s__platform, __pyx_k__platform, sizeof(__pyx_k__platform), 0, 0, 1, 1},
35982 {&__pyx_n_s__plp, __pyx_k__plp, sizeof(__pyx_k__plp), 0, 0, 1, 1},
35983 {&__pyx_n_s__port, __pyx_k__port, sizeof(__pyx_k__port), 0, 0, 1, 1},
35984 {&__pyx_n_s__pos, __pyx_k__pos, sizeof(__pyx_k__pos), 0, 0, 1, 1},
35985 {&__pyx_n_s__positions, __pyx_k__positions, sizeof(__pyx_k__positions), 0, 0, 1, 1},
35986 {&__pyx_n_s__q_cns, __pyx_k__q_cns, sizeof(__pyx_k__q_cns), 0, 0, 1, 1},
35987 {&__pyx_n_s__q_indel, __pyx_k__q_indel, sizeof(__pyx_k__q_indel), 0, 0, 1, 1},
35988 {&__pyx_n_s__q_r, __pyx_k__q_r, sizeof(__pyx_k__q_r), 0, 0, 1, 1},
35989 {&__pyx_n_s__q_ref, __pyx_k__q_ref, sizeof(__pyx_k__q_ref), 0, 0, 1, 1},
35990 {&__pyx_n_s__qname, __pyx_k__qname, sizeof(__pyx_k__qname), 0, 0, 1, 1},
35991 {&__pyx_n_s__qpos, __pyx_k__qpos, sizeof(__pyx_k__qpos), 0, 0, 1, 1},
35992 {&__pyx_n_s__qseq, __pyx_k__qseq, sizeof(__pyx_k__qseq), 0, 0, 1, 1},
35993 {&__pyx_n_s__qual, __pyx_k__qual, sizeof(__pyx_k__qual), 0, 0, 1, 1},
35994 {&__pyx_n_s__r, __pyx_k__r, sizeof(__pyx_k__r), 0, 0, 1, 1},
35995 {&__pyx_n_s__r_indel, __pyx_k__r_indel, sizeof(__pyx_k__r_indel), 0, 0, 1, 1},
35996 {&__pyx_n_s__range, __pyx_k__range, sizeof(__pyx_k__range), 0, 0, 1, 1},
35997 {&__pyx_n_s__raw, __pyx_k__raw, sizeof(__pyx_k__raw), 0, 0, 1, 1},
35998 {&__pyx_n_s__rb, __pyx_k__rb, sizeof(__pyx_k__rb), 0, 0, 1, 1},
35999 {&__pyx_n_s__re, __pyx_k__re, sizeof(__pyx_k__re), 0, 0, 1, 1},
36000 {&__pyx_n_s__readAndRelease, __pyx_k__readAndRelease, sizeof(__pyx_k__readAndRelease), 0, 0, 1, 1},
36001 {&__pyx_n_s__readlines, __pyx_k__readlines, sizeof(__pyx_k__readlines), 0, 0, 1, 1},
36002 {&__pyx_n_s__reads_diff, __pyx_k__reads_diff, sizeof(__pyx_k__reads_diff), 0, 0, 1, 1},
36003 {&__pyx_n_s__reads_first, __pyx_k__reads_first, sizeof(__pyx_k__reads_first), 0, 0, 1, 1},
36004 {&__pyx_n_s__reads_second, __pyx_k__reads_second, sizeof(__pyx_k__reads_second), 0, 0, 1, 1},
36005 {&__pyx_n_s__record, __pyx_k__record, sizeof(__pyx_k__record), 0, 0, 1, 1},
36006 {&__pyx_n_s__reference, __pyx_k__reference, sizeof(__pyx_k__reference), 0, 0, 1, 1},
36007 {&__pyx_n_s__reference_base, __pyx_k__reference_base, sizeof(__pyx_k__reference_base), 0, 0, 1, 1},
36008 {&__pyx_n_s__referencelengths, __pyx_k__referencelengths, sizeof(__pyx_k__referencelengths), 0, 0, 1, 1},
36009 {&__pyx_n_s__referencenames, __pyx_k__referencenames, sizeof(__pyx_k__referencenames), 0, 0, 1, 1},
36010 {&__pyx_n_s__region, __pyx_k__region, sizeof(__pyx_k__region), 0, 0, 1, 1},
36011 {&__pyx_n_s__release, __pyx_k__release, sizeof(__pyx_k__release), 0, 0, 1, 1},
36012 {&__pyx_n_s__remove, __pyx_k__remove, sizeof(__pyx_k__remove), 0, 0, 1, 1},
36013 {&__pyx_n_s__reopen, __pyx_k__reopen, sizeof(__pyx_k__reopen), 0, 0, 1, 1},
36014 {&__pyx_n_s__reset, __pyx_k__reset, sizeof(__pyx_k__reset), 0, 0, 1, 1},
36015 {&__pyx_n_s__restore, __pyx_k__restore, sizeof(__pyx_k__restore), 0, 0, 1, 1},
36016 {&__pyx_n_s__retval, __pyx_k__retval, sizeof(__pyx_k__retval), 0, 0, 1, 1},
36017 {&__pyx_n_s__rg2lib, __pyx_k__rg2lib, sizeof(__pyx_k__rg2lib), 0, 0, 1, 1},
36018 {&__pyx_n_s__rlen, __pyx_k__rlen, sizeof(__pyx_k__rlen), 0, 0, 1, 1},
36019 {&__pyx_n_s__rname, __pyx_k__rname, sizeof(__pyx_k__rname), 0, 0, 1, 1},
36020 {&__pyx_n_s__rowiter, __pyx_k__rowiter, sizeof(__pyx_k__rowiter), 0, 0, 1, 1},
36021 {&__pyx_n_s__s, __pyx_k__s, sizeof(__pyx_k__s), 0, 0, 1, 1},
36022 {&__pyx_n_s__samfile, __pyx_k__samfile, sizeof(__pyx_k__samfile), 0, 0, 1, 1},
36023 {&__pyx_n_s__samtools, __pyx_k__samtools, sizeof(__pyx_k__samtools), 0, 0, 1, 1},
36024 {&__pyx_n_s__second_allele, __pyx_k__second_allele, sizeof(__pyx_k__second_allele), 0, 0, 1, 1},
36025 {&__pyx_n_s__seek, __pyx_k__seek, sizeof(__pyx_k__seek), 0, 0, 1, 1},
36026 {&__pyx_n_s__self, __pyx_k__self, sizeof(__pyx_k__self), 0, 0, 1, 1},
36027 {&__pyx_n_s__seq, __pyx_k__seq, sizeof(__pyx_k__seq), 0, 0, 1, 1},
36028 {&__pyx_n_s__seq_len, __pyx_k__seq_len, sizeof(__pyx_k__seq_len), 0, 0, 1, 1},
36029 {&__pyx_n_s__setdevice, __pyx_k__setdevice, sizeof(__pyx_k__setdevice), 0, 0, 1, 1},
36030 {&__pyx_n_s__setfd, __pyx_k__setfd, sizeof(__pyx_k__setfd), 0, 0, 1, 1},
36031 {&__pyx_n_s__setfile, __pyx_k__setfile, sizeof(__pyx_k__setfile), 0, 0, 1, 1},
36032 {&__pyx_n_s__setupIteratorData, __pyx_k__setupIteratorData, sizeof(__pyx_k__setupIteratorData), 0, 0, 1, 1},
36033 {&__pyx_n_s__snp_quality, __pyx_k__snp_quality, sizeof(__pyx_k__snp_quality), 0, 0, 1, 1},
36034 {&__pyx_n_s__split, __pyx_k__split, sizeof(__pyx_k__split), 0, 0, 1, 1},
36035 {&__pyx_n_s__start, __pyx_k__start, sizeof(__pyx_k__start), 0, 0, 1, 1},
36036 {&__pyx_n_s__startswith, __pyx_k__startswith, sizeof(__pyx_k__startswith), 0, 0, 1, 1},
36037 {&__pyx_n_s__stderr, __pyx_k__stderr, sizeof(__pyx_k__stderr), 0, 0, 1, 1},
36038 {&__pyx_n_s__stderr_f, __pyx_k__stderr_f, sizeof(__pyx_k__stderr_f), 0, 0, 1, 1},
36039 {&__pyx_n_s__stderr_h, __pyx_k__stderr_h, sizeof(__pyx_k__stderr_h), 0, 0, 1, 1},
36040 {&__pyx_n_s__stderr_save, __pyx_k__stderr_save, sizeof(__pyx_k__stderr_save), 0, 0, 1, 1},
36041 {&__pyx_n_s__stdout, __pyx_k__stdout, sizeof(__pyx_k__stdout), 0, 0, 1, 1},
36042 {&__pyx_n_s__stepper, __pyx_k__stepper, sizeof(__pyx_k__stepper), 0, 0, 1, 1},
36043 {&__pyx_n_s__streams, __pyx_k__streams, sizeof(__pyx_k__streams), 0, 0, 1, 1},
36044 {&__pyx_n_s__strip, __pyx_k__strip, sizeof(__pyx_k__strip), 0, 0, 1, 1},
36045 {&__pyx_n_s__struct, __pyx_k__struct, sizeof(__pyx_k__struct), 0, 0, 1, 1},
36046 {&__pyx_n_s__sys, __pyx_k__sys, sizeof(__pyx_k__sys), 0, 0, 1, 1},
36047 {&__pyx_n_s__system, __pyx_k__system, sizeof(__pyx_k__system), 0, 0, 1, 1},
36048 {&__pyx_n_s__tags, __pyx_k__tags, sizeof(__pyx_k__tags), 0, 0, 1, 1},
36049 {&__pyx_n_s__target_len, __pyx_k__target_len, sizeof(__pyx_k__target_len), 0, 0, 1, 1},
36050 {&__pyx_n_s__target_name, __pyx_k__target_name, sizeof(__pyx_k__target_name), 0, 0, 1, 1},
36051 {&__pyx_n_s__tell, __pyx_k__tell, sizeof(__pyx_k__tell), 0, 0, 1, 1},
36052 {&__pyx_n_s__tempfile, __pyx_k__tempfile, sizeof(__pyx_k__tempfile), 0, 0, 1, 1},
36053 {&__pyx_n_s__template, __pyx_k__template, sizeof(__pyx_k__template), 0, 0, 1, 1},
36054 {&__pyx_n_s__text, __pyx_k__text, sizeof(__pyx_k__text), 0, 0, 1, 1},
36055 {&__pyx_n_s__theta, __pyx_k__theta, sizeof(__pyx_k__theta), 0, 0, 1, 1},
36056 {&__pyx_n_s__tid, __pyx_k__tid, sizeof(__pyx_k__tid), 0, 0, 1, 1},
36057 {&__pyx_n_s__traceback, __pyx_k__traceback, sizeof(__pyx_k__traceback), 0, 0, 1, 1},
36058 {&__pyx_n_s__types, __pyx_k__types, sizeof(__pyx_k__types), 0, 0, 1, 1},
36059 {&__pyx_n_s__until_eof, __pyx_k__until_eof, sizeof(__pyx_k__until_eof), 0, 0, 1, 1},
36060 {&__pyx_n_s__view, __pyx_k__view, sizeof(__pyx_k__view), 0, 0, 1, 1},
36061 {&__pyx_n_s__w, __pyx_k__w, sizeof(__pyx_k__w), 0, 0, 1, 1},
36062 {&__pyx_n_s__wb, __pyx_k__wb, sizeof(__pyx_k__wb), 0, 0, 1, 1},
36063 {&__pyx_n_s__wbu, __pyx_k__wbu, sizeof(__pyx_k__wbu), 0, 0, 1, 1},
36064 {&__pyx_n_s__wh, __pyx_k__wh, sizeof(__pyx_k__wh), 0, 0, 1, 1},
36065 {&__pyx_n_s__where, __pyx_k__where, sizeof(__pyx_k__where), 0, 0, 1, 1},
36066 {&__pyx_n_s__write, __pyx_k__write, sizeof(__pyx_k__write), 0, 0, 1, 1},
36067 {&__pyx_n_s__x, __pyx_k__x, sizeof(__pyx_k__x), 0, 0, 1, 1},
36068 {0, 0, 0, 0, 0, 0, 0}
36070 static int __Pyx_InitCachedBuiltins(void) {
36071 __pyx_builtin_open = __Pyx_GetName(__pyx_b, __pyx_n_s__open); if (!__pyx_builtin_open) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36072 __pyx_builtin_object = __Pyx_GetName(__pyx_b, __pyx_n_s__object); if (!__pyx_builtin_object) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36073 __pyx_builtin_map = __Pyx_GetName(__pyx_b, __pyx_n_s__map); if (!__pyx_builtin_map) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36074 __pyx_builtin_ValueError = __Pyx_GetName(__pyx_b, __pyx_n_s__ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36075 __pyx_builtin_IOError = __Pyx_GetName(__pyx_b, __pyx_n_s__IOError); if (!__pyx_builtin_IOError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36076 __pyx_builtin_OverflowError = __Pyx_GetName(__pyx_b, __pyx_n_s__OverflowError); if (!__pyx_builtin_OverflowError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 666; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36077 __pyx_builtin_NotImplementedError = __Pyx_GetName(__pyx_b, __pyx_n_s__NotImplementedError); if (!__pyx_builtin_NotImplementedError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 699; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36078 __pyx_builtin_KeyError = __Pyx_GetName(__pyx_b, __pyx_n_s__KeyError); if (!__pyx_builtin_KeyError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36079 __pyx_builtin_StopIteration = __Pyx_GetName(__pyx_b, __pyx_n_s__StopIteration); if (!__pyx_builtin_StopIteration) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36080 __pyx_builtin_cmp = __Pyx_GetName(__pyx_b, __pyx_n_s__cmp); if (!__pyx_builtin_cmp) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1953; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36081 __pyx_builtin_chr = __Pyx_GetName(__pyx_b, __pyx_n_s__chr); if (!__pyx_builtin_chr) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2547; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36082 __pyx_builtin_TypeError = __Pyx_GetName(__pyx_b, __pyx_n_s__TypeError); if (!__pyx_builtin_TypeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2624; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36083 __pyx_builtin_range = __Pyx_GetName(__pyx_b, __pyx_n_s__range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2924; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36089 static int __Pyx_InitGlobals(void) {
36090 if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
36091 __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;};
36092 __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;};
36093 __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;};
36094 __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;};
36095 __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;};
36096 __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;};
36097 __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;};
36098 __pyx_int_32 = PyInt_FromLong(32); if (unlikely(!__pyx_int_32)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
36099 __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;};
36100 __pyx_int_60 = PyInt_FromLong(60); if (unlikely(!__pyx_int_60)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
36101 __pyx_int_64 = PyInt_FromLong(64); if (unlikely(!__pyx_int_64)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
36102 __pyx_int_128 = PyInt_FromLong(128); if (unlikely(!__pyx_int_128)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
36103 __pyx_int_255 = PyInt_FromLong(255); if (unlikely(!__pyx_int_255)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
36104 __pyx_int_256 = PyInt_FromLong(256); if (unlikely(!__pyx_int_256)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
36105 __pyx_int_512 = PyInt_FromLong(512); if (unlikely(!__pyx_int_512)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
36106 __pyx_int_neg_127 = PyInt_FromLong(-127); if (unlikely(!__pyx_int_neg_127)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
36107 __pyx_int_0660 = PyInt_FromLong(0660); if (unlikely(!__pyx_int_0660)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
36108 __pyx_int_1024 = PyInt_FromLong(1024); if (unlikely(!__pyx_int_1024)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
36109 __pyx_int_65535 = PyInt_FromLong(65535); if (unlikely(!__pyx_int_65535)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
36110 __pyx_int_neg_32767 = PyInt_FromLong(-32767); if (unlikely(!__pyx_int_neg_32767)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
36111 __pyx_int_536870912 = PyInt_FromLong(536870912); if (unlikely(!__pyx_int_536870912)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
36112 __pyx_int_4294967295 = PyInt_FromString((char *)"4294967295", 0, 0); if (unlikely(!__pyx_int_4294967295)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
36113 __pyx_int_neg_2147483648 = PyInt_FromLong(-2147483648); if (unlikely(!__pyx_int_neg_2147483648)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
36119 #if PY_MAJOR_VERSION < 3
36120 PyMODINIT_FUNC initcsamtools(void); /*proto*/
36121 PyMODINIT_FUNC initcsamtools(void)
36123 PyMODINIT_FUNC PyInit_csamtools(void); /*proto*/
36124 PyMODINIT_FUNC PyInit_csamtools(void)
36127 PyObject *__pyx_t_1 = NULL;
36128 PyObject *__pyx_t_2 = NULL;
36129 PyObject *__pyx_t_3 = NULL;
36130 PyObject *__pyx_t_4 = NULL;
36132 #if CYTHON_REFNANNY
36133 void* __pyx_refnanny = NULL;
36134 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
36135 if (!__Pyx_RefNanny) {
36137 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
36138 if (!__Pyx_RefNanny)
36139 Py_FatalError("failed to import 'refnanny' module");
36141 __pyx_refnanny = __Pyx_RefNanny->SetupContext("PyMODINIT_FUNC PyInit_csamtools(void)", __LINE__, __FILE__);
36143 __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;}
36144 __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;}
36145 #ifdef __pyx_binding_PyCFunctionType_USED
36146 if (__pyx_binding_PyCFunctionType_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36148 /*--- Library function declarations ---*/
36149 /*--- Threads initialization code ---*/
36150 #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
36151 #ifdef WITH_THREAD /* Python build with threading support? */
36152 PyEval_InitThreads();
36155 /*--- Module creation code ---*/
36156 #if PY_MAJOR_VERSION < 3
36157 __pyx_m = Py_InitModule4(__Pyx_NAMESTR("csamtools"), __pyx_methods, 0, 0, PYTHON_API_VERSION);
36159 __pyx_m = PyModule_Create(&__pyx_moduledef);
36161 if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
36162 #if PY_MAJOR_VERSION < 3
36163 Py_INCREF(__pyx_m);
36165 __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME));
36166 if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
36167 if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
36168 /*--- Initialize various global constants etc. ---*/
36169 if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36170 if (__pyx_module_is_main_csamtools) {
36171 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;};
36173 /*--- Builtin init code ---*/
36174 if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36175 /*--- Global init code ---*/
36176 /*--- Function export code ---*/
36177 /*--- Type init code ---*/
36178 __pyx_ptype_9csamtools_file = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "file", sizeof(PyFileObject), 0); if (unlikely(!__pyx_ptype_9csamtools_file)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36179 if (PyType_Ready(&__pyx_type_9csamtools_AlignedRead) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1867; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36181 PyObject *wrapper = __Pyx_GetAttrString((PyObject *)&__pyx_type_9csamtools_AlignedRead, "__str__"); if (unlikely(!wrapper)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1867; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36182 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
36183 __pyx_wrapperbase_9csamtools_11AlignedRead___str__ = *((PyWrapperDescrObject *)wrapper)->d_base;
36184 __pyx_wrapperbase_9csamtools_11AlignedRead___str__.doc = __pyx_doc_9csamtools_11AlignedRead___str__;
36185 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_9csamtools_11AlignedRead___str__;
36188 if (__Pyx_SetAttrString(__pyx_m, "AlignedRead", (PyObject *)&__pyx_type_9csamtools_AlignedRead) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1867; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36189 __pyx_ptype_9csamtools_AlignedRead = &__pyx_type_9csamtools_AlignedRead;
36190 __pyx_vtabptr_9csamtools_Samfile = &__pyx_vtable_9csamtools_Samfile;
36191 #if PY_MAJOR_VERSION >= 3
36192 __pyx_vtable_9csamtools_Samfile._buildHeader = (bam_header_t *(*)(struct __pyx_obj_9csamtools_Samfile *, PyObject *))__pyx_f_9csamtools_7Samfile__buildHeader;
36193 __pyx_vtable_9csamtools_Samfile.getCurrent = (bam1_t *(*)(struct __pyx_obj_9csamtools_Samfile *))__pyx_f_9csamtools_7Samfile_getCurrent;
36194 __pyx_vtable_9csamtools_Samfile.cnext = (int (*)(struct __pyx_obj_9csamtools_Samfile *))__pyx_f_9csamtools_7Samfile_cnext;
36195 __pyx_vtable_9csamtools_Samfile.write = (int (*)(struct __pyx_obj_9csamtools_Samfile *, struct __pyx_obj_9csamtools_AlignedRead *, int __pyx_skip_dispatch))__pyx_f_9csamtools_7Samfile_write;
36196 __pyx_vtable_9csamtools_Samfile._getrname = (char *(*)(struct __pyx_obj_9csamtools_Samfile *, int))__pyx_f_9csamtools_7Samfile__getrname;
36198 *(void(**)(void))&__pyx_vtable_9csamtools_Samfile._buildHeader = (void(*)(void))__pyx_f_9csamtools_7Samfile__buildHeader;
36199 *(void(**)(void))&__pyx_vtable_9csamtools_Samfile.getCurrent = (void(*)(void))__pyx_f_9csamtools_7Samfile_getCurrent;
36200 *(void(**)(void))&__pyx_vtable_9csamtools_Samfile.cnext = (void(*)(void))__pyx_f_9csamtools_7Samfile_cnext;
36201 *(void(**)(void))&__pyx_vtable_9csamtools_Samfile.write = (void(*)(void))__pyx_f_9csamtools_7Samfile_write;
36202 *(void(**)(void))&__pyx_vtable_9csamtools_Samfile._getrname = (void(*)(void))__pyx_f_9csamtools_7Samfile__getrname;
36204 if (PyType_Ready(&__pyx_type_9csamtools_Samfile) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36206 PyObject *wrapper = __Pyx_GetAttrString((PyObject *)&__pyx_type_9csamtools_Samfile, "__next__"); if (unlikely(!wrapper)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36207 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
36208 __pyx_wrapperbase_9csamtools_7Samfile___next__ = *((PyWrapperDescrObject *)wrapper)->d_base;
36209 __pyx_wrapperbase_9csamtools_7Samfile___next__.doc = __pyx_doc_9csamtools_7Samfile___next__;
36210 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_9csamtools_7Samfile___next__;
36213 if (__Pyx_SetVtable(__pyx_type_9csamtools_Samfile.tp_dict, __pyx_vtabptr_9csamtools_Samfile) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36214 if (__Pyx_SetAttrString(__pyx_m, "Samfile", (PyObject *)&__pyx_type_9csamtools_Samfile) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36215 __pyx_ptype_9csamtools_Samfile = &__pyx_type_9csamtools_Samfile;
36216 if (PyType_Ready(&__pyx_type_9csamtools_PileupProxy) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2601; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36217 if (__Pyx_SetAttrString(__pyx_m, "PileupProxy", (PyObject *)&__pyx_type_9csamtools_PileupProxy) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2601; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36218 __pyx_ptype_9csamtools_PileupProxy = &__pyx_type_9csamtools_PileupProxy;
36219 if (PyType_Ready(&__pyx_type_9csamtools_PileupRead) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2654; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36220 if (__Pyx_SetAttrString(__pyx_m, "PileupRead", (PyObject *)&__pyx_type_9csamtools_PileupRead) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2654; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36221 __pyx_ptype_9csamtools_PileupRead = &__pyx_type_9csamtools_PileupRead;
36222 __pyx_vtabptr_9csamtools_Fastafile = &__pyx_vtable_9csamtools_Fastafile;
36223 #if PY_MAJOR_VERSION >= 3
36224 __pyx_vtable_9csamtools_Fastafile._fetch = (char *(*)(struct __pyx_obj_9csamtools_Fastafile *, char *, int, int, int *))__pyx_f_9csamtools_9Fastafile__fetch;
36226 *(void(**)(void))&__pyx_vtable_9csamtools_Fastafile._fetch = (void(*)(void))__pyx_f_9csamtools_9Fastafile__fetch;
36228 if (PyType_Ready(&__pyx_type_9csamtools_Fastafile) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36229 if (__Pyx_SetVtable(__pyx_type_9csamtools_Fastafile.tp_dict, __pyx_vtabptr_9csamtools_Fastafile) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36230 if (__Pyx_SetAttrString(__pyx_m, "Fastafile", (PyObject *)&__pyx_type_9csamtools_Fastafile) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36231 __pyx_ptype_9csamtools_Fastafile = &__pyx_type_9csamtools_Fastafile;
36232 if (PyType_Ready(&__pyx_type_9csamtools_IteratorRow) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36233 if (__Pyx_SetAttrString(__pyx_m, "IteratorRow", (PyObject *)&__pyx_type_9csamtools_IteratorRow) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36234 __pyx_ptype_9csamtools_IteratorRow = &__pyx_type_9csamtools_IteratorRow;
36235 __pyx_vtabptr_9csamtools_IteratorRowRegion = &__pyx_vtable_9csamtools_IteratorRowRegion;
36236 #if PY_MAJOR_VERSION >= 3
36237 __pyx_vtable_9csamtools_IteratorRowRegion.getCurrent = (bam1_t *(*)(struct __pyx_obj_9csamtools_IteratorRowRegion *))__pyx_f_9csamtools_17IteratorRowRegion_getCurrent;
36238 __pyx_vtable_9csamtools_IteratorRowRegion.cnext = (int (*)(struct __pyx_obj_9csamtools_IteratorRowRegion *))__pyx_f_9csamtools_17IteratorRowRegion_cnext;
36240 *(void(**)(void))&__pyx_vtable_9csamtools_IteratorRowRegion.getCurrent = (void(*)(void))__pyx_f_9csamtools_17IteratorRowRegion_getCurrent;
36241 *(void(**)(void))&__pyx_vtable_9csamtools_IteratorRowRegion.cnext = (void(*)(void))__pyx_f_9csamtools_17IteratorRowRegion_cnext;
36243 __pyx_type_9csamtools_IteratorRowRegion.tp_base = __pyx_ptype_9csamtools_IteratorRow;
36244 if (PyType_Ready(&__pyx_type_9csamtools_IteratorRowRegion) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1206; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36246 PyObject *wrapper = __Pyx_GetAttrString((PyObject *)&__pyx_type_9csamtools_IteratorRowRegion, "__next__"); if (unlikely(!wrapper)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1206; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36247 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
36248 __pyx_wrapperbase_9csamtools_17IteratorRowRegion___next__ = *((PyWrapperDescrObject *)wrapper)->d_base;
36249 __pyx_wrapperbase_9csamtools_17IteratorRowRegion___next__.doc = __pyx_doc_9csamtools_17IteratorRowRegion___next__;
36250 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_9csamtools_17IteratorRowRegion___next__;
36253 if (__Pyx_SetVtable(__pyx_type_9csamtools_IteratorRowRegion.tp_dict, __pyx_vtabptr_9csamtools_IteratorRowRegion) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1206; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36254 if (__Pyx_SetAttrString(__pyx_m, "IteratorRowRegion", (PyObject *)&__pyx_type_9csamtools_IteratorRowRegion) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1206; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36255 __pyx_ptype_9csamtools_IteratorRowRegion = &__pyx_type_9csamtools_IteratorRowRegion;
36256 __pyx_vtabptr_9csamtools_IteratorRowAll = &__pyx_vtable_9csamtools_IteratorRowAll;
36257 #if PY_MAJOR_VERSION >= 3
36258 __pyx_vtable_9csamtools_IteratorRowAll.getCurrent = (bam1_t *(*)(struct __pyx_obj_9csamtools_IteratorRowAll *))__pyx_f_9csamtools_14IteratorRowAll_getCurrent;
36259 __pyx_vtable_9csamtools_IteratorRowAll.cnext = (int (*)(struct __pyx_obj_9csamtools_IteratorRowAll *))__pyx_f_9csamtools_14IteratorRowAll_cnext;
36261 *(void(**)(void))&__pyx_vtable_9csamtools_IteratorRowAll.getCurrent = (void(*)(void))__pyx_f_9csamtools_14IteratorRowAll_getCurrent;
36262 *(void(**)(void))&__pyx_vtable_9csamtools_IteratorRowAll.cnext = (void(*)(void))__pyx_f_9csamtools_14IteratorRowAll_cnext;
36264 __pyx_type_9csamtools_IteratorRowAll.tp_base = __pyx_ptype_9csamtools_IteratorRow;
36265 if (PyType_Ready(&__pyx_type_9csamtools_IteratorRowAll) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1292; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36267 PyObject *wrapper = __Pyx_GetAttrString((PyObject *)&__pyx_type_9csamtools_IteratorRowAll, "__next__"); if (unlikely(!wrapper)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1292; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36268 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
36269 __pyx_wrapperbase_9csamtools_14IteratorRowAll___next__ = *((PyWrapperDescrObject *)wrapper)->d_base;
36270 __pyx_wrapperbase_9csamtools_14IteratorRowAll___next__.doc = __pyx_doc_9csamtools_14IteratorRowAll___next__;
36271 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_9csamtools_14IteratorRowAll___next__;
36274 if (__Pyx_SetVtable(__pyx_type_9csamtools_IteratorRowAll.tp_dict, __pyx_vtabptr_9csamtools_IteratorRowAll) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1292; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36275 if (__Pyx_SetAttrString(__pyx_m, "IteratorRowAll", (PyObject *)&__pyx_type_9csamtools_IteratorRowAll) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1292; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36276 __pyx_ptype_9csamtools_IteratorRowAll = &__pyx_type_9csamtools_IteratorRowAll;
36277 __pyx_type_9csamtools_IteratorRowAllRefs.tp_base = __pyx_ptype_9csamtools_IteratorRow;
36278 if (PyType_Ready(&__pyx_type_9csamtools_IteratorRowAllRefs) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36280 PyObject *wrapper = __Pyx_GetAttrString((PyObject *)&__pyx_type_9csamtools_IteratorRowAllRefs, "__next__"); if (unlikely(!wrapper)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36281 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
36282 __pyx_wrapperbase_9csamtools_18IteratorRowAllRefs___next__ = *((PyWrapperDescrObject *)wrapper)->d_base;
36283 __pyx_wrapperbase_9csamtools_18IteratorRowAllRefs___next__.doc = __pyx_doc_9csamtools_18IteratorRowAllRefs___next__;
36284 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_9csamtools_18IteratorRowAllRefs___next__;
36287 if (__Pyx_SetAttrString(__pyx_m, "IteratorRowAllRefs", (PyObject *)&__pyx_type_9csamtools_IteratorRowAllRefs) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36288 __pyx_ptype_9csamtools_IteratorRowAllRefs = &__pyx_type_9csamtools_IteratorRowAllRefs;
36289 __pyx_vtabptr_9csamtools_IteratorRowSelection = &__pyx_vtable_9csamtools_IteratorRowSelection;
36290 #if PY_MAJOR_VERSION >= 3
36291 __pyx_vtable_9csamtools_IteratorRowSelection.getCurrent = (bam1_t *(*)(struct __pyx_obj_9csamtools_IteratorRowSelection *))__pyx_f_9csamtools_20IteratorRowSelection_getCurrent;
36292 __pyx_vtable_9csamtools_IteratorRowSelection.cnext = (int (*)(struct __pyx_obj_9csamtools_IteratorRowSelection *))__pyx_f_9csamtools_20IteratorRowSelection_cnext;
36294 *(void(**)(void))&__pyx_vtable_9csamtools_IteratorRowSelection.getCurrent = (void(*)(void))__pyx_f_9csamtools_20IteratorRowSelection_getCurrent;
36295 *(void(**)(void))&__pyx_vtable_9csamtools_IteratorRowSelection.cnext = (void(*)(void))__pyx_f_9csamtools_20IteratorRowSelection_cnext;
36297 __pyx_type_9csamtools_IteratorRowSelection.tp_base = __pyx_ptype_9csamtools_IteratorRow;
36298 if (PyType_Ready(&__pyx_type_9csamtools_IteratorRowSelection) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36300 PyObject *wrapper = __Pyx_GetAttrString((PyObject *)&__pyx_type_9csamtools_IteratorRowSelection, "__next__"); if (unlikely(!wrapper)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36301 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
36302 __pyx_wrapperbase_9csamtools_20IteratorRowSelection___next__ = *((PyWrapperDescrObject *)wrapper)->d_base;
36303 __pyx_wrapperbase_9csamtools_20IteratorRowSelection___next__.doc = __pyx_doc_9csamtools_20IteratorRowSelection___next__;
36304 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_9csamtools_20IteratorRowSelection___next__;
36307 if (__Pyx_SetVtable(__pyx_type_9csamtools_IteratorRowSelection.tp_dict, __pyx_vtabptr_9csamtools_IteratorRowSelection) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36308 if (__Pyx_SetAttrString(__pyx_m, "IteratorRowSelection", (PyObject *)&__pyx_type_9csamtools_IteratorRowSelection) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36309 __pyx_ptype_9csamtools_IteratorRowSelection = &__pyx_type_9csamtools_IteratorRowSelection;
36310 __pyx_vtabptr_9csamtools_IteratorColumn = &__pyx_vtable_9csamtools_IteratorColumn;
36311 #if PY_MAJOR_VERSION >= 3
36312 __pyx_vtable_9csamtools_IteratorColumn.cnext = (int (*)(struct __pyx_obj_9csamtools_IteratorColumn *))__pyx_f_9csamtools_14IteratorColumn_cnext;
36313 __pyx_vtable_9csamtools_IteratorColumn.getSequence = (char *(*)(struct __pyx_obj_9csamtools_IteratorColumn *))__pyx_f_9csamtools_14IteratorColumn_getSequence;
36314 __pyx_vtable_9csamtools_IteratorColumn.setMask = (PyObject *(*)(struct __pyx_obj_9csamtools_IteratorColumn *, PyObject *))__pyx_f_9csamtools_14IteratorColumn_setMask;
36315 __pyx_vtable_9csamtools_IteratorColumn.setupIteratorData = (PyObject *(*)(struct __pyx_obj_9csamtools_IteratorColumn *, int, int, int, struct __pyx_opt_args_9csamtools_14IteratorColumn_setupIteratorData *__pyx_optional_args))__pyx_f_9csamtools_14IteratorColumn_setupIteratorData;
36316 __pyx_vtable_9csamtools_IteratorColumn.reset = (PyObject *(*)(struct __pyx_obj_9csamtools_IteratorColumn *, PyObject *, PyObject *, PyObject *))__pyx_f_9csamtools_14IteratorColumn_reset;
36318 *(void(**)(void))&__pyx_vtable_9csamtools_IteratorColumn.cnext = (void(*)(void))__pyx_f_9csamtools_14IteratorColumn_cnext;
36319 *(void(**)(void))&__pyx_vtable_9csamtools_IteratorColumn.getSequence = (void(*)(void))__pyx_f_9csamtools_14IteratorColumn_getSequence;
36320 *(void(**)(void))&__pyx_vtable_9csamtools_IteratorColumn.setMask = (void(*)(void))__pyx_f_9csamtools_14IteratorColumn_setMask;
36321 *(void(**)(void))&__pyx_vtable_9csamtools_IteratorColumn.setupIteratorData = (void(*)(void))__pyx_f_9csamtools_14IteratorColumn_setupIteratorData;
36322 *(void(**)(void))&__pyx_vtable_9csamtools_IteratorColumn.reset = (void(*)(void))__pyx_f_9csamtools_14IteratorColumn_reset;
36324 if (PyType_Ready(&__pyx_type_9csamtools_IteratorColumn) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1542; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36325 if (__Pyx_SetVtable(__pyx_type_9csamtools_IteratorColumn.tp_dict, __pyx_vtabptr_9csamtools_IteratorColumn) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1542; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36326 if (__Pyx_SetAttrString(__pyx_m, "IteratorColumn", (PyObject *)&__pyx_type_9csamtools_IteratorColumn) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1542; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36327 __pyx_ptype_9csamtools_IteratorColumn = &__pyx_type_9csamtools_IteratorColumn;
36328 __pyx_vtabptr_9csamtools_IteratorColumnRegion = &__pyx_vtable_9csamtools_IteratorColumnRegion;
36329 __pyx_vtable_9csamtools_IteratorColumnRegion.__pyx_base = *__pyx_vtabptr_9csamtools_IteratorColumn;
36330 __pyx_type_9csamtools_IteratorColumnRegion.tp_base = __pyx_ptype_9csamtools_IteratorColumn;
36331 if (PyType_Ready(&__pyx_type_9csamtools_IteratorColumnRegion) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1712; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36333 PyObject *wrapper = __Pyx_GetAttrString((PyObject *)&__pyx_type_9csamtools_IteratorColumnRegion, "__next__"); if (unlikely(!wrapper)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1712; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36334 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
36335 __pyx_wrapperbase_9csamtools_20IteratorColumnRegion___next__ = *((PyWrapperDescrObject *)wrapper)->d_base;
36336 __pyx_wrapperbase_9csamtools_20IteratorColumnRegion___next__.doc = __pyx_doc_9csamtools_20IteratorColumnRegion___next__;
36337 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_9csamtools_20IteratorColumnRegion___next__;
36340 if (__Pyx_SetVtable(__pyx_type_9csamtools_IteratorColumnRegion.tp_dict, __pyx_vtabptr_9csamtools_IteratorColumnRegion) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1712; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36341 if (__Pyx_SetAttrString(__pyx_m, "IteratorColumnRegion", (PyObject *)&__pyx_type_9csamtools_IteratorColumnRegion) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1712; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36342 __pyx_ptype_9csamtools_IteratorColumnRegion = &__pyx_type_9csamtools_IteratorColumnRegion;
36343 __pyx_vtabptr_9csamtools_IteratorColumnAllRefs = &__pyx_vtable_9csamtools_IteratorColumnAllRefs;
36344 __pyx_vtable_9csamtools_IteratorColumnAllRefs.__pyx_base = *__pyx_vtabptr_9csamtools_IteratorColumn;
36345 __pyx_type_9csamtools_IteratorColumnAllRefs.tp_base = __pyx_ptype_9csamtools_IteratorColumn;
36346 if (PyType_Ready(&__pyx_type_9csamtools_IteratorColumnAllRefs) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1741; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36348 PyObject *wrapper = __Pyx_GetAttrString((PyObject *)&__pyx_type_9csamtools_IteratorColumnAllRefs, "__next__"); if (unlikely(!wrapper)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1741; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36349 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
36350 __pyx_wrapperbase_9csamtools_21IteratorColumnAllRefs___next__ = *((PyWrapperDescrObject *)wrapper)->d_base;
36351 __pyx_wrapperbase_9csamtools_21IteratorColumnAllRefs___next__.doc = __pyx_doc_9csamtools_21IteratorColumnAllRefs___next__;
36352 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_9csamtools_21IteratorColumnAllRefs___next__;
36355 if (__Pyx_SetVtable(__pyx_type_9csamtools_IteratorColumnAllRefs.tp_dict, __pyx_vtabptr_9csamtools_IteratorColumnAllRefs) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1741; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36356 if (__Pyx_SetAttrString(__pyx_m, "IteratorColumnAllRefs", (PyObject *)&__pyx_type_9csamtools_IteratorColumnAllRefs) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1741; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36357 __pyx_ptype_9csamtools_IteratorColumnAllRefs = &__pyx_type_9csamtools_IteratorColumnAllRefs;
36358 if (PyType_Ready(&__pyx_type_9csamtools_SNPCall) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2816; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36359 if (__Pyx_SetAttrString(__pyx_m, "SNPCall", (PyObject *)&__pyx_type_9csamtools_SNPCall) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2816; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36360 __pyx_ptype_9csamtools_SNPCall = &__pyx_type_9csamtools_SNPCall;
36361 __pyx_vtabptr_9csamtools_SNPCallerBase = &__pyx_vtable_9csamtools_SNPCallerBase;
36362 #if PY_MAJOR_VERSION >= 3
36363 __pyx_vtable_9csamtools_SNPCallerBase.__dump = (PyObject *(*)(struct __pyx_obj_9csamtools_SNPCallerBase *, glf1_t *, uint32_t, int))__pyx_f_9csamtools_13SNPCallerBase___dump;
36365 *(void(**)(void))&__pyx_vtable_9csamtools_SNPCallerBase.__dump = (void(*)(void))__pyx_f_9csamtools_13SNPCallerBase___dump;
36367 if (PyType_Ready(&__pyx_type_9csamtools_SNPCallerBase) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2873; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36368 if (__Pyx_SetVtable(__pyx_type_9csamtools_SNPCallerBase.tp_dict, __pyx_vtabptr_9csamtools_SNPCallerBase) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2873; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36369 if (__Pyx_SetAttrString(__pyx_m, "SNPCallerBase", (PyObject *)&__pyx_type_9csamtools_SNPCallerBase) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2873; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36370 __pyx_ptype_9csamtools_SNPCallerBase = &__pyx_type_9csamtools_SNPCallerBase;
36371 __pyx_vtabptr_9csamtools_IteratorSNPCalls = &__pyx_vtable_9csamtools_IteratorSNPCalls;
36372 __pyx_vtable_9csamtools_IteratorSNPCalls.__pyx_base = *__pyx_vtabptr_9csamtools_SNPCallerBase;
36373 __pyx_type_9csamtools_IteratorSNPCalls.tp_base = __pyx_ptype_9csamtools_SNPCallerBase;
36374 if (PyType_Ready(&__pyx_type_9csamtools_IteratorSNPCalls) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36376 PyObject *wrapper = __Pyx_GetAttrString((PyObject *)&__pyx_type_9csamtools_IteratorSNPCalls, "__next__"); if (unlikely(!wrapper)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36377 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
36378 __pyx_wrapperbase_9csamtools_16IteratorSNPCalls___next__ = *((PyWrapperDescrObject *)wrapper)->d_base;
36379 __pyx_wrapperbase_9csamtools_16IteratorSNPCalls___next__.doc = __pyx_doc_9csamtools_16IteratorSNPCalls___next__;
36380 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_9csamtools_16IteratorSNPCalls___next__;
36383 if (__Pyx_SetVtable(__pyx_type_9csamtools_IteratorSNPCalls.tp_dict, __pyx_vtabptr_9csamtools_IteratorSNPCalls) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36384 if (__Pyx_SetAttrString(__pyx_m, "IteratorSNPCalls", (PyObject *)&__pyx_type_9csamtools_IteratorSNPCalls) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36385 __pyx_ptype_9csamtools_IteratorSNPCalls = &__pyx_type_9csamtools_IteratorSNPCalls;
36386 __pyx_vtabptr_9csamtools_SNPCaller = &__pyx_vtable_9csamtools_SNPCaller;
36387 __pyx_vtable_9csamtools_SNPCaller.__pyx_base = *__pyx_vtabptr_9csamtools_SNPCallerBase;
36388 __pyx_type_9csamtools_SNPCaller.tp_base = __pyx_ptype_9csamtools_SNPCallerBase;
36389 if (PyType_Ready(&__pyx_type_9csamtools_SNPCaller) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3021; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36390 if (__Pyx_SetVtable(__pyx_type_9csamtools_SNPCaller.tp_dict, __pyx_vtabptr_9csamtools_SNPCaller) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3021; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36391 if (__Pyx_SetAttrString(__pyx_m, "SNPCaller", (PyObject *)&__pyx_type_9csamtools_SNPCaller) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3021; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36392 __pyx_ptype_9csamtools_SNPCaller = &__pyx_type_9csamtools_SNPCaller;
36393 if (PyType_Ready(&__pyx_type_9csamtools_IndelCall) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36394 if (__Pyx_SetAttrString(__pyx_m, "IndelCall", (PyObject *)&__pyx_type_9csamtools_IndelCall) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36395 __pyx_ptype_9csamtools_IndelCall = &__pyx_type_9csamtools_IndelCall;
36396 if (PyType_Ready(&__pyx_type_9csamtools_IndelCallerBase) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36397 if (__Pyx_SetAttrString(__pyx_m, "IndelCallerBase", (PyObject *)&__pyx_type_9csamtools_IndelCallerBase) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36398 __pyx_ptype_9csamtools_IndelCallerBase = &__pyx_type_9csamtools_IndelCallerBase;
36399 __pyx_type_9csamtools_IndelCaller.tp_base = __pyx_ptype_9csamtools_IndelCallerBase;
36400 if (PyType_Ready(&__pyx_type_9csamtools_IndelCaller) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36401 if (__Pyx_SetAttrString(__pyx_m, "IndelCaller", (PyObject *)&__pyx_type_9csamtools_IndelCaller) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36402 __pyx_ptype_9csamtools_IndelCaller = &__pyx_type_9csamtools_IndelCaller;
36403 __pyx_type_9csamtools_IteratorIndelCalls.tp_base = __pyx_ptype_9csamtools_IndelCallerBase;
36404 if (PyType_Ready(&__pyx_type_9csamtools_IteratorIndelCalls) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3330; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36406 PyObject *wrapper = __Pyx_GetAttrString((PyObject *)&__pyx_type_9csamtools_IteratorIndelCalls, "__next__"); if (unlikely(!wrapper)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3330; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36407 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
36408 __pyx_wrapperbase_9csamtools_18IteratorIndelCalls___next__ = *((PyWrapperDescrObject *)wrapper)->d_base;
36409 __pyx_wrapperbase_9csamtools_18IteratorIndelCalls___next__.doc = __pyx_doc_9csamtools_18IteratorIndelCalls___next__;
36410 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_9csamtools_18IteratorIndelCalls___next__;
36413 if (__Pyx_SetAttrString(__pyx_m, "IteratorIndelCalls", (PyObject *)&__pyx_type_9csamtools_IteratorIndelCalls) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3330; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36414 __pyx_ptype_9csamtools_IteratorIndelCalls = &__pyx_type_9csamtools_IteratorIndelCalls;
36415 if (PyType_Ready(&__pyx_type_9csamtools_IndexedReads) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36416 if (__Pyx_SetAttrString(__pyx_m, "IndexedReads", (PyObject *)&__pyx_type_9csamtools_IndexedReads) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36417 __pyx_ptype_9csamtools_IndexedReads = &__pyx_type_9csamtools_IndexedReads;
36418 /*--- Type import code ---*/
36419 __pyx_ptype_7cpython_4bool_bool = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "bool", sizeof(PyBoolObject), 0); if (unlikely(!__pyx_ptype_7cpython_4bool_bool)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36420 /*--- Function import code ---*/
36421 /*--- Execution code ---*/
36423 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":4
36424 * # cython: profile=True
36425 * # adds doc-strings for sphinx
36426 * import tempfile # <<<<<<<<<<<<<<
36430 __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__tempfile), 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36431 __Pyx_GOTREF(__pyx_t_1);
36432 if (PyObject_SetAttr(__pyx_m, __pyx_n_s__tempfile, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36433 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
36435 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":5
36436 * # adds doc-strings for sphinx
36438 * import os # <<<<<<<<<<<<<<
36442 __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__os), 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36443 __Pyx_GOTREF(__pyx_t_1);
36444 if (PyObject_SetAttr(__pyx_m, __pyx_n_s__os, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36445 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
36447 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":6
36450 * import sys # <<<<<<<<<<<<<<
36454 __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__sys), 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36455 __Pyx_GOTREF(__pyx_t_1);
36456 if (PyObject_SetAttr(__pyx_m, __pyx_n_s__sys, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36457 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
36459 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":7
36462 * import types # <<<<<<<<<<<<<<
36466 __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__types), 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36467 __Pyx_GOTREF(__pyx_t_1);
36468 if (PyObject_SetAttr(__pyx_m, __pyx_n_s__types, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36469 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
36471 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":8
36474 * import itertools # <<<<<<<<<<<<<<
36478 __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__itertools), 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36479 __Pyx_GOTREF(__pyx_t_1);
36480 if (PyObject_SetAttr(__pyx_m, __pyx_n_s__itertools, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36481 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
36483 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":9
36486 * import struct # <<<<<<<<<<<<<<
36488 * import collections
36490 __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__struct), 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36491 __Pyx_GOTREF(__pyx_t_1);
36492 if (PyObject_SetAttr(__pyx_m, __pyx_n_s__struct, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36493 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
36495 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":10
36498 * import ctypes # <<<<<<<<<<<<<<
36499 * import collections
36502 __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__ctypes), 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36503 __Pyx_GOTREF(__pyx_t_1);
36504 if (PyObject_SetAttr(__pyx_m, __pyx_n_s__ctypes, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36505 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
36507 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":11
36510 * import collections # <<<<<<<<<<<<<<
36514 __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__collections), 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36515 __Pyx_GOTREF(__pyx_t_1);
36516 if (PyObject_SetAttr(__pyx_m, __pyx_n_s__collections, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36517 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
36519 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":12
36521 * import collections
36522 * import re # <<<<<<<<<<<<<<
36524 * from cpython cimport PyString_FromStringAndSize, PyString_AS_STRING
36526 __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__re), 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36527 __Pyx_GOTREF(__pyx_t_1);
36528 if (PyObject_SetAttr(__pyx_m, __pyx_n_s__re, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36529 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
36531 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":13
36532 * import collections
36534 * import platform # <<<<<<<<<<<<<<
36535 * from cpython cimport PyString_FromStringAndSize, PyString_AS_STRING
36536 * from cpython cimport PyErr_SetString
36538 __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__platform), 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36539 __Pyx_GOTREF(__pyx_t_1);
36540 if (PyObject_SetAttr(__pyx_m, __pyx_n_s__platform, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36541 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
36543 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":63
36544 * #####################################################################
36545 * # hard-coded constants
36546 * cdef char * bam_nt16_rev_table = "=ACMGRSVTWYHKDBN" # <<<<<<<<<<<<<<
36547 * cdef int max_pos = 2 << 29
36550 __pyx_v_9csamtools_bam_nt16_rev_table = __pyx_k_172;
36552 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":64
36553 * # hard-coded constants
36554 * cdef char * bam_nt16_rev_table = "=ACMGRSVTWYHKDBN"
36555 * cdef int max_pos = 2 << 29 # <<<<<<<<<<<<<<
36557 * # redirect stderr to 0
36559 __pyx_v_9csamtools_max_pos = 1073741824;
36561 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":67
36563 * # redirect stderr to 0
36564 * _logfile = open(os.path.devnull, "w") # <<<<<<<<<<<<<<
36565 * pysam_set_stderr( PyFile_AsFile( _logfile ) )
36568 __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__os); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36569 __Pyx_GOTREF(__pyx_t_1);
36570 __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__path); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36571 __Pyx_GOTREF(__pyx_t_2);
36572 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
36573 __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__devnull); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36574 __Pyx_GOTREF(__pyx_t_1);
36575 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
36576 __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36577 __Pyx_GOTREF(__pyx_t_2);
36578 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
36579 __Pyx_GIVEREF(__pyx_t_1);
36580 __Pyx_INCREF(((PyObject *)__pyx_n_s__w));
36581 PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_n_s__w));
36582 __Pyx_GIVEREF(((PyObject *)__pyx_n_s__w));
36584 __pyx_t_1 = PyObject_Call(__pyx_builtin_open, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36585 __Pyx_GOTREF(__pyx_t_1);
36586 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
36587 if (PyObject_SetAttr(__pyx_m, __pyx_n_s___logfile, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36588 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
36590 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":68
36591 * # redirect stderr to 0
36592 * _logfile = open(os.path.devnull, "w")
36593 * pysam_set_stderr( PyFile_AsFile( _logfile ) ) # <<<<<<<<<<<<<<
36595 * #####################################################################
36597 __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s___logfile); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36598 __Pyx_GOTREF(__pyx_t_1);
36599 pysam_set_stderr(PyFile_AsFile(__pyx_t_1));
36600 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
36602 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":117
36605 * class PileupColumn(object): # <<<<<<<<<<<<<<
36606 * '''A pileup column. A pileup column contains
36607 * all the reads that map to a certain target base.
36609 __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36610 __Pyx_GOTREF(((PyObject *)__pyx_t_1));
36611 __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36612 __Pyx_GOTREF(__pyx_t_2);
36613 __Pyx_INCREF(__pyx_builtin_object);
36614 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_builtin_object);
36615 __Pyx_GIVEREF(__pyx_builtin_object);
36616 if (PyDict_SetItemString(((PyObject *)__pyx_t_1), "__doc__", ((PyObject *)__pyx_kp_s_173)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36617 __pyx_t_3 = __Pyx_CreateClass(__pyx_t_2, ((PyObject *)__pyx_t_1), __pyx_n_s__PileupColumn, "csamtools"); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36618 __Pyx_GOTREF(__pyx_t_3);
36619 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
36621 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":130
36622 * list of reads (:class:`pysam.PileupRead`) aligned to this column
36624 * def __str__(self): # <<<<<<<<<<<<<<
36625 * return "\t".join( map(str, (self.tid, self.pos, self.n))) +\
36626 * "\n" + "\n".join( map(str, self.pileups) )
36628 __pyx_t_2 = PyCFunction_New(&__pyx_mdef_9csamtools_12PileupColumn___str__, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36629 __Pyx_GOTREF(__pyx_t_2);
36630 __pyx_t_4 = PyMethod_New(__pyx_t_2, 0, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36631 __Pyx_GOTREF(__pyx_t_4);
36632 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
36633 if (PyObject_SetAttr(__pyx_t_3, __pyx_n_s____str__, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36634 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
36635 if (PyObject_SetAttr(__pyx_m, __pyx_n_s__PileupColumn, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36636 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
36637 __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
36639 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":174
36642 * class StderrStore(): # <<<<<<<<<<<<<<
36644 * stderr is captured.
36646 __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;}
36647 __Pyx_GOTREF(((PyObject *)__pyx_t_1));
36648 if (PyDict_SetItemString(((PyObject *)__pyx_t_1), "__doc__", ((PyObject *)__pyx_kp_s_174)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36649 __pyx_t_3 = __Pyx_CreateClass(((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_1), __pyx_n_s__StderrStore, "csamtools"); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36650 __Pyx_GOTREF(__pyx_t_3);
36652 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":178
36653 * stderr is captured.
36655 * def __init__(self): # <<<<<<<<<<<<<<
36657 * self.stderr_h, self.stderr_f = tempfile.mkstemp()
36659 __pyx_t_4 = PyCFunction_New(&__pyx_mdef_9csamtools_11StderrStore___init__, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36660 __Pyx_GOTREF(__pyx_t_4);
36661 __pyx_t_2 = PyMethod_New(__pyx_t_4, 0, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36662 __Pyx_GOTREF(__pyx_t_2);
36663 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
36664 if (PyObject_SetAttr(__pyx_t_3, __pyx_n_s____init__, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36665 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
36667 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":184
36668 * self.stderr_save.setfd( self.stderr_h )
36670 * def readAndRelease( self ): # <<<<<<<<<<<<<<
36672 * self.stderr_save.restore()
36674 __pyx_t_2 = PyCFunction_New(&__pyx_mdef_9csamtools_11StderrStore_readAndRelease, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36675 __Pyx_GOTREF(__pyx_t_2);
36676 __pyx_t_4 = PyMethod_New(__pyx_t_2, 0, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36677 __Pyx_GOTREF(__pyx_t_4);
36678 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
36679 if (PyObject_SetAttr(__pyx_t_3, __pyx_n_s__readAndRelease, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36680 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
36682 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":193
36685 * def release(self): # <<<<<<<<<<<<<<
36687 * self.stderr_save.restore()
36689 __pyx_t_4 = PyCFunction_New(&__pyx_mdef_9csamtools_11StderrStore_release, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36690 __Pyx_GOTREF(__pyx_t_4);
36691 __pyx_t_2 = PyMethod_New(__pyx_t_4, 0, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36692 __Pyx_GOTREF(__pyx_t_2);
36693 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
36694 if (PyObject_SetAttr(__pyx_t_3, __pyx_n_s__release, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36695 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
36697 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":199
36698 * os.remove( self.stderr_f )
36700 * def __del__(self): # <<<<<<<<<<<<<<
36704 __pyx_t_2 = PyCFunction_New(&__pyx_mdef_9csamtools_11StderrStore___del__, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36705 __Pyx_GOTREF(__pyx_t_2);
36706 __pyx_t_4 = PyMethod_New(__pyx_t_2, 0, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36707 __Pyx_GOTREF(__pyx_t_4);
36708 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
36709 if (PyObject_SetAttr(__pyx_t_3, __pyx_n_s____del__, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36710 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
36711 if (PyObject_SetAttr(__pyx_m, __pyx_n_s__StderrStore, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36712 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
36713 __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
36715 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":202
36718 * class StderrStoreWindows(): # <<<<<<<<<<<<<<
36719 * '''does nothing. stderr can't be redirected on windows'''
36720 * def __init__(self): pass
36722 __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36723 __Pyx_GOTREF(((PyObject *)__pyx_t_1));
36724 if (PyDict_SetItemString(((PyObject *)__pyx_t_1), "__doc__", ((PyObject *)__pyx_kp_s_175)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36725 __pyx_t_3 = __Pyx_CreateClass(((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_1), __pyx_n_s__StderrStoreWindows, "csamtools"); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36726 __Pyx_GOTREF(__pyx_t_3);
36728 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":204
36729 * class StderrStoreWindows():
36730 * '''does nothing. stderr can't be redirected on windows'''
36731 * def __init__(self): pass # <<<<<<<<<<<<<<
36732 * def readAndRelease(self): return []
36733 * def release(self): pass
36735 __pyx_t_4 = PyCFunction_New(&__pyx_mdef_9csamtools_18StderrStoreWindows___init__, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36736 __Pyx_GOTREF(__pyx_t_4);
36737 __pyx_t_2 = PyMethod_New(__pyx_t_4, 0, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36738 __Pyx_GOTREF(__pyx_t_2);
36739 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
36740 if (PyObject_SetAttr(__pyx_t_3, __pyx_n_s____init__, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36741 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
36743 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":205
36744 * '''does nothing. stderr can't be redirected on windows'''
36745 * def __init__(self): pass
36746 * def readAndRelease(self): return [] # <<<<<<<<<<<<<<
36747 * def release(self): pass
36750 __pyx_t_2 = PyCFunction_New(&__pyx_mdef_9csamtools_18StderrStoreWindows_readAndRelease, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36751 __Pyx_GOTREF(__pyx_t_2);
36752 __pyx_t_4 = PyMethod_New(__pyx_t_2, 0, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36753 __Pyx_GOTREF(__pyx_t_4);
36754 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
36755 if (PyObject_SetAttr(__pyx_t_3, __pyx_n_s__readAndRelease, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36756 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
36758 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":206
36759 * def __init__(self): pass
36760 * def readAndRelease(self): return []
36761 * def release(self): pass # <<<<<<<<<<<<<<
36763 * if platform.system()=='Windows':
36765 __pyx_t_4 = PyCFunction_New(&__pyx_mdef_9csamtools_18StderrStoreWindows_release, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36766 __Pyx_GOTREF(__pyx_t_4);
36767 __pyx_t_2 = PyMethod_New(__pyx_t_4, 0, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36768 __Pyx_GOTREF(__pyx_t_2);
36769 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
36770 if (PyObject_SetAttr(__pyx_t_3, __pyx_n_s__release, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36771 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
36772 if (PyObject_SetAttr(__pyx_m, __pyx_n_s__StderrStoreWindows, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36773 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
36774 __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
36776 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":208
36777 * def release(self): pass
36779 * if platform.system()=='Windows': # <<<<<<<<<<<<<<
36781 * StderrStore = StderrStoreWindows
36783 __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__platform); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36784 __Pyx_GOTREF(__pyx_t_1);
36785 __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__system); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36786 __Pyx_GOTREF(__pyx_t_3);
36787 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
36788 __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 = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36789 __Pyx_GOTREF(__pyx_t_1);
36790 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
36791 __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, ((PyObject *)__pyx_n_s__Windows), Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36792 __Pyx_GOTREF(__pyx_t_3);
36793 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
36794 __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36795 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
36798 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":209
36800 * if platform.system()=='Windows':
36801 * del StderrStore # <<<<<<<<<<<<<<
36802 * StderrStore = StderrStoreWindows
36805 if (__Pyx_DelAttrString(__pyx_m, "StderrStore") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36807 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":210
36808 * if platform.system()=='Windows':
36810 * StderrStore = StderrStoreWindows # <<<<<<<<<<<<<<
36814 __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__StderrStoreWindows); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36815 __Pyx_GOTREF(__pyx_t_3);
36816 if (PyObject_SetAttr(__pyx_m, __pyx_n_s__StderrStore, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36817 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
36822 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":217
36823 * ######################################################################
36824 * # valid types for sam headers
36825 * VALID_HEADER_TYPES = { "HD" : dict, # <<<<<<<<<<<<<<
36829 __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36830 __Pyx_GOTREF(((PyObject *)__pyx_t_3));
36831 if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__HD), ((PyObject *)((PyObject*)&PyDict_Type))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36833 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":218
36834 * # valid types for sam headers
36835 * VALID_HEADER_TYPES = { "HD" : dict,
36836 * "SQ" : list, # <<<<<<<<<<<<<<
36840 if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__SQ), ((PyObject *)((PyObject*)&PyList_Type))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36842 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":219
36843 * VALID_HEADER_TYPES = { "HD" : dict,
36845 * "RG" : list, # <<<<<<<<<<<<<<
36849 if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__RG), ((PyObject *)((PyObject*)&PyList_Type))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36851 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":220
36854 * "PG" : list, # <<<<<<<<<<<<<<
36858 if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__PG), ((PyObject *)((PyObject*)&PyList_Type))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36860 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":221
36863 * "CO" : list } # <<<<<<<<<<<<<<
36865 * # order of records within sam headers
36867 if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__CO), ((PyObject *)((PyObject*)&PyList_Type))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36868 if (PyObject_SetAttr(__pyx_m, __pyx_n_s__VALID_HEADER_TYPES, ((PyObject *)__pyx_t_3)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36869 __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
36871 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":224
36873 * # order of records within sam headers
36874 * VALID_HEADERS = ("HD", "SQ", "RG", "PG", "CO" ) # <<<<<<<<<<<<<<
36876 * # type conversions within sam header records
36878 __pyx_t_3 = PyTuple_New(5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36879 __Pyx_GOTREF(__pyx_t_3);
36880 __Pyx_INCREF(((PyObject *)__pyx_n_s__HD));
36881 PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_n_s__HD));
36882 __Pyx_GIVEREF(((PyObject *)__pyx_n_s__HD));
36883 __Pyx_INCREF(((PyObject *)__pyx_n_s__SQ));
36884 PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_n_s__SQ));
36885 __Pyx_GIVEREF(((PyObject *)__pyx_n_s__SQ));
36886 __Pyx_INCREF(((PyObject *)__pyx_n_s__RG));
36887 PyTuple_SET_ITEM(__pyx_t_3, 2, ((PyObject *)__pyx_n_s__RG));
36888 __Pyx_GIVEREF(((PyObject *)__pyx_n_s__RG));
36889 __Pyx_INCREF(((PyObject *)__pyx_n_s__PG));
36890 PyTuple_SET_ITEM(__pyx_t_3, 3, ((PyObject *)__pyx_n_s__PG));
36891 __Pyx_GIVEREF(((PyObject *)__pyx_n_s__PG));
36892 __Pyx_INCREF(((PyObject *)__pyx_n_s__CO));
36893 PyTuple_SET_ITEM(__pyx_t_3, 4, ((PyObject *)__pyx_n_s__CO));
36894 __Pyx_GIVEREF(((PyObject *)__pyx_n_s__CO));
36895 if (PyObject_SetAttr(__pyx_m, __pyx_n_s__VALID_HEADERS, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36896 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
36898 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":227
36900 * # type conversions within sam header records
36901 * VALID_HEADER_FIELDS = { "HD" : { "VN" : str, "SO" : str, "GO" : str }, # <<<<<<<<<<<<<<
36902 * "SQ" : { "SN" : str, "LN" : int, "AS" : str, "M5" : str, "UR" : str, "SP" : str },
36903 * "RG" : { "ID" : str, "SM" : str, "LB" : str, "DS" : str, "PU" : str, "PI" : str, "CN" : str, "DT" : str, "PL" : str, },
36905 __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36906 __Pyx_GOTREF(((PyObject *)__pyx_t_3));
36907 __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36908 __Pyx_GOTREF(((PyObject *)__pyx_t_1));
36909 if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__VN), ((PyObject *)((PyObject*)&PyString_Type))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36910 if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__SO), ((PyObject *)((PyObject*)&PyString_Type))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36911 if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__GO), ((PyObject *)((PyObject*)&PyString_Type))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36912 if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__HD), ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36913 __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
36915 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":228
36916 * # type conversions within sam header records
36917 * VALID_HEADER_FIELDS = { "HD" : { "VN" : str, "SO" : str, "GO" : str },
36918 * "SQ" : { "SN" : str, "LN" : int, "AS" : str, "M5" : str, "UR" : str, "SP" : str }, # <<<<<<<<<<<<<<
36919 * "RG" : { "ID" : str, "SM" : str, "LB" : str, "DS" : str, "PU" : str, "PI" : str, "CN" : str, "DT" : str, "PL" : str, },
36920 * "PG" : { "PN" : str, "ID" : str, "VN" : str, "CL" : str }, }
36922 __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36923 __Pyx_GOTREF(((PyObject *)__pyx_t_1));
36924 if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__SN), ((PyObject *)((PyObject*)&PyString_Type))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36925 if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__LN), ((PyObject *)((PyObject*)&PyInt_Type))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36926 if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__AS), ((PyObject *)((PyObject*)&PyString_Type))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36927 if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__M5), ((PyObject *)((PyObject*)&PyString_Type))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36928 if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__UR), ((PyObject *)((PyObject*)&PyString_Type))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36929 if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__SP), ((PyObject *)((PyObject*)&PyString_Type))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36930 if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__SQ), ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36931 __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
36933 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":229
36934 * VALID_HEADER_FIELDS = { "HD" : { "VN" : str, "SO" : str, "GO" : str },
36935 * "SQ" : { "SN" : str, "LN" : int, "AS" : str, "M5" : str, "UR" : str, "SP" : str },
36936 * "RG" : { "ID" : str, "SM" : str, "LB" : str, "DS" : str, "PU" : str, "PI" : str, "CN" : str, "DT" : str, "PL" : str, }, # <<<<<<<<<<<<<<
36937 * "PG" : { "PN" : str, "ID" : str, "VN" : str, "CL" : str }, }
36940 __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36941 __Pyx_GOTREF(((PyObject *)__pyx_t_1));
36942 if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__ID), ((PyObject *)((PyObject*)&PyString_Type))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36943 if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__SM), ((PyObject *)((PyObject*)&PyString_Type))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36944 if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__LB), ((PyObject *)((PyObject*)&PyString_Type))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36945 if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__DS), ((PyObject *)((PyObject*)&PyString_Type))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36946 if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__PU), ((PyObject *)((PyObject*)&PyString_Type))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36947 if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__PI), ((PyObject *)((PyObject*)&PyString_Type))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36948 if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__CN), ((PyObject *)((PyObject*)&PyString_Type))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36949 if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__DT), ((PyObject *)((PyObject*)&PyString_Type))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36950 if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__PL), ((PyObject *)((PyObject*)&PyString_Type))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36951 if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__RG), ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36952 __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
36954 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":230
36955 * "SQ" : { "SN" : str, "LN" : int, "AS" : str, "M5" : str, "UR" : str, "SP" : str },
36956 * "RG" : { "ID" : str, "SM" : str, "LB" : str, "DS" : str, "PU" : str, "PI" : str, "CN" : str, "DT" : str, "PL" : str, },
36957 * "PG" : { "PN" : str, "ID" : str, "VN" : str, "CL" : str }, } # <<<<<<<<<<<<<<
36959 * # output order of fields within records
36961 __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36962 __Pyx_GOTREF(((PyObject *)__pyx_t_1));
36963 if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__PN), ((PyObject *)((PyObject*)&PyString_Type))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36964 if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__ID), ((PyObject *)((PyObject*)&PyString_Type))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36965 if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__VN), ((PyObject *)((PyObject*)&PyString_Type))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36966 if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__CL), ((PyObject *)((PyObject*)&PyString_Type))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36967 if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__PG), ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36968 __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
36969 if (PyObject_SetAttr(__pyx_m, __pyx_n_s__VALID_HEADER_FIELDS, ((PyObject *)__pyx_t_3)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36970 __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
36972 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":233
36974 * # output order of fields within records
36975 * VALID_HEADER_ORDER = { "HD" : ( "VN", "SO", "GO" ), # <<<<<<<<<<<<<<
36976 * "SQ" : ( "SN", "LN", "AS", "M5" , "UR" , "SP" ),
36977 * "RG" : ( "ID", "SM", "LB", "DS" , "PU" , "PI" , "CN" , "DT", "PL" ),
36979 __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36980 __Pyx_GOTREF(((PyObject *)__pyx_t_3));
36981 __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36982 __Pyx_GOTREF(__pyx_t_1);
36983 __Pyx_INCREF(((PyObject *)__pyx_n_s__VN));
36984 PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_n_s__VN));
36985 __Pyx_GIVEREF(((PyObject *)__pyx_n_s__VN));
36986 __Pyx_INCREF(((PyObject *)__pyx_n_s__SO));
36987 PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_n_s__SO));
36988 __Pyx_GIVEREF(((PyObject *)__pyx_n_s__SO));
36989 __Pyx_INCREF(((PyObject *)__pyx_n_s__GO));
36990 PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_n_s__GO));
36991 __Pyx_GIVEREF(((PyObject *)__pyx_n_s__GO));
36992 if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__HD), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36993 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
36995 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":234
36996 * # output order of fields within records
36997 * VALID_HEADER_ORDER = { "HD" : ( "VN", "SO", "GO" ),
36998 * "SQ" : ( "SN", "LN", "AS", "M5" , "UR" , "SP" ), # <<<<<<<<<<<<<<
36999 * "RG" : ( "ID", "SM", "LB", "DS" , "PU" , "PI" , "CN" , "DT", "PL" ),
37000 * "PG" : ( "PN", "ID", "VN", "CL" ), }
37002 __pyx_t_1 = PyTuple_New(6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37003 __Pyx_GOTREF(__pyx_t_1);
37004 __Pyx_INCREF(((PyObject *)__pyx_n_s__SN));
37005 PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_n_s__SN));
37006 __Pyx_GIVEREF(((PyObject *)__pyx_n_s__SN));
37007 __Pyx_INCREF(((PyObject *)__pyx_n_s__LN));
37008 PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_n_s__LN));
37009 __Pyx_GIVEREF(((PyObject *)__pyx_n_s__LN));
37010 __Pyx_INCREF(((PyObject *)__pyx_n_s__AS));
37011 PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_n_s__AS));
37012 __Pyx_GIVEREF(((PyObject *)__pyx_n_s__AS));
37013 __Pyx_INCREF(((PyObject *)__pyx_n_s__M5));
37014 PyTuple_SET_ITEM(__pyx_t_1, 3, ((PyObject *)__pyx_n_s__M5));
37015 __Pyx_GIVEREF(((PyObject *)__pyx_n_s__M5));
37016 __Pyx_INCREF(((PyObject *)__pyx_n_s__UR));
37017 PyTuple_SET_ITEM(__pyx_t_1, 4, ((PyObject *)__pyx_n_s__UR));
37018 __Pyx_GIVEREF(((PyObject *)__pyx_n_s__UR));
37019 __Pyx_INCREF(((PyObject *)__pyx_n_s__SP));
37020 PyTuple_SET_ITEM(__pyx_t_1, 5, ((PyObject *)__pyx_n_s__SP));
37021 __Pyx_GIVEREF(((PyObject *)__pyx_n_s__SP));
37022 if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__SQ), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37023 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37025 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":235
37026 * VALID_HEADER_ORDER = { "HD" : ( "VN", "SO", "GO" ),
37027 * "SQ" : ( "SN", "LN", "AS", "M5" , "UR" , "SP" ),
37028 * "RG" : ( "ID", "SM", "LB", "DS" , "PU" , "PI" , "CN" , "DT", "PL" ), # <<<<<<<<<<<<<<
37029 * "PG" : ( "PN", "ID", "VN", "CL" ), }
37032 __pyx_t_1 = PyTuple_New(9); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37033 __Pyx_GOTREF(__pyx_t_1);
37034 __Pyx_INCREF(((PyObject *)__pyx_n_s__ID));
37035 PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_n_s__ID));
37036 __Pyx_GIVEREF(((PyObject *)__pyx_n_s__ID));
37037 __Pyx_INCREF(((PyObject *)__pyx_n_s__SM));
37038 PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_n_s__SM));
37039 __Pyx_GIVEREF(((PyObject *)__pyx_n_s__SM));
37040 __Pyx_INCREF(((PyObject *)__pyx_n_s__LB));
37041 PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_n_s__LB));
37042 __Pyx_GIVEREF(((PyObject *)__pyx_n_s__LB));
37043 __Pyx_INCREF(((PyObject *)__pyx_n_s__DS));
37044 PyTuple_SET_ITEM(__pyx_t_1, 3, ((PyObject *)__pyx_n_s__DS));
37045 __Pyx_GIVEREF(((PyObject *)__pyx_n_s__DS));
37046 __Pyx_INCREF(((PyObject *)__pyx_n_s__PU));
37047 PyTuple_SET_ITEM(__pyx_t_1, 4, ((PyObject *)__pyx_n_s__PU));
37048 __Pyx_GIVEREF(((PyObject *)__pyx_n_s__PU));
37049 __Pyx_INCREF(((PyObject *)__pyx_n_s__PI));
37050 PyTuple_SET_ITEM(__pyx_t_1, 5, ((PyObject *)__pyx_n_s__PI));
37051 __Pyx_GIVEREF(((PyObject *)__pyx_n_s__PI));
37052 __Pyx_INCREF(((PyObject *)__pyx_n_s__CN));
37053 PyTuple_SET_ITEM(__pyx_t_1, 6, ((PyObject *)__pyx_n_s__CN));
37054 __Pyx_GIVEREF(((PyObject *)__pyx_n_s__CN));
37055 __Pyx_INCREF(((PyObject *)__pyx_n_s__DT));
37056 PyTuple_SET_ITEM(__pyx_t_1, 7, ((PyObject *)__pyx_n_s__DT));
37057 __Pyx_GIVEREF(((PyObject *)__pyx_n_s__DT));
37058 __Pyx_INCREF(((PyObject *)__pyx_n_s__PL));
37059 PyTuple_SET_ITEM(__pyx_t_1, 8, ((PyObject *)__pyx_n_s__PL));
37060 __Pyx_GIVEREF(((PyObject *)__pyx_n_s__PL));
37061 if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__RG), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37062 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37064 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":236
37065 * "SQ" : ( "SN", "LN", "AS", "M5" , "UR" , "SP" ),
37066 * "RG" : ( "ID", "SM", "LB", "DS" , "PU" , "PI" , "CN" , "DT", "PL" ),
37067 * "PG" : ( "PN", "ID", "VN", "CL" ), } # <<<<<<<<<<<<<<
37071 __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37072 __Pyx_GOTREF(__pyx_t_1);
37073 __Pyx_INCREF(((PyObject *)__pyx_n_s__PN));
37074 PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_n_s__PN));
37075 __Pyx_GIVEREF(((PyObject *)__pyx_n_s__PN));
37076 __Pyx_INCREF(((PyObject *)__pyx_n_s__ID));
37077 PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_n_s__ID));
37078 __Pyx_GIVEREF(((PyObject *)__pyx_n_s__ID));
37079 __Pyx_INCREF(((PyObject *)__pyx_n_s__VN));
37080 PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_n_s__VN));
37081 __Pyx_GIVEREF(((PyObject *)__pyx_n_s__VN));
37082 __Pyx_INCREF(((PyObject *)__pyx_n_s__CL));
37083 PyTuple_SET_ITEM(__pyx_t_1, 3, ((PyObject *)__pyx_n_s__CL));
37084 __Pyx_GIVEREF(((PyObject *)__pyx_n_s__CL));
37085 if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__PG), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37086 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37087 if (PyObject_SetAttr(__pyx_m, __pyx_n_s__VALID_HEADER_ORDER, ((PyObject *)__pyx_t_3)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37088 __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
37090 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":719
37093 * until_eof = False ): # <<<<<<<<<<<<<<
37095 * fetch aligned reads in a :term:`region` using 0-based indexing. The region is specified by
37097 __pyx_t_3 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37098 __Pyx_GOTREF(__pyx_t_3);
37099 __pyx_k_29 = __pyx_t_3;
37100 __Pyx_GIVEREF(__pyx_t_3);
37103 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":830
37106 * until_eof = False ): # <<<<<<<<<<<<<<
37107 * '''*(reference = None, start = None, end = None, region = None, callback = None, until_eof = False)*
37110 __pyx_t_3 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37111 __Pyx_GOTREF(__pyx_t_3);
37112 __pyx_k_39 = __pyx_t_3;
37113 __Pyx_GIVEREF(__pyx_t_3);
37116 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1718
37119 * int end = max_pos, # <<<<<<<<<<<<<<
37123 __pyx_k_58 = __pyx_v_9csamtools_max_pos;
37125 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2699
37126 * return self._level
37128 * class Outs: # <<<<<<<<<<<<<<
37129 * '''http://mail.python.org/pipermail/python-list/2000-June/038406.html'''
37130 * def __init__(self, id = 1):
37132 __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2699; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37133 __Pyx_GOTREF(((PyObject *)__pyx_t_3));
37134 if (PyDict_SetItemString(((PyObject *)__pyx_t_3), "__doc__", ((PyObject *)__pyx_kp_s_176)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2699; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37135 __pyx_t_1 = __Pyx_CreateClass(((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_3), __pyx_n_s__Outs, "csamtools"); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2699; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37136 __Pyx_GOTREF(__pyx_t_1);
37138 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2701
37140 * '''http://mail.python.org/pipermail/python-list/2000-June/038406.html'''
37141 * def __init__(self, id = 1): # <<<<<<<<<<<<<<
37142 * self.streams = []
37145 __pyx_t_2 = PyCFunction_New(&__pyx_mdef_9csamtools_4Outs___init__, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2701; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37146 __Pyx_GOTREF(__pyx_t_2);
37147 __pyx_t_4 = PyMethod_New(__pyx_t_2, 0, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2701; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37148 __Pyx_GOTREF(__pyx_t_4);
37149 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
37150 if (PyObject_SetAttr(__pyx_t_1, __pyx_n_s____init__, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2701; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37151 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
37153 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2705
37156 * def setdevice(self, filename): # <<<<<<<<<<<<<<
37157 * '''open an existing file, like "/dev/null"'''
37158 * fd = os.open(filename, os.O_WRONLY)
37160 __pyx_t_4 = PyCFunction_New(&__pyx_mdef_9csamtools_4Outs_setdevice, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2705; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37161 __Pyx_GOTREF(__pyx_t_4);
37162 __pyx_t_2 = PyMethod_New(__pyx_t_4, 0, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2705; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37163 __Pyx_GOTREF(__pyx_t_2);
37164 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
37165 if (PyObject_SetAttr(__pyx_t_1, __pyx_n_s__setdevice, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2705; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37166 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
37168 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2710
37171 * def setfile(self, filename): # <<<<<<<<<<<<<<
37172 * '''open a new file.'''
37173 * fd = os.open(filename, os.O_WRONLY|os.O_CREAT, 0660);
37175 __pyx_t_2 = PyCFunction_New(&__pyx_mdef_9csamtools_4Outs_setfile, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2710; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37176 __Pyx_GOTREF(__pyx_t_2);
37177 __pyx_t_4 = PyMethod_New(__pyx_t_2, 0, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2710; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37178 __Pyx_GOTREF(__pyx_t_4);
37179 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
37180 if (PyObject_SetAttr(__pyx_t_1, __pyx_n_s__setfile, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2710; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37181 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
37183 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2715
37186 * def setfd(self, fd): # <<<<<<<<<<<<<<
37187 * ofd = os.dup(self.id) # Save old stream on new unit.
37188 * self.streams.append(ofd)
37190 __pyx_t_4 = PyCFunction_New(&__pyx_mdef_9csamtools_4Outs_setfd, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2715; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37191 __Pyx_GOTREF(__pyx_t_4);
37192 __pyx_t_2 = PyMethod_New(__pyx_t_4, 0, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2715; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37193 __Pyx_GOTREF(__pyx_t_2);
37194 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
37195 if (PyObject_SetAttr(__pyx_t_1, __pyx_n_s__setfd, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2715; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37196 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
37198 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2723
37199 * os.close(fd) # Close other unit (look out, caller.)
37201 * def restore(self): # <<<<<<<<<<<<<<
37202 * '''restore previous output stream'''
37205 __pyx_t_2 = PyCFunction_New(&__pyx_mdef_9csamtools_4Outs_restore, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2723; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37206 __Pyx_GOTREF(__pyx_t_2);
37207 __pyx_t_4 = PyMethod_New(__pyx_t_2, 0, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2723; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37208 __Pyx_GOTREF(__pyx_t_4);
37209 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
37210 if (PyObject_SetAttr(__pyx_t_1, __pyx_n_s__restore, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2723; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37211 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
37212 if (PyObject_SetAttr(__pyx_m, __pyx_n_s__Outs, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2699; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37213 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37214 __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
37216 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2736
37217 * def _samtools_dispatch( method,
37219 * catch_stdout = True, # <<<<<<<<<<<<<<
37220 * catch_stderr = False,
37223 __pyx_t_3 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2736; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37224 __Pyx_GOTREF(__pyx_t_3);
37225 __pyx_k_98 = __pyx_t_3;
37226 __Pyx_GIVEREF(__pyx_t_3);
37229 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":2737
37231 * catch_stdout = True,
37232 * catch_stderr = False, # <<<<<<<<<<<<<<
37234 * '''call ``method`` in samtools providing arguments in args.
37236 __pyx_t_3 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2737; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37237 __Pyx_GOTREF(__pyx_t_3);
37238 __pyx_k_99 = __pyx_t_3;
37239 __Pyx_GIVEREF(__pyx_t_3);
37242 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":3436
37243 * if self.owns_samfile: samclose( self.fp )
37245 * __all__ = ["Samfile", # <<<<<<<<<<<<<<
37249 __pyx_t_3 = PyList_New(13); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37250 __Pyx_GOTREF(((PyObject *)__pyx_t_3));
37251 __Pyx_INCREF(((PyObject *)__pyx_n_s__Samfile));
37252 PyList_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_n_s__Samfile));
37253 __Pyx_GIVEREF(((PyObject *)__pyx_n_s__Samfile));
37254 __Pyx_INCREF(((PyObject *)__pyx_n_s__Fastafile));
37255 PyList_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_n_s__Fastafile));
37256 __Pyx_GIVEREF(((PyObject *)__pyx_n_s__Fastafile));
37257 __Pyx_INCREF(((PyObject *)__pyx_n_s__IteratorRow));
37258 PyList_SET_ITEM(__pyx_t_3, 2, ((PyObject *)__pyx_n_s__IteratorRow));
37259 __Pyx_GIVEREF(((PyObject *)__pyx_n_s__IteratorRow));
37260 __Pyx_INCREF(((PyObject *)__pyx_n_s__IteratorColumn));
37261 PyList_SET_ITEM(__pyx_t_3, 3, ((PyObject *)__pyx_n_s__IteratorColumn));
37262 __Pyx_GIVEREF(((PyObject *)__pyx_n_s__IteratorColumn));
37263 __Pyx_INCREF(((PyObject *)__pyx_n_s__AlignedRead));
37264 PyList_SET_ITEM(__pyx_t_3, 4, ((PyObject *)__pyx_n_s__AlignedRead));
37265 __Pyx_GIVEREF(((PyObject *)__pyx_n_s__AlignedRead));
37266 __Pyx_INCREF(((PyObject *)__pyx_n_s__PileupColumn));
37267 PyList_SET_ITEM(__pyx_t_3, 5, ((PyObject *)__pyx_n_s__PileupColumn));
37268 __Pyx_GIVEREF(((PyObject *)__pyx_n_s__PileupColumn));
37269 __Pyx_INCREF(((PyObject *)__pyx_n_s__PileupProxy));
37270 PyList_SET_ITEM(__pyx_t_3, 6, ((PyObject *)__pyx_n_s__PileupProxy));
37271 __Pyx_GIVEREF(((PyObject *)__pyx_n_s__PileupProxy));
37272 __Pyx_INCREF(((PyObject *)__pyx_n_s__PileupRead));
37273 PyList_SET_ITEM(__pyx_t_3, 7, ((PyObject *)__pyx_n_s__PileupRead));
37274 __Pyx_GIVEREF(((PyObject *)__pyx_n_s__PileupRead));
37275 __Pyx_INCREF(((PyObject *)__pyx_n_s__IteratorSNPCalls));
37276 PyList_SET_ITEM(__pyx_t_3, 8, ((PyObject *)__pyx_n_s__IteratorSNPCalls));
37277 __Pyx_GIVEREF(((PyObject *)__pyx_n_s__IteratorSNPCalls));
37278 __Pyx_INCREF(((PyObject *)__pyx_n_s__SNPCaller));
37279 PyList_SET_ITEM(__pyx_t_3, 9, ((PyObject *)__pyx_n_s__SNPCaller));
37280 __Pyx_GIVEREF(((PyObject *)__pyx_n_s__SNPCaller));
37281 __Pyx_INCREF(((PyObject *)__pyx_n_s__IndelCaller));
37282 PyList_SET_ITEM(__pyx_t_3, 10, ((PyObject *)__pyx_n_s__IndelCaller));
37283 __Pyx_GIVEREF(((PyObject *)__pyx_n_s__IndelCaller));
37284 __Pyx_INCREF(((PyObject *)__pyx_n_s__IteratorIndelCalls));
37285 PyList_SET_ITEM(__pyx_t_3, 11, ((PyObject *)__pyx_n_s__IteratorIndelCalls));
37286 __Pyx_GIVEREF(((PyObject *)__pyx_n_s__IteratorIndelCalls));
37287 __Pyx_INCREF(((PyObject *)__pyx_n_s__IndexedReads));
37288 PyList_SET_ITEM(__pyx_t_3, 12, ((PyObject *)__pyx_n_s__IndexedReads));
37289 __Pyx_GIVEREF(((PyObject *)__pyx_n_s__IndexedReads));
37290 if (PyObject_SetAttr(__pyx_m, __pyx_n_s____all__, ((PyObject *)__pyx_t_3)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37291 __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
37293 /* "/ifs/devel/pysam/pysam/pysam/csamtools.pyx":1
37294 * # cython: embedsignature=True # <<<<<<<<<<<<<<
37295 * # cython: profile=True
37296 * # adds doc-strings for sphinx
37298 __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37299 __Pyx_GOTREF(((PyObject *)__pyx_t_3));
37300 __pyx_t_1 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Fastafile); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37301 __Pyx_GOTREF(__pyx_t_1);
37302 __pyx_t_4 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s___isOpen); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37303 __Pyx_GOTREF(__pyx_t_4);
37304 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37305 __pyx_t_1 = __Pyx_GetAttrString(__pyx_t_4, "__doc__"); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37306 __Pyx_GOTREF(__pyx_t_1);
37307 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
37308 if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_kp_u_177), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37309 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37310 __pyx_t_1 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Fastafile); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37311 __Pyx_GOTREF(__pyx_t_1);
37312 __pyx_t_4 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s___open); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37313 __Pyx_GOTREF(__pyx_t_4);
37314 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37315 __pyx_t_1 = __Pyx_GetAttrString(__pyx_t_4, "__doc__"); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37316 __Pyx_GOTREF(__pyx_t_1);
37317 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
37318 if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_kp_u_178), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37319 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37320 __pyx_t_1 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Fastafile); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37321 __Pyx_GOTREF(__pyx_t_1);
37322 __pyx_t_4 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__fetch); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37323 __Pyx_GOTREF(__pyx_t_4);
37324 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37325 __pyx_t_1 = __Pyx_GetAttrString(__pyx_t_4, "__doc__"); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37326 __Pyx_GOTREF(__pyx_t_1);
37327 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
37328 if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_kp_u_179), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37329 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37330 __pyx_t_1 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Samfile); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37331 __Pyx_GOTREF(__pyx_t_1);
37332 __pyx_t_4 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s___isOpen); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37333 __Pyx_GOTREF(__pyx_t_4);
37334 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37335 __pyx_t_1 = __Pyx_GetAttrString(__pyx_t_4, "__doc__"); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37336 __Pyx_GOTREF(__pyx_t_1);
37337 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
37338 if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_kp_u_180), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37339 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37340 __pyx_t_1 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Samfile); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37341 __Pyx_GOTREF(__pyx_t_1);
37342 __pyx_t_4 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s___hasIndex); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37343 __Pyx_GOTREF(__pyx_t_4);
37344 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37345 __pyx_t_1 = __Pyx_GetAttrString(__pyx_t_4, "__doc__"); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37346 __Pyx_GOTREF(__pyx_t_1);
37347 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
37348 if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_kp_u_181), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37349 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37350 __pyx_t_1 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Samfile); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37351 __Pyx_GOTREF(__pyx_t_1);
37352 __pyx_t_4 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s___open); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37353 __Pyx_GOTREF(__pyx_t_4);
37354 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37355 __pyx_t_1 = __Pyx_GetAttrString(__pyx_t_4, "__doc__"); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37356 __Pyx_GOTREF(__pyx_t_1);
37357 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
37358 if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_kp_u_182), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37359 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37360 __pyx_t_1 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Samfile); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37361 __Pyx_GOTREF(__pyx_t_1);
37362 __pyx_t_4 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__gettid); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37363 __Pyx_GOTREF(__pyx_t_4);
37364 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37365 __pyx_t_1 = __Pyx_GetAttrString(__pyx_t_4, "__doc__"); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37366 __Pyx_GOTREF(__pyx_t_1);
37367 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
37368 if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_kp_u_183), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37369 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37370 __pyx_t_1 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Samfile); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37371 __Pyx_GOTREF(__pyx_t_1);
37372 __pyx_t_4 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__getrname); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37373 __Pyx_GOTREF(__pyx_t_4);
37374 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37375 __pyx_t_1 = __Pyx_GetAttrString(__pyx_t_4, "__doc__"); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37376 __Pyx_GOTREF(__pyx_t_1);
37377 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
37378 if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_kp_u_184), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37379 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37380 __pyx_t_1 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Samfile); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37381 __Pyx_GOTREF(__pyx_t_1);
37382 __pyx_t_4 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s___parseRegion); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37383 __Pyx_GOTREF(__pyx_t_4);
37384 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37385 __pyx_t_1 = __Pyx_GetAttrString(__pyx_t_4, "__doc__"); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37386 __Pyx_GOTREF(__pyx_t_1);
37387 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
37388 if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_kp_u_185), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37389 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37390 __pyx_t_1 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Samfile); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37391 __Pyx_GOTREF(__pyx_t_1);
37392 __pyx_t_4 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__seek); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37393 __Pyx_GOTREF(__pyx_t_4);
37394 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37395 __pyx_t_1 = __Pyx_GetAttrString(__pyx_t_4, "__doc__"); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37396 __Pyx_GOTREF(__pyx_t_1);
37397 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
37398 if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_kp_u_186), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37399 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37400 __pyx_t_1 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Samfile); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37401 __Pyx_GOTREF(__pyx_t_1);
37402 __pyx_t_4 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__tell); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37403 __Pyx_GOTREF(__pyx_t_4);
37404 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37405 __pyx_t_1 = __Pyx_GetAttrString(__pyx_t_4, "__doc__"); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37406 __Pyx_GOTREF(__pyx_t_1);
37407 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
37408 if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_kp_u_187), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37409 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37410 __pyx_t_1 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Samfile); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37411 __Pyx_GOTREF(__pyx_t_1);
37412 __pyx_t_4 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__fetch); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37413 __Pyx_GOTREF(__pyx_t_4);
37414 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37415 __pyx_t_1 = __Pyx_GetAttrString(__pyx_t_4, "__doc__"); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37416 __Pyx_GOTREF(__pyx_t_1);
37417 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
37418 if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_kp_u_188), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37419 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37420 __pyx_t_1 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Samfile); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37421 __Pyx_GOTREF(__pyx_t_1);
37422 __pyx_t_4 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__mate); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37423 __Pyx_GOTREF(__pyx_t_4);
37424 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37425 __pyx_t_1 = __Pyx_GetAttrString(__pyx_t_4, "__doc__"); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37426 __Pyx_GOTREF(__pyx_t_1);
37427 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
37428 if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_kp_u_189), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37429 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37430 __pyx_t_1 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Samfile); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37431 __Pyx_GOTREF(__pyx_t_1);
37432 __pyx_t_4 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__count); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37433 __Pyx_GOTREF(__pyx_t_4);
37434 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37435 __pyx_t_1 = __Pyx_GetAttrString(__pyx_t_4, "__doc__"); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37436 __Pyx_GOTREF(__pyx_t_1);
37437 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
37438 if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_kp_u_190), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37439 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37440 __pyx_t_1 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Samfile); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37441 __Pyx_GOTREF(__pyx_t_1);
37442 __pyx_t_4 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__pileup); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37443 __Pyx_GOTREF(__pyx_t_4);
37444 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37445 __pyx_t_1 = __Pyx_GetAttrString(__pyx_t_4, "__doc__"); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37446 __Pyx_GOTREF(__pyx_t_1);
37447 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
37448 if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_kp_u_191), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37449 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37450 __pyx_t_1 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Samfile); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37451 __Pyx_GOTREF(__pyx_t_1);
37452 __pyx_t_4 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__close); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37453 __Pyx_GOTREF(__pyx_t_4);
37454 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37455 __pyx_t_1 = __Pyx_GetAttrString(__pyx_t_4, "__doc__"); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37456 __Pyx_GOTREF(__pyx_t_1);
37457 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
37458 if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_kp_u_192), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37459 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37460 __pyx_t_1 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Samfile); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37461 __Pyx_GOTREF(__pyx_t_1);
37462 __pyx_t_4 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__write); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37463 __Pyx_GOTREF(__pyx_t_4);
37464 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37465 __pyx_t_1 = __Pyx_GetAttrString(__pyx_t_4, "__doc__"); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37466 __Pyx_GOTREF(__pyx_t_1);
37467 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
37468 if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_kp_u_193), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37469 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37470 __pyx_t_1 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Samfile); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37471 __Pyx_GOTREF(__pyx_t_1);
37472 __pyx_t_4 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s___buildLine); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37473 __Pyx_GOTREF(__pyx_t_4);
37474 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37475 __pyx_t_1 = __Pyx_GetAttrString(__pyx_t_4, "__doc__"); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37476 __Pyx_GOTREF(__pyx_t_1);
37477 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
37478 if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_kp_u_194), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37479 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37480 __pyx_t_1 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Samfile); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37481 __Pyx_GOTREF(__pyx_t_1);
37482 __pyx_t_4 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s____next__); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37483 __Pyx_GOTREF(__pyx_t_4);
37484 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37485 __pyx_t_1 = __Pyx_GetAttrString(__pyx_t_4, "__doc__"); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37486 __Pyx_GOTREF(__pyx_t_1);
37487 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
37488 if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_kp_u_195), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37489 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37490 __pyx_t_1 = PyObject_GetAttr(__pyx_m, __pyx_n_s__IteratorRowRegion); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37491 __Pyx_GOTREF(__pyx_t_1);
37492 __pyx_t_4 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s____next__); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37493 __Pyx_GOTREF(__pyx_t_4);
37494 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37495 __pyx_t_1 = __Pyx_GetAttrString(__pyx_t_4, "__doc__"); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37496 __Pyx_GOTREF(__pyx_t_1);
37497 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
37498 if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_kp_u_196), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37499 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37500 __pyx_t_1 = PyObject_GetAttr(__pyx_m, __pyx_n_s__IteratorRowAll); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37501 __Pyx_GOTREF(__pyx_t_1);
37502 __pyx_t_4 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s____next__); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37503 __Pyx_GOTREF(__pyx_t_4);
37504 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37505 __pyx_t_1 = __Pyx_GetAttrString(__pyx_t_4, "__doc__"); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37506 __Pyx_GOTREF(__pyx_t_1);
37507 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
37508 if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_kp_u_197), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37509 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37510 __pyx_t_1 = PyObject_GetAttr(__pyx_m, __pyx_n_s__IteratorRowAllRefs); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37511 __Pyx_GOTREF(__pyx_t_1);
37512 __pyx_t_4 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s____next__); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37513 __Pyx_GOTREF(__pyx_t_4);
37514 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37515 __pyx_t_1 = __Pyx_GetAttrString(__pyx_t_4, "__doc__"); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37516 __Pyx_GOTREF(__pyx_t_1);
37517 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
37518 if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_kp_u_198), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37519 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37520 __pyx_t_1 = PyObject_GetAttr(__pyx_m, __pyx_n_s_200); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37521 __Pyx_GOTREF(__pyx_t_1);
37522 __pyx_t_4 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s____next__); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37523 __Pyx_GOTREF(__pyx_t_4);
37524 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37525 __pyx_t_1 = __Pyx_GetAttrString(__pyx_t_4, "__doc__"); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37526 __Pyx_GOTREF(__pyx_t_1);
37527 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
37528 if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_kp_u_199), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37529 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37530 __pyx_t_1 = PyObject_GetAttr(__pyx_m, __pyx_n_s__IteratorColumn); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37531 __Pyx_GOTREF(__pyx_t_1);
37532 __pyx_t_4 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__addReference); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37533 __Pyx_GOTREF(__pyx_t_4);
37534 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37535 __pyx_t_1 = __Pyx_GetAttrString(__pyx_t_4, "__doc__"); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37536 __Pyx_GOTREF(__pyx_t_1);
37537 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
37538 if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_kp_u_201), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37539 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37540 __pyx_t_1 = PyObject_GetAttr(__pyx_m, __pyx_n_s__IteratorColumn); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37541 __Pyx_GOTREF(__pyx_t_1);
37542 __pyx_t_4 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__hasReference); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37543 __Pyx_GOTREF(__pyx_t_4);
37544 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37545 __pyx_t_1 = __Pyx_GetAttrString(__pyx_t_4, "__doc__"); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37546 __Pyx_GOTREF(__pyx_t_1);
37547 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
37548 if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_kp_u_202), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37549 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37550 __pyx_t_1 = PyObject_GetAttr(__pyx_m, __pyx_n_s_204); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37551 __Pyx_GOTREF(__pyx_t_1);
37552 __pyx_t_4 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s____next__); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37553 __Pyx_GOTREF(__pyx_t_4);
37554 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37555 __pyx_t_1 = __Pyx_GetAttrString(__pyx_t_4, "__doc__"); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37556 __Pyx_GOTREF(__pyx_t_1);
37557 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
37558 if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_kp_u_203), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37559 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37560 __pyx_t_1 = PyObject_GetAttr(__pyx_m, __pyx_n_s_206); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37561 __Pyx_GOTREF(__pyx_t_1);
37562 __pyx_t_4 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s____next__); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37563 __Pyx_GOTREF(__pyx_t_4);
37564 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37565 __pyx_t_1 = __Pyx_GetAttrString(__pyx_t_4, "__doc__"); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37566 __Pyx_GOTREF(__pyx_t_1);
37567 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
37568 if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_kp_u_205), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37569 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37570 __pyx_t_1 = PyObject_GetAttr(__pyx_m, __pyx_n_s__AlignedRead); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37571 __Pyx_GOTREF(__pyx_t_1);
37572 __pyx_t_4 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s____str__); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37573 __Pyx_GOTREF(__pyx_t_4);
37574 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37575 __pyx_t_1 = __Pyx_GetAttrString(__pyx_t_4, "__doc__"); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37576 __Pyx_GOTREF(__pyx_t_1);
37577 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
37578 if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_kp_u_207), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37579 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37580 __pyx_t_1 = PyObject_GetAttr(__pyx_m, __pyx_n_s__AlignedRead); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37581 __Pyx_GOTREF(__pyx_t_1);
37582 __pyx_t_4 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__compare); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37583 __Pyx_GOTREF(__pyx_t_4);
37584 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37585 __pyx_t_1 = __Pyx_GetAttrString(__pyx_t_4, "__doc__"); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37586 __Pyx_GOTREF(__pyx_t_1);
37587 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
37588 if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_kp_u_208), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37589 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37590 __pyx_t_1 = PyObject_GetAttr(__pyx_m, __pyx_n_s__AlignedRead); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37591 __Pyx_GOTREF(__pyx_t_1);
37592 __pyx_t_4 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__overlap); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37593 __Pyx_GOTREF(__pyx_t_4);
37594 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37595 __pyx_t_1 = __Pyx_GetAttrString(__pyx_t_4, "__doc__"); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37596 __Pyx_GOTREF(__pyx_t_1);
37597 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
37598 if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_kp_u_209), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37599 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37600 __pyx_t_1 = PyObject_GetAttr(__pyx_m, __pyx_n_s__AlignedRead); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37601 __Pyx_GOTREF(__pyx_t_1);
37602 __pyx_t_4 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__opt); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37603 __Pyx_GOTREF(__pyx_t_4);
37604 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37605 __pyx_t_1 = __Pyx_GetAttrString(__pyx_t_4, "__doc__"); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37606 __Pyx_GOTREF(__pyx_t_1);
37607 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
37608 if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_kp_u_210), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37609 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37610 __pyx_t_1 = PyObject_GetAttr(__pyx_m, __pyx_n_s__AlignedRead); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37611 __Pyx_GOTREF(__pyx_t_1);
37612 __pyx_t_4 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__fancy_str); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37613 __Pyx_GOTREF(__pyx_t_4);
37614 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37615 __pyx_t_1 = __Pyx_GetAttrString(__pyx_t_4, "__doc__"); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37616 __Pyx_GOTREF(__pyx_t_1);
37617 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
37618 if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_kp_u_211), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37619 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37620 __pyx_t_1 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Outs); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37621 __Pyx_GOTREF(__pyx_t_1);
37622 __pyx_t_4 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__setdevice); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37623 __Pyx_GOTREF(__pyx_t_4);
37624 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37625 __pyx_t_1 = __Pyx_GetAttrString(__pyx_t_4, "__doc__"); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37626 __Pyx_GOTREF(__pyx_t_1);
37627 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
37628 if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_kp_u_212), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37629 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37630 __pyx_t_1 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Outs); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37631 __Pyx_GOTREF(__pyx_t_1);
37632 __pyx_t_4 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__setfile); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37633 __Pyx_GOTREF(__pyx_t_4);
37634 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37635 __pyx_t_1 = __Pyx_GetAttrString(__pyx_t_4, "__doc__"); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37636 __Pyx_GOTREF(__pyx_t_1);
37637 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
37638 if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_kp_u_213), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37639 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37640 __pyx_t_1 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Outs); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37641 __Pyx_GOTREF(__pyx_t_1);
37642 __pyx_t_4 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__restore); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37643 __Pyx_GOTREF(__pyx_t_4);
37644 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37645 __pyx_t_1 = __Pyx_GetAttrString(__pyx_t_4, "__doc__"); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37646 __Pyx_GOTREF(__pyx_t_1);
37647 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
37648 if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_kp_u_214), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37649 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37650 __pyx_t_1 = PyObject_GetAttr(__pyx_m, __pyx_n_s___samtools_dispatch); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37651 __Pyx_GOTREF(__pyx_t_1);
37652 __pyx_t_4 = __Pyx_GetAttrString(__pyx_t_1, "__doc__"); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37653 __Pyx_GOTREF(__pyx_t_4);
37654 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37655 if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_kp_u_215), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37656 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
37657 __pyx_t_4 = PyObject_GetAttr(__pyx_m, __pyx_n_s__IteratorSNPCalls); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37658 __Pyx_GOTREF(__pyx_t_4);
37659 __pyx_t_1 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s____next__); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37660 __Pyx_GOTREF(__pyx_t_1);
37661 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
37662 __pyx_t_4 = __Pyx_GetAttrString(__pyx_t_1, "__doc__"); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37663 __Pyx_GOTREF(__pyx_t_4);
37664 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37665 if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_kp_u_216), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37666 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
37667 __pyx_t_4 = PyObject_GetAttr(__pyx_m, __pyx_n_s__SNPCaller); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37668 __Pyx_GOTREF(__pyx_t_4);
37669 __pyx_t_1 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__call); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37670 __Pyx_GOTREF(__pyx_t_1);
37671 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
37672 __pyx_t_4 = __Pyx_GetAttrString(__pyx_t_1, "__doc__"); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37673 __Pyx_GOTREF(__pyx_t_4);
37674 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37675 if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_kp_u_217), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37676 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
37677 __pyx_t_4 = PyObject_GetAttr(__pyx_m, __pyx_n_s__IndelCaller); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37678 __Pyx_GOTREF(__pyx_t_4);
37679 __pyx_t_1 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__call); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37680 __Pyx_GOTREF(__pyx_t_1);
37681 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
37682 __pyx_t_4 = __Pyx_GetAttrString(__pyx_t_1, "__doc__"); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37683 __Pyx_GOTREF(__pyx_t_4);
37684 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37685 if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_kp_u_218), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37686 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
37687 __pyx_t_4 = PyObject_GetAttr(__pyx_m, __pyx_n_s__IteratorIndelCalls); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37688 __Pyx_GOTREF(__pyx_t_4);
37689 __pyx_t_1 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s____next__); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37690 __Pyx_GOTREF(__pyx_t_1);
37691 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
37692 __pyx_t_4 = __Pyx_GetAttrString(__pyx_t_1, "__doc__"); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37693 __Pyx_GOTREF(__pyx_t_4);
37694 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37695 if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_kp_u_219), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37696 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
37697 __pyx_t_4 = PyObject_GetAttr(__pyx_m, __pyx_n_s__IndexedReads); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37698 __Pyx_GOTREF(__pyx_t_4);
37699 __pyx_t_1 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__build); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37700 __Pyx_GOTREF(__pyx_t_1);
37701 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
37702 __pyx_t_4 = __Pyx_GetAttrString(__pyx_t_1, "__doc__"); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37703 __Pyx_GOTREF(__pyx_t_4);
37704 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37705 if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_kp_u_220), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37706 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
37707 if (PyObject_SetAttr(__pyx_m, __pyx_n_s____test__, ((PyObject *)__pyx_t_3)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37708 __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
37710 /* "/ifs/apps/apps/python-2.7.1/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/cpython/type.pxd":2
37712 * cdef extern from "Python.h": # <<<<<<<<<<<<<<
37713 * # The C structure of the objects used to describe built-in types.
37718 __Pyx_XDECREF(__pyx_t_1);
37719 __Pyx_XDECREF(__pyx_t_2);
37720 __Pyx_XDECREF(__pyx_t_3);
37721 __Pyx_XDECREF(__pyx_t_4);
37723 __Pyx_AddTraceback("init csamtools");
37724 Py_DECREF(__pyx_m); __pyx_m = 0;
37725 } else if (!PyErr_Occurred()) {
37726 PyErr_SetString(PyExc_ImportError, "init csamtools");
37729 __Pyx_RefNannyFinishContext();
37730 #if PY_MAJOR_VERSION < 3
37737 /* Runtime support code */
37739 static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) {
37741 result = PyObject_GetAttr(dict, name);
37743 PyErr_SetObject(PyExc_NameError, name);
37750 static int __Pyx_TraceSetupAndCall(PyCodeObject** code,
37751 PyFrameObject** frame,
37752 const char *funcname,
37753 const char *srcfile,
37755 if (*frame == NULL || !CYTHON_PROFILE_REUSE_FRAME) {
37756 if (*code == NULL) {
37757 *code = __Pyx_createFrameCodeObject(funcname, srcfile, firstlineno);
37758 if (*code == NULL) return 0;
37760 *frame = PyFrame_New(
37761 PyThreadState_GET(), /*PyThreadState *tstate*/
37762 *code, /*PyCodeObject *code*/
37763 PyModule_GetDict(__pyx_m), /*PyObject *globals*/
37764 0 /*PyObject *locals*/
37766 if (*frame == NULL) return 0;
37769 (*frame)->f_tstate = PyThreadState_GET();
37771 return PyThreadState_GET()->c_profilefunc(PyThreadState_GET()->c_profileobj, *frame, PyTrace_CALL, NULL) == 0;
37774 static PyCodeObject *__Pyx_createFrameCodeObject(const char *funcname, const char *srcfile, int firstlineno) {
37775 PyObject *py_srcfile = 0;
37776 PyObject *py_funcname = 0;
37777 PyCodeObject *py_code = 0;
37779 #if PY_MAJOR_VERSION < 3
37780 py_funcname = PyString_FromString(funcname);
37781 py_srcfile = PyString_FromString(srcfile);
37783 py_funcname = PyUnicode_FromString(funcname);
37784 py_srcfile = PyUnicode_FromString(srcfile);
37786 if (!py_funcname | !py_srcfile) goto bad;
37788 py_code = PyCode_New(
37789 0, /*int argcount,*/
37790 #if PY_MAJOR_VERSION >= 3
37791 0, /*int kwonlyargcount,*/
37793 0, /*int nlocals,*/
37794 0, /*int stacksize,*/
37796 __pyx_empty_bytes, /*PyObject *code,*/
37797 __pyx_empty_tuple, /*PyObject *consts,*/
37798 __pyx_empty_tuple, /*PyObject *names,*/
37799 __pyx_empty_tuple, /*PyObject *varnames,*/
37800 __pyx_empty_tuple, /*PyObject *freevars,*/
37801 __pyx_empty_tuple, /*PyObject *cellvars,*/
37802 py_srcfile, /*PyObject *filename,*/
37803 py_funcname, /*PyObject *name,*/
37804 firstlineno, /*int firstlineno,*/
37805 __pyx_empty_bytes /*PyObject *lnotab*/
37809 Py_XDECREF(py_srcfile);
37810 Py_XDECREF(py_funcname);
37815 #endif /* CYTHON_PROFILE */
37817 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
37818 if (unlikely(!type)) {
37819 PyErr_Format(PyExc_SystemError, "Missing type object");
37822 if (likely(PyObject_TypeCheck(obj, type)))
37824 PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
37825 Py_TYPE(obj)->tp_name, type->tp_name);
37829 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
37830 PyErr_Format(PyExc_ValueError,
37831 #if PY_VERSION_HEX < 0x02050000
37832 "need more than %d value%s to unpack", (int)index,
37834 "need more than %zd value%s to unpack", index,
37836 (index == 1) ? "" : "s");
37839 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
37840 PyErr_Format(PyExc_ValueError,
37841 #if PY_VERSION_HEX < 0x02050000
37842 "too many values to unpack (expected %d)", (int)expected);
37844 "too many values to unpack (expected %zd)", expected);
37848 static PyObject *__Pyx_UnpackItem(PyObject *iter, Py_ssize_t index) {
37850 if (!(item = PyIter_Next(iter))) {
37851 if (!PyErr_Occurred()) {
37852 __Pyx_RaiseNeedMoreValuesError(index);
37858 static int __Pyx_EndUnpack(PyObject *iter, Py_ssize_t expected) {
37860 if ((item = PyIter_Next(iter))) {
37862 __Pyx_RaiseTooManyValuesError(expected);
37865 else if (!PyErr_Occurred())
37871 static CYTHON_INLINE int __Pyx_CheckKeywordStrings(
37873 const char* function_name,
37877 Py_ssize_t pos = 0;
37878 while (PyDict_Next(kwdict, &pos, &key, 0)) {
37879 #if PY_MAJOR_VERSION < 3
37880 if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key)))
37882 if (unlikely(!PyUnicode_CheckExact(key)) && unlikely(!PyUnicode_Check(key)))
37884 goto invalid_keyword_type;
37886 if ((!kw_allowed) && unlikely(key))
37887 goto invalid_keyword;
37889 invalid_keyword_type:
37890 PyErr_Format(PyExc_TypeError,
37891 "%s() keywords must be strings", function_name);
37894 PyErr_Format(PyExc_TypeError,
37895 #if PY_MAJOR_VERSION < 3
37896 "%s() got an unexpected keyword argument '%s'",
37897 function_name, PyString_AsString(key));
37899 "%s() got an unexpected keyword argument '%U'",
37900 function_name, key);
37905 static void __Pyx_RaiseDoubleKeywordsError(
37906 const char* func_name,
37909 PyErr_Format(PyExc_TypeError,
37910 #if PY_MAJOR_VERSION >= 3
37911 "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
37913 "%s() got multiple values for keyword argument '%s'", func_name,
37914 PyString_AS_STRING(kw_name));
37918 static void __Pyx_RaiseArgtupleInvalid(
37919 const char* func_name,
37921 Py_ssize_t num_min,
37922 Py_ssize_t num_max,
37923 Py_ssize_t num_found)
37925 Py_ssize_t num_expected;
37926 const char *number, *more_or_less;
37928 if (num_found < num_min) {
37929 num_expected = num_min;
37930 more_or_less = "at least";
37932 num_expected = num_max;
37933 more_or_less = "at most";
37936 more_or_less = "exactly";
37938 number = (num_expected == 1) ? "" : "s";
37939 PyErr_Format(PyExc_TypeError,
37940 #if PY_VERSION_HEX < 0x02050000
37941 "%s() takes %s %d positional argument%s (%d given)",
37943 "%s() takes %s %zd positional argument%s (%zd given)",
37945 func_name, more_or_less, num_expected, number, num_found);
37948 static int __Pyx_ParseOptionalKeywords(
37950 PyObject **argnames[],
37952 PyObject *values[],
37953 Py_ssize_t num_pos_args,
37954 const char* function_name)
37956 PyObject *key = 0, *value = 0;
37957 Py_ssize_t pos = 0;
37959 PyObject*** first_kw_arg = argnames + num_pos_args;
37961 while (PyDict_Next(kwds, &pos, &key, &value)) {
37962 name = first_kw_arg;
37963 while (*name && (**name != key)) name++;
37965 values[name-argnames] = value;
37967 #if PY_MAJOR_VERSION < 3
37968 if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key))) {
37970 if (unlikely(!PyUnicode_CheckExact(key)) && unlikely(!PyUnicode_Check(key))) {
37972 goto invalid_keyword_type;
37974 for (name = first_kw_arg; *name; name++) {
37975 #if PY_MAJOR_VERSION >= 3
37976 if (PyUnicode_GET_SIZE(**name) == PyUnicode_GET_SIZE(key) &&
37977 PyUnicode_Compare(**name, key) == 0) break;
37979 if (PyString_GET_SIZE(**name) == PyString_GET_SIZE(key) &&
37980 _PyString_Eq(**name, key)) break;
37984 values[name-argnames] = value;
37986 /* unexpected keyword found */
37987 for (name=argnames; name != first_kw_arg; name++) {
37988 if (**name == key) goto arg_passed_twice;
37989 #if PY_MAJOR_VERSION >= 3
37990 if (PyUnicode_GET_SIZE(**name) == PyUnicode_GET_SIZE(key) &&
37991 PyUnicode_Compare(**name, key) == 0) goto arg_passed_twice;
37993 if (PyString_GET_SIZE(**name) == PyString_GET_SIZE(key) &&
37994 _PyString_Eq(**name, key)) goto arg_passed_twice;
37998 if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
38000 goto invalid_keyword;
38008 __Pyx_RaiseDoubleKeywordsError(function_name, **name);
38010 invalid_keyword_type:
38011 PyErr_Format(PyExc_TypeError,
38012 "%s() keywords must be strings", function_name);
38015 PyErr_Format(PyExc_TypeError,
38016 #if PY_MAJOR_VERSION < 3
38017 "%s() got an unexpected keyword argument '%s'",
38018 function_name, PyString_AsString(key));
38020 "%s() got an unexpected keyword argument '%U'",
38021 function_name, key);
38027 static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) {
38028 PyObject *tmp_type, *tmp_value, *tmp_tb;
38029 PyThreadState *tstate = PyThreadState_GET();
38031 tmp_type = tstate->curexc_type;
38032 tmp_value = tstate->curexc_value;
38033 tmp_tb = tstate->curexc_traceback;
38034 tstate->curexc_type = type;
38035 tstate->curexc_value = value;
38036 tstate->curexc_traceback = tb;
38037 Py_XDECREF(tmp_type);
38038 Py_XDECREF(tmp_value);
38039 Py_XDECREF(tmp_tb);
38042 static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) {
38043 PyThreadState *tstate = PyThreadState_GET();
38044 *type = tstate->curexc_type;
38045 *value = tstate->curexc_value;
38046 *tb = tstate->curexc_traceback;
38048 tstate->curexc_type = 0;
38049 tstate->curexc_value = 0;
38050 tstate->curexc_traceback = 0;
38054 static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
38055 const char *name, int exact)
38058 PyErr_Format(PyExc_SystemError, "Missing type object");
38061 if (none_allowed && obj == Py_None) return 1;
38063 if (Py_TYPE(obj) == type) return 1;
38066 if (PyObject_TypeCheck(obj, type)) return 1;
38068 PyErr_Format(PyExc_TypeError,
38069 "Argument '%s' has incorrect type (expected %s, got %s)",
38070 name, type->tp_name, Py_TYPE(obj)->tp_name);
38074 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) {
38075 PyObject *local_type, *local_value, *local_tb;
38076 PyObject *tmp_type, *tmp_value, *tmp_tb;
38077 PyThreadState *tstate = PyThreadState_GET();
38078 local_type = tstate->curexc_type;
38079 local_value = tstate->curexc_value;
38080 local_tb = tstate->curexc_traceback;
38081 tstate->curexc_type = 0;
38082 tstate->curexc_value = 0;
38083 tstate->curexc_traceback = 0;
38084 PyErr_NormalizeException(&local_type, &local_value, &local_tb);
38085 if (unlikely(tstate->curexc_type))
38087 #if PY_MAJOR_VERSION >= 3
38088 if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
38091 *type = local_type;
38092 *value = local_value;
38094 Py_INCREF(local_type);
38095 Py_INCREF(local_value);
38096 Py_INCREF(local_tb);
38097 tmp_type = tstate->exc_type;
38098 tmp_value = tstate->exc_value;
38099 tmp_tb = tstate->exc_traceback;
38100 tstate->exc_type = local_type;
38101 tstate->exc_value = local_value;
38102 tstate->exc_traceback = local_tb;
38103 /* Make sure tstate is in a consistent state when we XDECREF
38104 these objects (XDECREF may run arbitrary code). */
38105 Py_XDECREF(tmp_type);
38106 Py_XDECREF(tmp_value);
38107 Py_XDECREF(tmp_tb);
38113 Py_XDECREF(local_type);
38114 Py_XDECREF(local_value);
38115 Py_XDECREF(local_tb);
38121 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
38122 PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
38125 static CYTHON_INLINE void __Pyx_RaiseNoneIndexingError(void) {
38126 PyErr_SetString(PyExc_TypeError, "'NoneType' object is unsubscriptable");
38129 static CYTHON_INLINE long __Pyx_div_long(long a, long b) {
38132 q -= ((r != 0) & ((r ^ b) < 0));
38136 static CYTHON_INLINE long __Pyx_mod_long(long a, long b) {
38138 r += ((r != 0) & ((r ^ b) < 0)) * b;
38143 static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb) {
38144 PyThreadState *tstate = PyThreadState_GET();
38145 *type = tstate->exc_type;
38146 *value = tstate->exc_value;
38147 *tb = tstate->exc_traceback;
38149 Py_XINCREF(*value);
38153 static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb) {
38154 PyObject *tmp_type, *tmp_value, *tmp_tb;
38155 PyThreadState *tstate = PyThreadState_GET();
38156 tmp_type = tstate->exc_type;
38157 tmp_value = tstate->exc_value;
38158 tmp_tb = tstate->exc_traceback;
38159 tstate->exc_type = type;
38160 tstate->exc_value = value;
38161 tstate->exc_traceback = tb;
38162 Py_XDECREF(tmp_type);
38163 Py_XDECREF(tmp_value);
38164 Py_XDECREF(tmp_tb);
38167 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list) {
38168 PyObject *py_import = 0;
38169 PyObject *empty_list = 0;
38170 PyObject *module = 0;
38171 PyObject *global_dict = 0;
38172 PyObject *empty_dict = 0;
38174 py_import = __Pyx_GetAttrString(__pyx_b, "__import__");
38180 empty_list = PyList_New(0);
38185 global_dict = PyModule_GetDict(__pyx_m);
38188 empty_dict = PyDict_New();
38191 module = PyObject_CallFunctionObjArgs(py_import,
38192 name, global_dict, empty_dict, list, NULL);
38194 Py_XDECREF(empty_list);
38195 Py_XDECREF(py_import);
38196 Py_XDECREF(empty_dict);
38200 static PyObject *__Pyx_CreateClass(
38201 PyObject *bases, PyObject *dict, PyObject *name, const char *modname)
38203 PyObject *py_modname;
38204 PyObject *result = 0;
38206 #if PY_MAJOR_VERSION < 3
38207 py_modname = PyString_FromString(modname);
38209 py_modname = PyUnicode_FromString(modname);
38213 if (PyDict_SetItemString(dict, "__module__", py_modname) < 0)
38215 #if PY_MAJOR_VERSION < 3
38216 result = PyClass_New(bases, dict, name);
38218 result = PyObject_CallFunctionObjArgs((PyObject *)&PyType_Type, name, bases, dict, NULL);
38221 Py_XDECREF(py_modname);
38225 static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_uint32_t(uint32_t val) {
38226 const uint32_t neg_one = (uint32_t)-1, const_zero = (uint32_t)0;
38227 const int is_unsigned = const_zero < neg_one;
38228 if ((sizeof(uint32_t) == sizeof(char)) ||
38229 (sizeof(uint32_t) == sizeof(short))) {
38230 return PyInt_FromLong((long)val);
38231 } else if ((sizeof(uint32_t) == sizeof(int)) ||
38232 (sizeof(uint32_t) == sizeof(long))) {
38234 return PyLong_FromUnsignedLong((unsigned long)val);
38236 return PyInt_FromLong((long)val);
38237 } else if (sizeof(uint32_t) == sizeof(PY_LONG_LONG)) {
38239 return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG)val);
38241 return PyLong_FromLongLong((PY_LONG_LONG)val);
38243 int one = 1; int little = (int)*(unsigned char *)&one;
38244 unsigned char *bytes = (unsigned char *)&val;
38245 return _PyLong_FromByteArray(bytes, sizeof(uint32_t),
38246 little, !is_unsigned);
38250 #if PY_MAJOR_VERSION < 3
38251 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) {
38255 /* First, check the traceback argument, replacing None with NULL. */
38256 if (tb == Py_None) {
38260 else if (tb != NULL && !PyTraceBack_Check(tb)) {
38261 PyErr_SetString(PyExc_TypeError,
38262 "raise: arg 3 must be a traceback or None");
38265 /* Next, replace a missing value with None */
38266 if (value == NULL) {
38270 #if PY_VERSION_HEX < 0x02050000
38271 if (!PyClass_Check(type))
38273 if (!PyType_Check(type))
38276 /* Raising an instance. The value should be a dummy. */
38277 if (value != Py_None) {
38278 PyErr_SetString(PyExc_TypeError,
38279 "instance exception may not have a separate value");
38282 /* Normalize to raise <class>, <instance> */
38285 #if PY_VERSION_HEX < 0x02050000
38286 if (PyInstance_Check(type)) {
38287 type = (PyObject*) ((PyInstanceObject*)type)->in_class;
38292 PyErr_SetString(PyExc_TypeError,
38293 "raise: exception must be an old-style class or instance");
38297 type = (PyObject*) Py_TYPE(type);
38299 if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
38300 PyErr_SetString(PyExc_TypeError,
38301 "raise: exception class must be a subclass of BaseException");
38307 __Pyx_ErrRestore(type, value, tb);
38316 #else /* Python 3+ */
38318 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) {
38319 if (tb == Py_None) {
38321 } else if (tb && !PyTraceBack_Check(tb)) {
38322 PyErr_SetString(PyExc_TypeError,
38323 "raise: arg 3 must be a traceback or None");
38326 if (value == Py_None)
38329 if (PyExceptionInstance_Check(type)) {
38331 PyErr_SetString(PyExc_TypeError,
38332 "instance exception may not have a separate value");
38336 type = (PyObject*) Py_TYPE(value);
38337 } else if (!PyExceptionClass_Check(type)) {
38338 PyErr_SetString(PyExc_TypeError,
38339 "raise: exception class must be a subclass of BaseException");
38343 PyErr_SetObject(type, value);
38346 PyThreadState *tstate = PyThreadState_GET();
38347 PyObject* tmp_tb = tstate->curexc_traceback;
38348 if (tb != tmp_tb) {
38350 tstate->curexc_traceback = tb;
38351 Py_XDECREF(tmp_tb);
38360 static CYTHON_INLINE uint32_t __Pyx_PyInt_from_py_uint32_t(PyObject* x) {
38361 const uint32_t neg_one = (uint32_t)-1, const_zero = (uint32_t)0;
38362 const int is_unsigned = const_zero < neg_one;
38363 if (sizeof(uint32_t) == sizeof(char)) {
38365 return (uint32_t)__Pyx_PyInt_AsUnsignedChar(x);
38367 return (uint32_t)__Pyx_PyInt_AsSignedChar(x);
38368 } else if (sizeof(uint32_t) == sizeof(short)) {
38370 return (uint32_t)__Pyx_PyInt_AsUnsignedShort(x);
38372 return (uint32_t)__Pyx_PyInt_AsSignedShort(x);
38373 } else if (sizeof(uint32_t) == sizeof(int)) {
38375 return (uint32_t)__Pyx_PyInt_AsUnsignedInt(x);
38377 return (uint32_t)__Pyx_PyInt_AsSignedInt(x);
38378 } else if (sizeof(uint32_t) == sizeof(long)) {
38380 return (uint32_t)__Pyx_PyInt_AsUnsignedLong(x);
38382 return (uint32_t)__Pyx_PyInt_AsSignedLong(x);
38383 } else if (sizeof(uint32_t) == sizeof(PY_LONG_LONG)) {
38385 return (uint32_t)__Pyx_PyInt_AsUnsignedLongLong(x);
38387 return (uint32_t)__Pyx_PyInt_AsSignedLongLong(x);
38390 PyObject *v = __Pyx_PyNumber_Int(x);
38391 #if PY_VERSION_HEX < 0x03000000
38392 if (likely(v) && !PyLong_Check(v)) {
38394 v = PyNumber_Long(tmp);
38399 int one = 1; int is_little = (int)*(unsigned char *)&one;
38400 unsigned char *bytes = (unsigned char *)&val;
38401 int ret = _PyLong_AsByteArray((PyLongObject *)v,
38402 bytes, sizeof(val),
38403 is_little, !is_unsigned);
38408 return (uint32_t)-1;
38412 static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_int32_t(int32_t val) {
38413 const int32_t neg_one = (int32_t)-1, const_zero = (int32_t)0;
38414 const int is_unsigned = const_zero < neg_one;
38415 if ((sizeof(int32_t) == sizeof(char)) ||
38416 (sizeof(int32_t) == sizeof(short))) {
38417 return PyInt_FromLong((long)val);
38418 } else if ((sizeof(int32_t) == sizeof(int)) ||
38419 (sizeof(int32_t) == sizeof(long))) {
38421 return PyLong_FromUnsignedLong((unsigned long)val);
38423 return PyInt_FromLong((long)val);
38424 } else if (sizeof(int32_t) == sizeof(PY_LONG_LONG)) {
38426 return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG)val);
38428 return PyLong_FromLongLong((PY_LONG_LONG)val);
38430 int one = 1; int little = (int)*(unsigned char *)&one;
38431 unsigned char *bytes = (unsigned char *)&val;
38432 return _PyLong_FromByteArray(bytes, sizeof(int32_t),
38433 little, !is_unsigned);
38437 static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_int64_t(int64_t val) {
38438 const int64_t neg_one = (int64_t)-1, const_zero = (int64_t)0;
38439 const int is_unsigned = const_zero < neg_one;
38440 if ((sizeof(int64_t) == sizeof(char)) ||
38441 (sizeof(int64_t) == sizeof(short))) {
38442 return PyInt_FromLong((long)val);
38443 } else if ((sizeof(int64_t) == sizeof(int)) ||
38444 (sizeof(int64_t) == sizeof(long))) {
38446 return PyLong_FromUnsignedLong((unsigned long)val);
38448 return PyInt_FromLong((long)val);
38449 } else if (sizeof(int64_t) == sizeof(PY_LONG_LONG)) {
38451 return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG)val);
38453 return PyLong_FromLongLong((PY_LONG_LONG)val);
38455 int one = 1; int little = (int)*(unsigned char *)&one;
38456 unsigned char *bytes = (unsigned char *)&val;
38457 return _PyLong_FromByteArray(bytes, sizeof(int64_t),
38458 little, !is_unsigned);
38462 static CYTHON_INLINE uint64_t __Pyx_PyInt_from_py_uint64_t(PyObject* x) {
38463 const uint64_t neg_one = (uint64_t)-1, const_zero = (uint64_t)0;
38464 const int is_unsigned = const_zero < neg_one;
38465 if (sizeof(uint64_t) == sizeof(char)) {
38467 return (uint64_t)__Pyx_PyInt_AsUnsignedChar(x);
38469 return (uint64_t)__Pyx_PyInt_AsSignedChar(x);
38470 } else if (sizeof(uint64_t) == sizeof(short)) {
38472 return (uint64_t)__Pyx_PyInt_AsUnsignedShort(x);
38474 return (uint64_t)__Pyx_PyInt_AsSignedShort(x);
38475 } else if (sizeof(uint64_t) == sizeof(int)) {
38477 return (uint64_t)__Pyx_PyInt_AsUnsignedInt(x);
38479 return (uint64_t)__Pyx_PyInt_AsSignedInt(x);
38480 } else if (sizeof(uint64_t) == sizeof(long)) {
38482 return (uint64_t)__Pyx_PyInt_AsUnsignedLong(x);
38484 return (uint64_t)__Pyx_PyInt_AsSignedLong(x);
38485 } else if (sizeof(uint64_t) == sizeof(PY_LONG_LONG)) {
38487 return (uint64_t)__Pyx_PyInt_AsUnsignedLongLong(x);
38489 return (uint64_t)__Pyx_PyInt_AsSignedLongLong(x);
38492 PyObject *v = __Pyx_PyNumber_Int(x);
38493 #if PY_VERSION_HEX < 0x03000000
38494 if (likely(v) && !PyLong_Check(v)) {
38496 v = PyNumber_Long(tmp);
38501 int one = 1; int is_little = (int)*(unsigned char *)&one;
38502 unsigned char *bytes = (unsigned char *)&val;
38503 int ret = _PyLong_AsByteArray((PyLongObject *)v,
38504 bytes, sizeof(val),
38505 is_little, !is_unsigned);
38510 return (uint64_t)-1;
38514 static CYTHON_INLINE int32_t __Pyx_PyInt_from_py_int32_t(PyObject* x) {
38515 const int32_t neg_one = (int32_t)-1, const_zero = (int32_t)0;
38516 const int is_unsigned = const_zero < neg_one;
38517 if (sizeof(int32_t) == sizeof(char)) {
38519 return (int32_t)__Pyx_PyInt_AsUnsignedChar(x);
38521 return (int32_t)__Pyx_PyInt_AsSignedChar(x);
38522 } else if (sizeof(int32_t) == sizeof(short)) {
38524 return (int32_t)__Pyx_PyInt_AsUnsignedShort(x);
38526 return (int32_t)__Pyx_PyInt_AsSignedShort(x);
38527 } else if (sizeof(int32_t) == sizeof(int)) {
38529 return (int32_t)__Pyx_PyInt_AsUnsignedInt(x);
38531 return (int32_t)__Pyx_PyInt_AsSignedInt(x);
38532 } else if (sizeof(int32_t) == sizeof(long)) {
38534 return (int32_t)__Pyx_PyInt_AsUnsignedLong(x);
38536 return (int32_t)__Pyx_PyInt_AsSignedLong(x);
38537 } else if (sizeof(int32_t) == sizeof(PY_LONG_LONG)) {
38539 return (int32_t)__Pyx_PyInt_AsUnsignedLongLong(x);
38541 return (int32_t)__Pyx_PyInt_AsSignedLongLong(x);
38544 PyObject *v = __Pyx_PyNumber_Int(x);
38545 #if PY_VERSION_HEX < 0x03000000
38546 if (likely(v) && !PyLong_Check(v)) {
38548 v = PyNumber_Long(tmp);
38553 int one = 1; int is_little = (int)*(unsigned char *)&one;
38554 unsigned char *bytes = (unsigned char *)&val;
38555 int ret = _PyLong_AsByteArray((PyLongObject *)v,
38556 bytes, sizeof(val),
38557 is_little, !is_unsigned);
38562 return (int32_t)-1;
38566 static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_uint8_t(uint8_t val) {
38567 const uint8_t neg_one = (uint8_t)-1, const_zero = (uint8_t)0;
38568 const int is_unsigned = const_zero < neg_one;
38569 if ((sizeof(uint8_t) == sizeof(char)) ||
38570 (sizeof(uint8_t) == sizeof(short))) {
38571 return PyInt_FromLong((long)val);
38572 } else if ((sizeof(uint8_t) == sizeof(int)) ||
38573 (sizeof(uint8_t) == sizeof(long))) {
38575 return PyLong_FromUnsignedLong((unsigned long)val);
38577 return PyInt_FromLong((long)val);
38578 } else if (sizeof(uint8_t) == sizeof(PY_LONG_LONG)) {
38580 return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG)val);
38582 return PyLong_FromLongLong((PY_LONG_LONG)val);
38584 int one = 1; int little = (int)*(unsigned char *)&one;
38585 unsigned char *bytes = (unsigned char *)&val;
38586 return _PyLong_FromByteArray(bytes, sizeof(uint8_t),
38587 little, !is_unsigned);
38591 #if PY_MAJOR_VERSION < 3
38592 static PyObject *__Pyx_GetStdout(void) {
38593 PyObject *f = PySys_GetObject((char *)"stdout");
38595 PyErr_SetString(PyExc_RuntimeError, "lost sys.stdout");
38600 static int __Pyx_Print(PyObject* f, PyObject *arg_tuple, int newline) {
38605 if (!(f = __Pyx_GetStdout()))
38608 for (i=0; i < PyTuple_GET_SIZE(arg_tuple); i++) {
38609 if (PyFile_SoftSpace(f, 1)) {
38610 if (PyFile_WriteString(" ", f) < 0)
38613 v = PyTuple_GET_ITEM(arg_tuple, i);
38614 if (PyFile_WriteObject(v, f, Py_PRINT_RAW) < 0)
38616 if (PyString_Check(v)) {
38617 char *s = PyString_AsString(v);
38618 Py_ssize_t len = PyString_Size(v);
38620 isspace(Py_CHARMASK(s[len-1])) &&
38622 PyFile_SoftSpace(f, 0);
38626 if (PyFile_WriteString("\n", f) < 0)
38628 PyFile_SoftSpace(f, 0);
38633 #else /* Python 3 has a print function */
38635 static int __Pyx_Print(PyObject* stream, PyObject *arg_tuple, int newline) {
38636 PyObject* kwargs = 0;
38637 PyObject* result = 0;
38638 PyObject* end_string;
38639 if (unlikely(!__pyx_print)) {
38640 __pyx_print = __Pyx_GetAttrString(__pyx_b, "print");
38645 kwargs = PyDict_New();
38646 if (unlikely(!kwargs))
38648 if (unlikely(PyDict_SetItemString(kwargs, "file", stream) < 0))
38651 end_string = PyUnicode_FromStringAndSize(" ", 1);
38652 if (unlikely(!end_string))
38654 if (PyDict_SetItemString(kwargs, "end", end_string) < 0) {
38655 Py_DECREF(end_string);
38658 Py_DECREF(end_string);
38660 } else if (!newline) {
38661 if (unlikely(!__pyx_print_kwargs)) {
38662 __pyx_print_kwargs = PyDict_New();
38663 if (unlikely(!__pyx_print_kwargs))
38665 end_string = PyUnicode_FromStringAndSize(" ", 1);
38666 if (unlikely(!end_string))
38668 if (PyDict_SetItemString(__pyx_print_kwargs, "end", end_string) < 0) {
38669 Py_DECREF(end_string);
38672 Py_DECREF(end_string);
38674 kwargs = __pyx_print_kwargs;
38676 result = PyObject_Call(__pyx_print, arg_tuple, kwargs);
38677 if (unlikely(kwargs) && (kwargs != __pyx_print_kwargs))
38684 if (kwargs != __pyx_print_kwargs)
38685 Py_XDECREF(kwargs);
38691 #if PY_MAJOR_VERSION < 3
38693 static int __Pyx_PrintOne(PyObject* f, PyObject *o) {
38695 if (!(f = __Pyx_GetStdout()))
38698 if (PyFile_SoftSpace(f, 0)) {
38699 if (PyFile_WriteString(" ", f) < 0)
38702 if (PyFile_WriteObject(o, f, Py_PRINT_RAW) < 0)
38704 if (PyFile_WriteString("\n", f) < 0)
38707 /* the line below is just to avoid compiler
38708 * compiler warnings about unused functions */
38709 return __Pyx_Print(f, NULL, 0);
38712 #else /* Python 3 has a print function */
38714 static int __Pyx_PrintOne(PyObject* stream, PyObject *o) {
38716 PyObject* arg_tuple = PyTuple_New(1);
38717 if (unlikely(!arg_tuple))
38720 PyTuple_SET_ITEM(arg_tuple, 0, o);
38721 res = __Pyx_Print(stream, arg_tuple, 1);
38722 Py_DECREF(arg_tuple);
38728 static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_uint64_t(uint64_t val) {
38729 const uint64_t neg_one = (uint64_t)-1, const_zero = (uint64_t)0;
38730 const int is_unsigned = const_zero < neg_one;
38731 if ((sizeof(uint64_t) == sizeof(char)) ||
38732 (sizeof(uint64_t) == sizeof(short))) {
38733 return PyInt_FromLong((long)val);
38734 } else if ((sizeof(uint64_t) == sizeof(int)) ||
38735 (sizeof(uint64_t) == sizeof(long))) {
38737 return PyLong_FromUnsignedLong((unsigned long)val);
38739 return PyInt_FromLong((long)val);
38740 } else if (sizeof(uint64_t) == sizeof(PY_LONG_LONG)) {
38742 return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG)val);
38744 return PyLong_FromLongLong((PY_LONG_LONG)val);
38746 int one = 1; int little = (int)*(unsigned char *)&one;
38747 unsigned char *bytes = (unsigned char *)&val;
38748 return _PyLong_FromByteArray(bytes, sizeof(uint64_t),
38749 little, !is_unsigned);
38753 static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject* x) {
38754 const unsigned char neg_one = (unsigned char)-1, const_zero = 0;
38755 const int is_unsigned = neg_one > const_zero;
38756 if (sizeof(unsigned char) < sizeof(long)) {
38757 long val = __Pyx_PyInt_AsLong(x);
38758 if (unlikely(val != (long)(unsigned char)val)) {
38759 if (!unlikely(val == -1 && PyErr_Occurred())) {
38760 PyErr_SetString(PyExc_OverflowError,
38761 (is_unsigned && unlikely(val < 0)) ?
38762 "can't convert negative value to unsigned char" :
38763 "value too large to convert to unsigned char");
38765 return (unsigned char)-1;
38767 return (unsigned char)val;
38769 return (unsigned char)__Pyx_PyInt_AsUnsignedLong(x);
38772 static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject* x) {
38773 const unsigned short neg_one = (unsigned short)-1, const_zero = 0;
38774 const int is_unsigned = neg_one > const_zero;
38775 if (sizeof(unsigned short) < sizeof(long)) {
38776 long val = __Pyx_PyInt_AsLong(x);
38777 if (unlikely(val != (long)(unsigned short)val)) {
38778 if (!unlikely(val == -1 && PyErr_Occurred())) {
38779 PyErr_SetString(PyExc_OverflowError,
38780 (is_unsigned && unlikely(val < 0)) ?
38781 "can't convert negative value to unsigned short" :
38782 "value too large to convert to unsigned short");
38784 return (unsigned short)-1;
38786 return (unsigned short)val;
38788 return (unsigned short)__Pyx_PyInt_AsUnsignedLong(x);
38791 static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject* x) {
38792 const unsigned int neg_one = (unsigned int)-1, const_zero = 0;
38793 const int is_unsigned = neg_one > const_zero;
38794 if (sizeof(unsigned int) < sizeof(long)) {
38795 long val = __Pyx_PyInt_AsLong(x);
38796 if (unlikely(val != (long)(unsigned int)val)) {
38797 if (!unlikely(val == -1 && PyErr_Occurred())) {
38798 PyErr_SetString(PyExc_OverflowError,
38799 (is_unsigned && unlikely(val < 0)) ?
38800 "can't convert negative value to unsigned int" :
38801 "value too large to convert to unsigned int");
38803 return (unsigned int)-1;
38805 return (unsigned int)val;
38807 return (unsigned int)__Pyx_PyInt_AsUnsignedLong(x);
38810 static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject* x) {
38811 const char neg_one = (char)-1, const_zero = 0;
38812 const int is_unsigned = neg_one > const_zero;
38813 if (sizeof(char) < sizeof(long)) {
38814 long val = __Pyx_PyInt_AsLong(x);
38815 if (unlikely(val != (long)(char)val)) {
38816 if (!unlikely(val == -1 && PyErr_Occurred())) {
38817 PyErr_SetString(PyExc_OverflowError,
38818 (is_unsigned && unlikely(val < 0)) ?
38819 "can't convert negative value to char" :
38820 "value too large to convert to char");
38826 return (char)__Pyx_PyInt_AsLong(x);
38829 static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject* x) {
38830 const short neg_one = (short)-1, const_zero = 0;
38831 const int is_unsigned = neg_one > const_zero;
38832 if (sizeof(short) < sizeof(long)) {
38833 long val = __Pyx_PyInt_AsLong(x);
38834 if (unlikely(val != (long)(short)val)) {
38835 if (!unlikely(val == -1 && PyErr_Occurred())) {
38836 PyErr_SetString(PyExc_OverflowError,
38837 (is_unsigned && unlikely(val < 0)) ?
38838 "can't convert negative value to short" :
38839 "value too large to convert to short");
38845 return (short)__Pyx_PyInt_AsLong(x);
38848 static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject* x) {
38849 const int neg_one = (int)-1, const_zero = 0;
38850 const int is_unsigned = neg_one > const_zero;
38851 if (sizeof(int) < sizeof(long)) {
38852 long val = __Pyx_PyInt_AsLong(x);
38853 if (unlikely(val != (long)(int)val)) {
38854 if (!unlikely(val == -1 && PyErr_Occurred())) {
38855 PyErr_SetString(PyExc_OverflowError,
38856 (is_unsigned && unlikely(val < 0)) ?
38857 "can't convert negative value to int" :
38858 "value too large to convert to int");
38864 return (int)__Pyx_PyInt_AsLong(x);
38867 static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject* x) {
38868 const signed char neg_one = (signed char)-1, const_zero = 0;
38869 const int is_unsigned = neg_one > const_zero;
38870 if (sizeof(signed char) < sizeof(long)) {
38871 long val = __Pyx_PyInt_AsLong(x);
38872 if (unlikely(val != (long)(signed char)val)) {
38873 if (!unlikely(val == -1 && PyErr_Occurred())) {
38874 PyErr_SetString(PyExc_OverflowError,
38875 (is_unsigned && unlikely(val < 0)) ?
38876 "can't convert negative value to signed char" :
38877 "value too large to convert to signed char");
38879 return (signed char)-1;
38881 return (signed char)val;
38883 return (signed char)__Pyx_PyInt_AsSignedLong(x);
38886 static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject* x) {
38887 const signed short neg_one = (signed short)-1, const_zero = 0;
38888 const int is_unsigned = neg_one > const_zero;
38889 if (sizeof(signed short) < sizeof(long)) {
38890 long val = __Pyx_PyInt_AsLong(x);
38891 if (unlikely(val != (long)(signed short)val)) {
38892 if (!unlikely(val == -1 && PyErr_Occurred())) {
38893 PyErr_SetString(PyExc_OverflowError,
38894 (is_unsigned && unlikely(val < 0)) ?
38895 "can't convert negative value to signed short" :
38896 "value too large to convert to signed short");
38898 return (signed short)-1;
38900 return (signed short)val;
38902 return (signed short)__Pyx_PyInt_AsSignedLong(x);
38905 static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject* x) {
38906 const signed int neg_one = (signed int)-1, const_zero = 0;
38907 const int is_unsigned = neg_one > const_zero;
38908 if (sizeof(signed int) < sizeof(long)) {
38909 long val = __Pyx_PyInt_AsLong(x);
38910 if (unlikely(val != (long)(signed int)val)) {
38911 if (!unlikely(val == -1 && PyErr_Occurred())) {
38912 PyErr_SetString(PyExc_OverflowError,
38913 (is_unsigned && unlikely(val < 0)) ?
38914 "can't convert negative value to signed int" :
38915 "value too large to convert to signed int");
38917 return (signed int)-1;
38919 return (signed int)val;
38921 return (signed int)__Pyx_PyInt_AsSignedLong(x);
38924 static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject* x) {
38925 const int neg_one = (int)-1, const_zero = 0;
38926 const int is_unsigned = neg_one > const_zero;
38927 if (sizeof(int) < sizeof(long)) {
38928 long val = __Pyx_PyInt_AsLong(x);
38929 if (unlikely(val != (long)(int)val)) {
38930 if (!unlikely(val == -1 && PyErr_Occurred())) {
38931 PyErr_SetString(PyExc_OverflowError,
38932 (is_unsigned && unlikely(val < 0)) ?
38933 "can't convert negative value to int" :
38934 "value too large to convert to int");
38940 return (int)__Pyx_PyInt_AsLong(x);
38943 static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject* x) {
38944 const unsigned long neg_one = (unsigned long)-1, const_zero = 0;
38945 const int is_unsigned = neg_one > const_zero;
38946 #if PY_VERSION_HEX < 0x03000000
38947 if (likely(PyInt_Check(x))) {
38948 long val = PyInt_AS_LONG(x);
38949 if (is_unsigned && unlikely(val < 0)) {
38950 PyErr_SetString(PyExc_OverflowError,
38951 "can't convert negative value to unsigned long");
38952 return (unsigned long)-1;
38954 return (unsigned long)val;
38957 if (likely(PyLong_Check(x))) {
38959 if (unlikely(Py_SIZE(x) < 0)) {
38960 PyErr_SetString(PyExc_OverflowError,
38961 "can't convert negative value to unsigned long");
38962 return (unsigned long)-1;
38964 return PyLong_AsUnsignedLong(x);
38966 return PyLong_AsLong(x);
38970 PyObject *tmp = __Pyx_PyNumber_Int(x);
38971 if (!tmp) return (unsigned long)-1;
38972 val = __Pyx_PyInt_AsUnsignedLong(tmp);
38978 static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject* x) {
38979 const unsigned PY_LONG_LONG neg_one = (unsigned PY_LONG_LONG)-1, const_zero = 0;
38980 const int is_unsigned = neg_one > const_zero;
38981 #if PY_VERSION_HEX < 0x03000000
38982 if (likely(PyInt_Check(x))) {
38983 long val = PyInt_AS_LONG(x);
38984 if (is_unsigned && unlikely(val < 0)) {
38985 PyErr_SetString(PyExc_OverflowError,
38986 "can't convert negative value to unsigned PY_LONG_LONG");
38987 return (unsigned PY_LONG_LONG)-1;
38989 return (unsigned PY_LONG_LONG)val;
38992 if (likely(PyLong_Check(x))) {
38994 if (unlikely(Py_SIZE(x) < 0)) {
38995 PyErr_SetString(PyExc_OverflowError,
38996 "can't convert negative value to unsigned PY_LONG_LONG");
38997 return (unsigned PY_LONG_LONG)-1;
38999 return PyLong_AsUnsignedLongLong(x);
39001 return PyLong_AsLongLong(x);
39004 unsigned PY_LONG_LONG val;
39005 PyObject *tmp = __Pyx_PyNumber_Int(x);
39006 if (!tmp) return (unsigned PY_LONG_LONG)-1;
39007 val = __Pyx_PyInt_AsUnsignedLongLong(tmp);
39013 static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject* x) {
39014 const long neg_one = (long)-1, const_zero = 0;
39015 const int is_unsigned = neg_one > const_zero;
39016 #if PY_VERSION_HEX < 0x03000000
39017 if (likely(PyInt_Check(x))) {
39018 long val = PyInt_AS_LONG(x);
39019 if (is_unsigned && unlikely(val < 0)) {
39020 PyErr_SetString(PyExc_OverflowError,
39021 "can't convert negative value to long");
39027 if (likely(PyLong_Check(x))) {
39029 if (unlikely(Py_SIZE(x) < 0)) {
39030 PyErr_SetString(PyExc_OverflowError,
39031 "can't convert negative value to long");
39034 return PyLong_AsUnsignedLong(x);
39036 return PyLong_AsLong(x);
39040 PyObject *tmp = __Pyx_PyNumber_Int(x);
39041 if (!tmp) return (long)-1;
39042 val = __Pyx_PyInt_AsLong(tmp);
39048 static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject* x) {
39049 const PY_LONG_LONG neg_one = (PY_LONG_LONG)-1, const_zero = 0;
39050 const int is_unsigned = neg_one > const_zero;
39051 #if PY_VERSION_HEX < 0x03000000
39052 if (likely(PyInt_Check(x))) {
39053 long val = PyInt_AS_LONG(x);
39054 if (is_unsigned && unlikely(val < 0)) {
39055 PyErr_SetString(PyExc_OverflowError,
39056 "can't convert negative value to PY_LONG_LONG");
39057 return (PY_LONG_LONG)-1;
39059 return (PY_LONG_LONG)val;
39062 if (likely(PyLong_Check(x))) {
39064 if (unlikely(Py_SIZE(x) < 0)) {
39065 PyErr_SetString(PyExc_OverflowError,
39066 "can't convert negative value to PY_LONG_LONG");
39067 return (PY_LONG_LONG)-1;
39069 return PyLong_AsUnsignedLongLong(x);
39071 return PyLong_AsLongLong(x);
39075 PyObject *tmp = __Pyx_PyNumber_Int(x);
39076 if (!tmp) return (PY_LONG_LONG)-1;
39077 val = __Pyx_PyInt_AsLongLong(tmp);
39083 static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject* x) {
39084 const signed long neg_one = (signed long)-1, const_zero = 0;
39085 const int is_unsigned = neg_one > const_zero;
39086 #if PY_VERSION_HEX < 0x03000000
39087 if (likely(PyInt_Check(x))) {
39088 long val = PyInt_AS_LONG(x);
39089 if (is_unsigned && unlikely(val < 0)) {
39090 PyErr_SetString(PyExc_OverflowError,
39091 "can't convert negative value to signed long");
39092 return (signed long)-1;
39094 return (signed long)val;
39097 if (likely(PyLong_Check(x))) {
39099 if (unlikely(Py_SIZE(x) < 0)) {
39100 PyErr_SetString(PyExc_OverflowError,
39101 "can't convert negative value to signed long");
39102 return (signed long)-1;
39104 return PyLong_AsUnsignedLong(x);
39106 return PyLong_AsLong(x);
39110 PyObject *tmp = __Pyx_PyNumber_Int(x);
39111 if (!tmp) return (signed long)-1;
39112 val = __Pyx_PyInt_AsSignedLong(tmp);
39118 static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject* x) {
39119 const signed PY_LONG_LONG neg_one = (signed PY_LONG_LONG)-1, const_zero = 0;
39120 const int is_unsigned = neg_one > const_zero;
39121 #if PY_VERSION_HEX < 0x03000000
39122 if (likely(PyInt_Check(x))) {
39123 long val = PyInt_AS_LONG(x);
39124 if (is_unsigned && unlikely(val < 0)) {
39125 PyErr_SetString(PyExc_OverflowError,
39126 "can't convert negative value to signed PY_LONG_LONG");
39127 return (signed PY_LONG_LONG)-1;
39129 return (signed PY_LONG_LONG)val;
39132 if (likely(PyLong_Check(x))) {
39134 if (unlikely(Py_SIZE(x) < 0)) {
39135 PyErr_SetString(PyExc_OverflowError,
39136 "can't convert negative value to signed PY_LONG_LONG");
39137 return (signed PY_LONG_LONG)-1;
39139 return PyLong_AsUnsignedLongLong(x);
39141 return PyLong_AsLongLong(x);
39144 signed PY_LONG_LONG val;
39145 PyObject *tmp = __Pyx_PyNumber_Int(x);
39146 if (!tmp) return (signed PY_LONG_LONG)-1;
39147 val = __Pyx_PyInt_AsSignedLongLong(tmp);
39153 static void __Pyx_WriteUnraisable(const char *name) {
39154 PyObject *old_exc, *old_val, *old_tb;
39156 __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
39157 #if PY_MAJOR_VERSION < 3
39158 ctx = PyString_FromString(name);
39160 ctx = PyUnicode_FromString(name);
39162 __Pyx_ErrRestore(old_exc, old_val, old_tb);
39164 PyErr_WriteUnraisable(Py_None);
39166 PyErr_WriteUnraisable(ctx);
39171 #ifndef __PYX_HAVE_RT_ImportType
39172 #define __PYX_HAVE_RT_ImportType
39173 static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name,
39174 long size, int strict)
39176 PyObject *py_module = 0;
39177 PyObject *result = 0;
39178 PyObject *py_name = 0;
39181 py_module = __Pyx_ImportModule(module_name);
39184 #if PY_MAJOR_VERSION < 3
39185 py_name = PyString_FromString(class_name);
39187 py_name = PyUnicode_FromString(class_name);
39191 result = PyObject_GetAttr(py_module, py_name);
39192 Py_DECREF(py_name);
39194 Py_DECREF(py_module);
39198 if (!PyType_Check(result)) {
39199 PyErr_Format(PyExc_TypeError,
39200 "%s.%s is not a type object",
39201 module_name, class_name);
39204 if (!strict && ((PyTypeObject *)result)->tp_basicsize > size) {
39205 PyOS_snprintf(warning, sizeof(warning),
39206 "%s.%s size changed, may indicate binary incompatibility",
39207 module_name, class_name);
39208 #if PY_VERSION_HEX < 0x02050000
39209 PyErr_Warn(NULL, warning);
39211 PyErr_WarnEx(NULL, warning, 0);
39214 else if (((PyTypeObject *)result)->tp_basicsize != size) {
39215 PyErr_Format(PyExc_ValueError,
39216 "%s.%s has the wrong size, try recompiling",
39217 module_name, class_name);
39220 return (PyTypeObject *)result;
39222 Py_XDECREF(py_module);
39223 Py_XDECREF(result);
39228 #ifndef __PYX_HAVE_RT_ImportModule
39229 #define __PYX_HAVE_RT_ImportModule
39230 static PyObject *__Pyx_ImportModule(const char *name) {
39231 PyObject *py_name = 0;
39232 PyObject *py_module = 0;
39234 #if PY_MAJOR_VERSION < 3
39235 py_name = PyString_FromString(name);
39237 py_name = PyUnicode_FromString(name);
39241 py_module = PyImport_Import(py_name);
39242 Py_DECREF(py_name);
39245 Py_XDECREF(py_name);
39250 static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
39251 #if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION==3&&PY_MINOR_VERSION==0)
39252 PyObject *ob = PyCapsule_New(vtable, 0, 0);
39254 PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
39258 if (PyDict_SetItemString(dict, "__pyx_vtable__", ob) < 0)
39267 #include "compile.h"
39268 #include "frameobject.h"
39269 #include "traceback.h"
39271 static void __Pyx_AddTraceback(const char *funcname) {
39272 PyObject *py_srcfile = 0;
39273 PyObject *py_funcname = 0;
39274 PyObject *py_globals = 0;
39275 PyCodeObject *py_code = 0;
39276 PyFrameObject *py_frame = 0;
39278 #if PY_MAJOR_VERSION < 3
39279 py_srcfile = PyString_FromString(__pyx_filename);
39281 py_srcfile = PyUnicode_FromString(__pyx_filename);
39283 if (!py_srcfile) goto bad;
39284 if (__pyx_clineno) {
39285 #if PY_MAJOR_VERSION < 3
39286 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, __pyx_clineno);
39288 py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, __pyx_clineno);
39292 #if PY_MAJOR_VERSION < 3
39293 py_funcname = PyString_FromString(funcname);
39295 py_funcname = PyUnicode_FromString(funcname);
39298 if (!py_funcname) goto bad;
39299 py_globals = PyModule_GetDict(__pyx_m);
39300 if (!py_globals) goto bad;
39301 py_code = PyCode_New(
39302 0, /*int argcount,*/
39303 #if PY_MAJOR_VERSION >= 3
39304 0, /*int kwonlyargcount,*/
39306 0, /*int nlocals,*/
39307 0, /*int stacksize,*/
39309 __pyx_empty_bytes, /*PyObject *code,*/
39310 __pyx_empty_tuple, /*PyObject *consts,*/
39311 __pyx_empty_tuple, /*PyObject *names,*/
39312 __pyx_empty_tuple, /*PyObject *varnames,*/
39313 __pyx_empty_tuple, /*PyObject *freevars,*/
39314 __pyx_empty_tuple, /*PyObject *cellvars,*/
39315 py_srcfile, /*PyObject *filename,*/
39316 py_funcname, /*PyObject *name,*/
39317 __pyx_lineno, /*int firstlineno,*/
39318 __pyx_empty_bytes /*PyObject *lnotab*/
39320 if (!py_code) goto bad;
39321 py_frame = PyFrame_New(
39322 PyThreadState_GET(), /*PyThreadState *tstate,*/
39323 py_code, /*PyCodeObject *code,*/
39324 py_globals, /*PyObject *globals,*/
39325 0 /*PyObject *locals*/
39327 if (!py_frame) goto bad;
39328 py_frame->f_lineno = __pyx_lineno;
39329 PyTraceBack_Here(py_frame);
39331 Py_XDECREF(py_srcfile);
39332 Py_XDECREF(py_funcname);
39333 Py_XDECREF(py_code);
39334 Py_XDECREF(py_frame);
39337 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
39339 #if PY_MAJOR_VERSION < 3
39340 if (t->is_unicode) {
39341 *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
39342 } else if (t->intern) {
39343 *t->p = PyString_InternFromString(t->s);
39345 *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
39347 #else /* Python 3+ has unicode identifiers */
39348 if (t->is_unicode | t->is_str) {
39350 *t->p = PyUnicode_InternFromString(t->s);
39351 } else if (t->encoding) {
39352 *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
39354 *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
39357 *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
39367 /* Type Conversion Functions */
39369 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
39370 int is_true = x == Py_True;
39371 if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
39372 else return PyObject_IsTrue(x);
39375 static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
39376 PyNumberMethods *m;
39377 const char *name = NULL;
39378 PyObject *res = NULL;
39379 #if PY_VERSION_HEX < 0x03000000
39380 if (PyInt_Check(x) || PyLong_Check(x))
39382 if (PyLong_Check(x))
39384 return Py_INCREF(x), x;
39385 m = Py_TYPE(x)->tp_as_number;
39386 #if PY_VERSION_HEX < 0x03000000
39387 if (m && m->nb_int) {
39389 res = PyNumber_Int(x);
39391 else if (m && m->nb_long) {
39393 res = PyNumber_Long(x);
39396 if (m && m->nb_int) {
39398 res = PyNumber_Long(x);
39402 #if PY_VERSION_HEX < 0x03000000
39403 if (!PyInt_Check(res) && !PyLong_Check(res)) {
39405 if (!PyLong_Check(res)) {
39407 PyErr_Format(PyExc_TypeError,
39408 "__%s__ returned non-%s (type %.200s)",
39409 name, name, Py_TYPE(res)->tp_name);
39414 else if (!PyErr_Occurred()) {
39415 PyErr_SetString(PyExc_TypeError,
39416 "an integer is required");
39421 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
39423 PyObject* x = PyNumber_Index(b);
39425 ival = PyInt_AsSsize_t(x);
39430 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
39431 #if PY_VERSION_HEX < 0x02050000
39432 if (ival <= LONG_MAX)
39433 return PyInt_FromLong((long)ival);
39435 unsigned char *bytes = (unsigned char *) &ival;
39436 int one = 1; int little = (int)*(unsigned char*)&one;
39437 return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0);
39440 return PyInt_FromSize_t(ival);
39444 static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject* x) {
39445 unsigned PY_LONG_LONG val = __Pyx_PyInt_AsUnsignedLongLong(x);
39446 if (unlikely(val == (unsigned PY_LONG_LONG)-1 && PyErr_Occurred())) {
39448 } else if (unlikely(val != (unsigned PY_LONG_LONG)(size_t)val)) {
39449 PyErr_SetString(PyExc_OverflowError,
39450 "value too large to convert to size_t");
39453 return (size_t)val;
39457 #endif /* Py_PYTHON_H */