Generated by Cython 0.16 on Wed Oct 17 10:04:03 2012

Raw output: pileup.c

 1: '''
 2: Created on 2012-01-17
 3: 
 4: @author: Andrew Roth
 5: '''
 6: #from __future__ import division
 7: # Global constants
 8: cdef int max_pos = 2 << 29
  /* "jointpysam/pileup.pyx":8
 * #from __future__ import division
 * # Global constants
 * cdef int max_pos = 2 << 29             # <<<<<<<<<<<<<<
 * cdef char * bam_nt16_rev_table = "=ACMGRSVTWYHKDBN"
 * import math
 */
  __pyx_v_10jointpysam_6pileup_max_pos = 1073741824;
 9: cdef char * bam_nt16_rev_table = "=ACMGRSVTWYHKDBN"
  /* "jointpysam/pileup.pyx":9
 * # Global constants
 * cdef int max_pos = 2 << 29
 * cdef char * bam_nt16_rev_table = "=ACMGRSVTWYHKDBN"             # <<<<<<<<<<<<<<
 * import math
 * cdef class PileupIterator:
 */
  __pyx_v_10jointpysam_6pileup_bam_nt16_rev_table = __pyx_k_8;
 10: import math
  /* "jointpysam/pileup.pyx":10
 * cdef int max_pos = 2 << 29
 * cdef char * bam_nt16_rev_table = "=ACMGRSVTWYHKDBN"
 * import math             # <<<<<<<<<<<<<<
 * cdef class PileupIterator:
 *     def __cinit__(self, BamFile bam_file, int tid=0, int start=0, int stop=max_pos):
 */
  __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__math), 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__math, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 11: cdef class PileupIterator:
/* "jointpysam/pileup.pyx":11
 * cdef char * bam_nt16_rev_table = "=ACMGRSVTWYHKDBN"
 * import math
 * cdef class PileupIterator:             # <<<<<<<<<<<<<<
 *     def __cinit__(self, BamFile bam_file, int tid=0, int start=0, int stop=max_pos):
 *         self._bam_file = bam_file
 */

struct __pyx_vtabstruct_10jointpysam_6pileup_PileupIterator {
  PyObject *(*cnext)(struct __pyx_obj_10jointpysam_6pileup_PileupIterator *);
  PyObject *(*advance_position)(struct __pyx_obj_10jointpysam_6pileup_PileupIterator *);
  PyObject *(*parse_current_position)(struct __pyx_obj_10jointpysam_6pileup_PileupIterator *);
  PyObject *(*jump_to_position)(struct __pyx_obj_10jointpysam_6pileup_PileupIterator *, int, int __pyx_skip_dispatch);
  PyObject *(*_setup_iterator_data)(struct __pyx_obj_10jointpysam_6pileup_PileupIterator *, int, int, int);
  PyObject *(*_destroy_iterator_data)(struct __pyx_obj_10jointpysam_6pileup_PileupIterator *);
};
static struct __pyx_vtabstruct_10jointpysam_6pileup_PileupIterator *__pyx_vtabptr_10jointpysam_6pileup_PileupIterator;

 12:     def __cinit__(self, BamFile bam_file, int tid=0, int start=0, int stop=max_pos):
/* "jointpysam/pileup.pyx":12
 * import math
 * cdef class PileupIterator:
 *     def __cinit__(self, BamFile bam_file, int tid=0, int start=0, int stop=max_pos):             # <<<<<<<<<<<<<<
 *         self._bam_file = bam_file
 * 
 */

static int __pyx_pf_10jointpysam_6pileup_14PileupIterator___cinit__(struct __pyx_obj_10jointpysam_6pileup_PileupIterator *__pyx_v_self, struct __pyx_obj_10jointpysam_3bam_BamFile *__pyx_v_bam_file, int __pyx_v_tid, int __pyx_v_start, int __pyx_v_stop) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "jointpysam/pileup.pyx":12
 * import math
 * cdef class PileupIterator:
 *     def __cinit__(self, BamFile bam_file, int tid=0, int start=0, int stop=max_pos):             # <<<<<<<<<<<<<<
 *         self._bam_file = bam_file
 * 
 */
  __pyx_k_1 = __pyx_v_10jointpysam_6pileup_max_pos;
 13:         self._bam_file = bam_file
  /* "jointpysam/pileup.pyx":13
 * cdef class PileupIterator:
 *     def __cinit__(self, BamFile bam_file, int tid=0, int start=0, int stop=max_pos):
 *         self._bam_file = bam_file             # <<<<<<<<<<<<<<
 * 
 *         self._mask = BAM_DEF_MASK
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_bam_file));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_bam_file));
  __Pyx_GOTREF(__pyx_v_self->_bam_file);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->_bam_file));
  __pyx_v_self->_bam_file = __pyx_v_bam_file;
 14: 
 15:         self._mask = BAM_DEF_MASK
  /* "jointpysam/pileup.pyx":15
 *         self._bam_file = bam_file
 * 
 *         self._mask = BAM_DEF_MASK             # <<<<<<<<<<<<<<
 * 
 *         self._tid = tid
 */
  __pyx_v_self->_mask = BAM_DEF_MASK;
 16: 
 17:         self._tid = tid
  /* "jointpysam/pileup.pyx":17
 *         self._mask = BAM_DEF_MASK
 * 
 *         self._tid = tid             # <<<<<<<<<<<<<<
 *         self._pos = 0
 *         self._n_plp = 0
 */
  __pyx_v_self->_tid = __pyx_v_tid;
 18:         self._pos = 0
  /* "jointpysam/pileup.pyx":18
 * 
 *         self._tid = tid
 *         self._pos = 0             # <<<<<<<<<<<<<<
 *         self._n_plp = 0
 *         self._plp = NULL
 */
  __pyx_v_self->_pos = 0;
 19:         self._n_plp = 0
  /* "jointpysam/pileup.pyx":19
 *         self._tid = tid
 *         self._pos = 0
 *         self._n_plp = 0             # <<<<<<<<<<<<<<
 *         self._plp = NULL
 * 
 */
  __pyx_v_self->_n_plp = 0;
 20:         self._plp = NULL
  /* "jointpysam/pileup.pyx":20
 *         self._pos = 0
 *         self._n_plp = 0
 *         self._plp = NULL             # <<<<<<<<<<<<<<
 * 
 *         self._setup_iterator_data(self._tid, start, stop)
 */
  __pyx_v_self->_plp = NULL;
 21: 
 22:         self._setup_iterator_data(self._tid, start, stop)
  /* "jointpysam/pileup.pyx":22
 *         self._plp = NULL
 * 
 *         self._setup_iterator_data(self._tid, start, stop)             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(self):
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_10jointpysam_6pileup_PileupIterator *)__pyx_v_self->__pyx_vtab)->_setup_iterator_data(__pyx_v_self, __pyx_v_self->_tid, __pyx_v_start, __pyx_v_stop); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("jointpysam.pileup.PileupIterator.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static void __pyx_pw_10jointpysam_6pileup_14PileupIterator_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_10jointpysam_6pileup_14PileupIterator_3__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_pf_10jointpysam_6pileup_14PileupIterator_2__dealloc__(((struct __pyx_obj_10jointpysam_6pileup_PileupIterator *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
}
 23: 
 24:     def __dealloc__(self):
/* "jointpysam/pileup.pyx":24
 *         self._setup_iterator_data(self._tid, start, stop)
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         self._destroy_iterator_data()
 * 
 */

static void __pyx_pf_10jointpysam_6pileup_14PileupIterator_2__dealloc__(struct __pyx_obj_10jointpysam_6pileup_PileupIterator *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__", 0);
 25:         self._destroy_iterator_data()
  /* "jointpysam/pileup.pyx":25
 * 
 *     def __dealloc__(self):
 *         self._destroy_iterator_data()             # <<<<<<<<<<<<<<
 * 
 *     def __iter__(self):
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_10jointpysam_6pileup_PileupIterator *)__pyx_v_self->__pyx_vtab)->_destroy_iterator_data(__pyx_v_self); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("jointpysam.pileup.PileupIterator.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10jointpysam_6pileup_14PileupIterator_5__iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10jointpysam_6pileup_14PileupIterator_5__iter__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10jointpysam_6pileup_14PileupIterator_4__iter__(((struct __pyx_obj_10jointpysam_6pileup_PileupIterator *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
 26: 
 27:     def __iter__(self):
/* "jointpysam/pileup.pyx":27
 *         self._destroy_iterator_data()
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
 */

static PyObject *__pyx_pf_10jointpysam_6pileup_14PileupIterator_4__iter__(struct __pyx_obj_10jointpysam_6pileup_PileupIterator *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__", 0);
 28:         return self
  /* "jointpysam/pileup.pyx":28
 * 
 *     def __iter__(self):
 *         return self             # <<<<<<<<<<<<<<
 * 
 *     def __next__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10jointpysam_6pileup_14PileupIterator_7__next__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10jointpysam_6pileup_14PileupIterator_7__next__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__next__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10jointpysam_6pileup_14PileupIterator_6__next__(((struct __pyx_obj_10jointpysam_6pileup_PileupIterator *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
 29: 
 30:     def __next__(self):
/* "jointpysam/pileup.pyx":30
 *         return self
 * 
 *     def __next__(self):             # <<<<<<<<<<<<<<
 *         self.cnext()
 * 
 */

static PyObject *__pyx_pf_10jointpysam_6pileup_14PileupIterator_6__next__(struct __pyx_obj_10jointpysam_6pileup_PileupIterator *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__next__", 0);
 31:         self.cnext()
  /* "jointpysam/pileup.pyx":31
 * 
 *     def __next__(self):
 *         self.cnext()             # <<<<<<<<<<<<<<
 * 
 *         return self._column
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_10jointpysam_6pileup_PileupIterator *)__pyx_v_self->__pyx_vtab)->cnext(__pyx_v_self); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 32: 
 33:         return self._column
  /* "jointpysam/pileup.pyx":33
 *         self.cnext()
 * 
 *         return self._column             # <<<<<<<<<<<<<<
 * 
 *     cdef cnext(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->_column));
  __pyx_r = ((PyObject *)__pyx_v_self->_column);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("jointpysam.pileup.PileupIterator.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
 34: 
 35:     cdef cnext(self):
/* "jointpysam/pileup.pyx":35
 *         return self._column
 * 
 *     cdef cnext(self):             # <<<<<<<<<<<<<<
 *         '''
 *         C-level iterator function. Moves current_column to next position.
 */

static PyObject *__pyx_f_10jointpysam_6pileup_14PileupIterator_cnext(struct __pyx_obj_10jointpysam_6pileup_PileupIterator *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("cnext", 0);
 36:         '''
 37:         C-level iterator function. Moves current_column to next position.
 38:         '''
 39:         self.advance_position()
  /* "jointpysam/pileup.pyx":39
 *         C-level iterator function. Moves current_column to next position.
 *         '''
 *         self.advance_position()             # <<<<<<<<<<<<<<
 *         self.parse_current_position()
 * 
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_10jointpysam_6pileup_PileupIterator *)__pyx_v_self->__pyx_vtab)->advance_position(__pyx_v_self); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 40:         self.parse_current_position()
  /* "jointpysam/pileup.pyx":40
 *         '''
 *         self.advance_position()
 *         self.parse_current_position()             # <<<<<<<<<<<<<<
 * 
 *     cdef advance_position(self):
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_10jointpysam_6pileup_PileupIterator *)__pyx_v_self->__pyx_vtab)->parse_current_position(__pyx_v_self); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("jointpysam.pileup.PileupIterator.cnext", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
 41: 
 42:     cdef advance_position(self):
/* "jointpysam/pileup.pyx":42
 *         self.parse_current_position()
 * 
 *     cdef advance_position(self):             # <<<<<<<<<<<<<<
 *         '''
 *         This function moves the underlying pileup pointer along.
 */

static PyObject *__pyx_f_10jointpysam_6pileup_14PileupIterator_advance_position(struct __pyx_obj_10jointpysam_6pileup_PileupIterator *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("advance_position", 0);
 43:         '''
 44:         This function moves the underlying pileup pointer along.
 45:         '''
 46:         self._plp = bam_plp_auto(self._pileup_iter,
  /* "jointpysam/pileup.pyx":46
 *         This function moves the underlying pileup pointer along.
 *         '''
 *         self._plp = bam_plp_auto(self._pileup_iter,             # <<<<<<<<<<<<<<
 *                                  & self._tid,
 *                                  & self._pos,
 */
  __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));
 47:                                  & self._tid,
 48:                                  & self._pos,
 49:                                  & self._n_plp)
 50: 
 51:         if self._plp == NULL:
  /* "jointpysam/pileup.pyx":51
 *                                  & self._n_plp)
 * 
 *         if self._plp == NULL:             # <<<<<<<<<<<<<<
 *             raise StopIteration
 * 
 */
  __pyx_t_1 = (__pyx_v_self->_plp == NULL);
  if (__pyx_t_1) {
 52:             raise StopIteration
    /* "jointpysam/pileup.pyx":52
 * 
 *         if self._plp == NULL:
 *             raise StopIteration             # <<<<<<<<<<<<<<
 * 
 *     cdef parse_current_position(self):
 */
    __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0, 0);
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("jointpysam.pileup.PileupIterator.advance_position", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
 53: 
 54:     cdef parse_current_position(self):
/* "jointpysam/pileup.pyx":54
 *             raise StopIteration
 * 
 *     cdef parse_current_position(self):             # <<<<<<<<<<<<<<
 *         '''
 *         This function parses the current position to create a pileup column.
 */

static PyObject *__pyx_f_10jointpysam_6pileup_14PileupIterator_parse_current_position(struct __pyx_obj_10jointpysam_6pileup_PileupIterator *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("parse_current_position", 0);
 55:         '''
 56:         This function parses the current position to create a pileup column.
 57:         '''
 58:         if self._n_plp < 0:
  /* "jointpysam/pileup.pyx":58
 *         This function parses the current position to create a pileup column.
 *         '''
 *         if self._n_plp < 0:             # <<<<<<<<<<<<<<
 *             raise Exception("IteratorColumn : error during iteration.")
 * 
 */
  __pyx_t_1 = (__pyx_v_self->_n_plp < 0);
  if (__pyx_t_1) {
 59:             raise Exception("IteratorColumn : error during iteration.")
    /* "jointpysam/pileup.pyx":59
 *         '''
 *         if self._n_plp < 0:
 *             raise Exception("IteratorColumn : error during iteration.")             # <<<<<<<<<<<<<<
 * 
 *         self._column = makePileupColumn(< bam_pileup1_t *> self._plp,
 */
    __pyx_t_2 = PyObject_Call(__pyx_builtin_Exception, ((PyObject *)__pyx_k_tuple_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;
 60: 
 61:         self._column = makePileupColumn(< bam_pileup1_t *> self._plp,
  /* "jointpysam/pileup.pyx":61
 *             raise Exception("IteratorColumn : error during iteration.")
 * 
 *         self._column = makePileupColumn(< bam_pileup1_t *> self._plp,             # <<<<<<<<<<<<<<
 *                                         self._tid,
 *                                         self._pos,
 */
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(__pyx_v_self->_column);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->_column));
  __pyx_v_self->_column = ((struct __pyx_obj_10jointpysam_6pileup_PileupColumn *)__pyx_t_2);
  __pyx_t_2 = 0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("jointpysam.pileup.PileupIterator.parse_current_position", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
 62:                                         self._tid,
 63:                                         self._pos,
 64:                                         self._n_plp)
  /* "jointpysam/pileup.pyx":64
 *                                         self._tid,
 *                                         self._pos,
 *                                         self._n_plp)             # <<<<<<<<<<<<<<
 * 
 *     cpdef jump_to_position(self, int position):
 */
  __pyx_t_2 = __pyx_f_10jointpysam_6pileup_makePileupColumn(((bam_pileup1_t *)__pyx_v_self->_plp), __pyx_v_self->_tid, __pyx_v_self->_pos, __pyx_v_self->_n_plp); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10jointpysam_6pileup_PileupColumn))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 65: 
 66:     cpdef jump_to_position(self, int position):
/* "jointpysam/pileup.pyx":66
 *                                         self._n_plp)
 * 
 *     cpdef jump_to_position(self, int position):             # <<<<<<<<<<<<<<
 *         '''
 *         Move iterator to position. Should probably only be used for big jumps since there is some overhead from
 */

static PyObject *__pyx_pw_10jointpysam_6pileup_14PileupIterator_9jump_to_position(PyObject *__pyx_v_self, PyObject *__pyx_arg_position); /*proto*/
static PyObject *__pyx_f_10jointpysam_6pileup_14PileupIterator_jump_to_position(struct __pyx_obj_10jointpysam_6pileup_PileupIterator *__pyx_v_self, int __pyx_v_position, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("jump_to_position", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__jump_to_position); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10jointpysam_6pileup_14PileupIterator_9jump_to_position)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyInt_FromLong(__pyx_v_position); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

/* "jointpysam/pileup.pyx":66
 *                                         self._n_plp)
 * 
 *     cpdef jump_to_position(self, int position):             # <<<<<<<<<<<<<<
 *         '''
 *         Move iterator to position. Should probably only be used for big jumps since there is some overhead from
 */

static PyObject *__pyx_pf_10jointpysam_6pileup_14PileupIterator_8jump_to_position(struct __pyx_obj_10jointpysam_6pileup_PileupIterator *__pyx_v_self, int __pyx_v_position) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("jump_to_position", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_10jointpysam_6pileup_PileupIterator *)__pyx_v_self->__pyx_vtab)->jump_to_position(__pyx_v_self, __pyx_v_position, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("jointpysam.pileup.PileupIterator.jump_to_position", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
 67:         '''
 68:         Move iterator to position. Should probably only be used for big jumps since there is some overhead from
 69:         destroying and constructing underlying c data structues.
 70:         '''
 71:         self._destroy_iterator_data()
  /* "jointpysam/pileup.pyx":71
 *         destroying and constructing underlying c data structues.
 *         '''
 *         self._destroy_iterator_data()             # <<<<<<<<<<<<<<
 *         self._setup_iterator_data(self._tid, position, max_pos)
 *         self.advance_position()
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_10jointpysam_6pileup_PileupIterator *)__pyx_v_self->__pyx_vtab)->_destroy_iterator_data(__pyx_v_self); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 72:         self._setup_iterator_data(self._tid, position, max_pos)
  /* "jointpysam/pileup.pyx":72
 *         '''
 *         self._destroy_iterator_data()
 *         self._setup_iterator_data(self._tid, position, max_pos)             # <<<<<<<<<<<<<<
 *         self.advance_position()
 * 
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_10jointpysam_6pileup_PileupIterator *)__pyx_v_self->__pyx_vtab)->_setup_iterator_data(__pyx_v_self, __pyx_v_self->_tid, __pyx_v_position, __pyx_v_10jointpysam_6pileup_max_pos); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 73:         self.advance_position()
  /* "jointpysam/pileup.pyx":73
 *         self._destroy_iterator_data()
 *         self._setup_iterator_data(self._tid, position, max_pos)
 *         self.advance_position()             # <<<<<<<<<<<<<<
 * 
 *     cdef _setup_iterator_data(self, int tid, int start, int stop):
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_10jointpysam_6pileup_PileupIterator *)__pyx_v_self->__pyx_vtab)->advance_position(__pyx_v_self); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("jointpysam.pileup.PileupIterator.jump_to_position", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10jointpysam_6pileup_14PileupIterator_9jump_to_position(PyObject *__pyx_v_self, PyObject *__pyx_arg_position); /*proto*/
static char __pyx_doc_10jointpysam_6pileup_14PileupIterator_8jump_to_position[] = "\n        Move iterator to position. Should probably only be used for big jumps since there is some overhead from\n        destroying and constructing underlying c data structues.\n        ";
static PyObject *__pyx_pw_10jointpysam_6pileup_14PileupIterator_9jump_to_position(PyObject *__pyx_v_self, PyObject *__pyx_arg_position) {
  int __pyx_v_position;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("jump_to_position (wrapper)", 0);
  assert(__pyx_arg_position); {
    __pyx_v_position = __Pyx_PyInt_AsInt(__pyx_arg_position); if (unlikely((__pyx_v_position == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("jointpysam.pileup.PileupIterator.jump_to_position", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10jointpysam_6pileup_14PileupIterator_8jump_to_position(((struct __pyx_obj_10jointpysam_6pileup_PileupIterator *)__pyx_v_self), ((int)__pyx_v_position));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
 74: 
 75:     cdef _setup_iterator_data(self, int tid, int start, int stop):
/* "jointpysam/pileup.pyx":75
 *         self.advance_position()
 * 
 *     cdef _setup_iterator_data(self, int tid, int start, int stop):             # <<<<<<<<<<<<<<
 *         '''
 *         Setup the iterator structure.
 */

static PyObject *__pyx_f_10jointpysam_6pileup_14PileupIterator__setup_iterator_data(struct __pyx_obj_10jointpysam_6pileup_PileupIterator *__pyx_v_self, int __pyx_v_tid, int __pyx_v_start, int __pyx_v_stop) {
  bam_iter_t __pyx_v_iter;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_setup_iterator_data", 0);
 76:         '''
 77:         Setup the iterator structure.
 78:         '''
 79:         cdef bam_iter_t iter
 80: 
 81:         iter = bam_iter_query(self._bam_file.get_index(), tid, start -1, stop -1)
  /* "jointpysam/pileup.pyx":81
 *         cdef bam_iter_t iter
 * 
 *         iter = bam_iter_query(self._bam_file.get_index(), tid, start -1, stop -1)             # <<<<<<<<<<<<<<
 * 
 *         self._iter_data.bam_file_ptr = self._bam_file.get_file_pointer()
 */
  __pyx_v_iter = bam_iter_query(((struct __pyx_vtabstruct_10jointpysam_3bam_BamFile *)__pyx_v_self->_bam_file->__pyx_vtab)->get_index(__pyx_v_self->_bam_file), __pyx_v_tid, (__pyx_v_start - 1), (__pyx_v_stop - 1));
 82: 
 83:         self._iter_data.bam_file_ptr = self._bam_file.get_file_pointer()
  /* "jointpysam/pileup.pyx":83
 *         iter = bam_iter_query(self._bam_file.get_index(), tid, start -1, stop -1)
 * 
 *         self._iter_data.bam_file_ptr = self._bam_file.get_file_pointer()             # <<<<<<<<<<<<<<
 *         self._iter_data.iter = iter
 *         self._iter_data.seq = NULL
 */
  __pyx_v_self->_iter_data.bam_file_ptr = ((struct __pyx_vtabstruct_10jointpysam_3bam_BamFile *)__pyx_v_self->_bam_file->__pyx_vtab)->get_file_pointer(__pyx_v_self->_bam_file);
 84:         self._iter_data.iter = iter
  /* "jointpysam/pileup.pyx":84
 * 
 *         self._iter_data.bam_file_ptr = self._bam_file.get_file_pointer()
 *         self._iter_data.iter = iter             # <<<<<<<<<<<<<<
 *         self._iter_data.seq = NULL
 *         self._iter_data.tid = -1
 */
  __pyx_v_self->_iter_data.iter = __pyx_v_iter;
 85:         self._iter_data.seq = NULL
  /* "jointpysam/pileup.pyx":85
 *         self._iter_data.bam_file_ptr = self._bam_file.get_file_pointer()
 *         self._iter_data.iter = iter
 *         self._iter_data.seq = NULL             # <<<<<<<<<<<<<<
 *         self._iter_data.tid = -1
 * 
 */
  __pyx_v_self->_iter_data.seq = NULL;
 86:         self._iter_data.tid = -1
  /* "jointpysam/pileup.pyx":86
 *         self._iter_data.iter = iter
 *         self._iter_data.seq = NULL
 *         self._iter_data.tid = -1             # <<<<<<<<<<<<<<
 * 
 *         self._pileup_iter = bam_plp_init(& advance_all, & self._iter_data)
 */
  __pyx_v_self->_iter_data.tid = -1;
 87: 
 88:         self._pileup_iter = bam_plp_init(& advance_all, & self._iter_data)
  /* "jointpysam/pileup.pyx":88
 *         self._iter_data.tid = -1
 * 
 *         self._pileup_iter = bam_plp_init(& advance_all, & self._iter_data)             # <<<<<<<<<<<<<<
 * 
 *         bam_plp_set_mask(self._pileup_iter, self._mask)
 */
  __pyx_v_self->_pileup_iter = bam_plp_init((&__pyx_f_10jointpysam_6pileup_advance_all), (&__pyx_v_self->_iter_data));
 89: 
 90:         bam_plp_set_mask(self._pileup_iter, self._mask)
  /* "jointpysam/pileup.pyx":90
 *         self._pileup_iter = bam_plp_init(& advance_all, & self._iter_data)
 * 
 *         bam_plp_set_mask(self._pileup_iter, self._mask)             # <<<<<<<<<<<<<<
 * 
 *     cdef _destroy_iterator_data(self):
 */
  bam_plp_set_mask(__pyx_v_self->_pileup_iter, __pyx_v_self->_mask);

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
 91: 
 92:     cdef _destroy_iterator_data(self):
/* "jointpysam/pileup.pyx":92
 *         bam_plp_set_mask(self._pileup_iter, self._mask)
 * 
 *     cdef _destroy_iterator_data(self):             # <<<<<<<<<<<<<<
 *         # reset in order to avoid memory leak messages for iterators that have
 *         # not been fully consumed
 */

static PyObject *__pyx_f_10jointpysam_6pileup_14PileupIterator__destroy_iterator_data(struct __pyx_obj_10jointpysam_6pileup_PileupIterator *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_destroy_iterator_data", 0);
 93:         # reset in order to avoid memory leak messages for iterators that have
 94:         # not been fully consumed
 95:         if self._pileup_iter != < bam_plp_t > NULL:
  /* "jointpysam/pileup.pyx":95
 *         # reset in order to avoid memory leak messages for iterators that have
 *         # not been fully consumed
 *         if self._pileup_iter != < bam_plp_t > NULL:             # <<<<<<<<<<<<<<
 *             bam_plp_reset(self._pileup_iter)
 * 
 */
  __pyx_t_1 = (__pyx_v_self->_pileup_iter != NULL);
  if (__pyx_t_1) {
 96:             bam_plp_reset(self._pileup_iter)
    /* "jointpysam/pileup.pyx":96
 *         # not been fully consumed
 *         if self._pileup_iter != < bam_plp_t > NULL:
 *             bam_plp_reset(self._pileup_iter)             # <<<<<<<<<<<<<<
 * 
 *             bam_plp_destroy(self._pileup_iter)
 */
    bam_plp_reset(__pyx_v_self->_pileup_iter);
 97: 
 98:             bam_plp_destroy(self._pileup_iter)
    /* "jointpysam/pileup.pyx":98
 *             bam_plp_reset(self._pileup_iter)
 * 
 *             bam_plp_destroy(self._pileup_iter)             # <<<<<<<<<<<<<<
 * 
 *             self._pileup_iter = < bam_plp_t > NULL
 */
    bam_plp_destroy(__pyx_v_self->_pileup_iter);
 99: 
 100:             self._pileup_iter = < bam_plp_t > NULL
    /* "jointpysam/pileup.pyx":100
 *             bam_plp_destroy(self._pileup_iter)
 * 
 *             self._pileup_iter = < bam_plp_t > NULL             # <<<<<<<<<<<<<<
 * 
 *         if self._iter_data.seq != NULL:
 */
    __pyx_v_self->_pileup_iter = NULL;
    goto __pyx_L3;
  }
  __pyx_L3:;
 101: 
 102:         if self._iter_data.seq != NULL:
  /* "jointpysam/pileup.pyx":102
 *             self._pileup_iter = < bam_plp_t > NULL
 * 
 *         if self._iter_data.seq != NULL:             # <<<<<<<<<<<<<<
 *             free(self._iter_data.seq)
 *             self._iter_data.seq = NULL
 */
  __pyx_t_1 = (__pyx_v_self->_iter_data.seq != NULL);
  if (__pyx_t_1) {
 103:             free(self._iter_data.seq)
    /* "jointpysam/pileup.pyx":103
 * 
 *         if self._iter_data.seq != NULL:
 *             free(self._iter_data.seq)             # <<<<<<<<<<<<<<
 *             self._iter_data.seq = NULL
 * 
 */
    free(__pyx_v_self->_iter_data.seq);
 104:             self._iter_data.seq = NULL
    /* "jointpysam/pileup.pyx":104
 *         if self._iter_data.seq != NULL:
 *             free(self._iter_data.seq)
 *             self._iter_data.seq = NULL             # <<<<<<<<<<<<<<
 * 
 *         if self._iter_data.iter != < bam_iter_t > NULL:
 */
    __pyx_v_self->_iter_data.seq = NULL;
    goto __pyx_L4;
  }
  __pyx_L4:;
 105: 
 106:         if self._iter_data.iter != < bam_iter_t > NULL:
  /* "jointpysam/pileup.pyx":106
 *             self._iter_data.seq = NULL
 * 
 *         if self._iter_data.iter != < bam_iter_t > NULL:             # <<<<<<<<<<<<<<
 *             bam_iter_destroy(self._iter_data.iter)
 *             self._iter_data.iter = < bam_iter_t > NULL
 */
  __pyx_t_1 = (__pyx_v_self->_iter_data.iter != NULL);
  if (__pyx_t_1) {
 107:             bam_iter_destroy(self._iter_data.iter)
    /* "jointpysam/pileup.pyx":107
 * 
 *         if self._iter_data.iter != < bam_iter_t > NULL:
 *             bam_iter_destroy(self._iter_data.iter)             # <<<<<<<<<<<<<<
 *             self._iter_data.iter = < bam_iter_t > NULL
 * 
 */
    bam_iter_destroy(__pyx_v_self->_iter_data.iter);
 108:             self._iter_data.iter = < bam_iter_t > NULL
    /* "jointpysam/pileup.pyx":108
 *         if self._iter_data.iter != < bam_iter_t > NULL:
 *             bam_iter_destroy(self._iter_data.iter)
 *             self._iter_data.iter = < bam_iter_t > NULL             # <<<<<<<<<<<<<<
 * 
 * cdef class PileupColumn:
 */
    __pyx_v_self->_iter_data.iter = NULL;
    goto __pyx_L5;
  }
  __pyx_L5:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static void __pyx_pw_10jointpysam_6pileup_12PileupColumn_1__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_10jointpysam_6pileup_12PileupColumn_1__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_pf_10jointpysam_6pileup_12PileupColumn___dealloc__(((struct __pyx_obj_10jointpysam_6pileup_PileupColumn *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
}
 109: 
 110: cdef class PileupColumn:
/* "jointpysam/pileup.pyx":110
 *             self._iter_data.iter = < bam_iter_t > NULL
 * 
 * cdef class PileupColumn:             # <<<<<<<<<<<<<<
 *     def __dealloc__(self):
 *         free(self._bases)
 */

struct __pyx_vtabstruct_10jointpysam_6pileup_PileupColumn {
  int (*get_depth)(struct __pyx_obj_10jointpysam_6pileup_PileupColumn *);
  int (*get_nucleotide_count)(struct __pyx_obj_10jointpysam_6pileup_PileupColumn *, char *, int, int);
};
static struct __pyx_vtabstruct_10jointpysam_6pileup_PileupColumn *__pyx_vtabptr_10jointpysam_6pileup_PileupColumn;
 111:     def __dealloc__(self):
/* "jointpysam/pileup.pyx":111
 * 
 * cdef class PileupColumn:
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         free(self._bases)
 *         free(self._base_quals)
 */

static void __pyx_pf_10jointpysam_6pileup_12PileupColumn___dealloc__(struct __pyx_obj_10jointpysam_6pileup_PileupColumn *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__", 0);
 112:         free(self._bases)
  /* "jointpysam/pileup.pyx":112
 * cdef class PileupColumn:
 *     def __dealloc__(self):
 *         free(self._bases)             # <<<<<<<<<<<<<<
 *         free(self._base_quals)
 *         free(self._map_quals)
 */
  free(__pyx_v_self->_bases);
 113:         free(self._base_quals)
  /* "jointpysam/pileup.pyx":113
 *     def __dealloc__(self):
 *         free(self._bases)
 *         free(self._base_quals)             # <<<<<<<<<<<<<<
 *         free(self._map_quals)
 *         free(self._tail_distance)
 */
  free(__pyx_v_self->_base_quals);
 114:         free(self._map_quals)
  /* "jointpysam/pileup.pyx":114
 *         free(self._bases)
 *         free(self._base_quals)
 *         free(self._map_quals)             # <<<<<<<<<<<<<<
 *         free(self._tail_distance)
 *         free(self._is_forward_strand)
 */
  free(__pyx_v_self->_map_quals);
 115:         free(self._tail_distance)
  /* "jointpysam/pileup.pyx":115
 *         free(self._base_quals)
 *         free(self._map_quals)
 *         free(self._tail_distance)             # <<<<<<<<<<<<<<
 *         free(self._is_forward_strand)
 *         free(self._indels)
 */
  free(__pyx_v_self->_tail_distance);
 116:         free(self._is_forward_strand)
  /* "jointpysam/pileup.pyx":116
 *         free(self._map_quals)
 *         free(self._tail_distance)
 *         free(self._is_forward_strand)             # <<<<<<<<<<<<<<
 *         free(self._indels)
 *         free(self._alignment_length)
 */
  free(__pyx_v_self->_is_forward_strand);
 117:         free(self._indels)
  /* "jointpysam/pileup.pyx":117
 *         free(self._tail_distance)
 *         free(self._is_forward_strand)
 *         free(self._indels)             # <<<<<<<<<<<<<<
 *         free(self._alignment_length)
 *         free(self._base_counts)
 */
  free(__pyx_v_self->_indels);
 118:         free(self._alignment_length)
  /* "jointpysam/pileup.pyx":118
 *         free(self._is_forward_strand)
 *         free(self._indels)
 *         free(self._alignment_length)             # <<<<<<<<<<<<<<
 *         free(self._base_counts)
 *     def __str__(self):
 */
  free(__pyx_v_self->_alignment_length);
 119:         free(self._base_counts)
  /* "jointpysam/pileup.pyx":119
 *         free(self._indels)
 *         free(self._alignment_length)
 *         free(self._base_counts)             # <<<<<<<<<<<<<<
 *     def __str__(self):
 *         return "{0}, {1}, {2}".format(self._tid, self._pos, self._depth)
 */
  free(__pyx_v_self->_base_counts);

  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10jointpysam_6pileup_12PileupColumn_3__str__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10jointpysam_6pileup_12PileupColumn_3__str__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10jointpysam_6pileup_12PileupColumn_2__str__(((struct __pyx_obj_10jointpysam_6pileup_PileupColumn *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
 120:     def __str__(self):
/* "jointpysam/pileup.pyx":120
 *         free(self._alignment_length)
 *         free(self._base_counts)
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         return "{0}, {1}, {2}".format(self._tid, self._pos, self._depth)
 * 
 */

static PyObject *__pyx_pf_10jointpysam_6pileup_12PileupColumn_2__str__(struct __pyx_obj_10jointpysam_6pileup_PileupColumn *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__str__", 0);
 121:         return "{0}, {1}, {2}".format(self._tid, self._pos, self._depth)
  /* "jointpysam/pileup.pyx":121
 *         free(self._base_counts)
 *     def __str__(self):
 *         return "{0}, {1}, {2}".format(self._tid, self._pos, self._depth)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_kp_s_4), __pyx_n_s__format); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyInt_FromLong(__pyx_v_self->_tid); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyInt_FromLong(__pyx_v_self->_pos); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyInt_FromLong(__pyx_v_self->_depth); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("jointpysam.pileup.PileupColumn.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10jointpysam_6pileup_12PileupColumn_5entropy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10jointpysam_6pileup_12PileupColumn_5entropy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("entropy (wrapper)", 0);
  __pyx_r = __pyx_pf_10jointpysam_6pileup_12PileupColumn_4entropy(((struct __pyx_obj_10jointpysam_6pileup_PileupColumn *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
 122: 
 123: 
 124:     def entropy(self):
/* "jointpysam/pileup.pyx":124
 * 
 * 
 *     def entropy(self):             # <<<<<<<<<<<<<<
 *         #print "TRACE:", "self._pos:", self._pos, "\tposition:", self._pos + 1, "\tdepth:", self._depth, "\t",
 *         #print [x for x in self._base_counts[:4]], "\t", self._bases
 */

static PyObject *__pyx_pf_10jointpysam_6pileup_12PileupColumn_4entropy(struct __pyx_obj_10jointpysam_6pileup_PileupColumn *__pyx_v_self) {
  PyObject *__pyx_v_x = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("entropy", 0);
 125:         #print "TRACE:", "self._pos:", self._pos, "\tposition:", self._pos + 1, "\tdepth:", self._depth, "\t",
 126:         #print [x for x in self._base_counts[:4]], "\t", self._bases
 127:         return -1 * sum([((float(x) / float(self._depth)) * math.log(float(x) / float(self._depth))) if x > 0 else 0 for x in self._base_counts[:4]])
  /* "jointpysam/pileup.pyx":127
 *         #print "TRACE:", "self._pos:", self._pos, "\tposition:", self._pos + 1, "\tdepth:", self._depth, "\t",
 *         #print [x for x in self._base_counts[:4]], "\t", self._bases
 *         return -1 * sum([((float(x) / float(self._depth)) * math.log(float(x) / float(self._depth))) if x > 0 else 0 for x in self._base_counts[:4]])             # <<<<<<<<<<<<<<
 *     def base_count(self, base):
 *         return self.get_nucleotide_count(base, 0, 0)
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = (__pyx_v_self->_base_counts + 4);
  for (__pyx_t_4 = __pyx_v_self->_base_counts; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
    __pyx_t_2 = __pyx_t_4;
    __pyx_t_5 = PyInt_FromLong((__pyx_t_2[0])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_XDECREF(__pyx_v_x);
    __pyx_v_x = __pyx_t_5;
    __pyx_t_5 = 0;
    __pyx_t_6 = PyObject_RichCompare(__pyx_v_x, __pyx_int_0, Py_GT); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (__pyx_t_7) {
      __pyx_t_8 = __Pyx_PyObject_AsDouble(__pyx_v_x); if (unlikely(__pyx_t_8 == ((double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      if (unlikely(((double)__pyx_v_self->_depth) == 0)) {
        PyErr_Format(PyExc_ZeroDivisionError, "float division");
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_6 = PyFloat_FromDouble((__pyx_t_8 / ((double)__pyx_v_self->_depth))); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_9 = __Pyx_GetName(__pyx_m, __pyx_n_s__math); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_10 = PyObject_GetAttr(__pyx_t_9, __pyx_n_s__log); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_8 = __Pyx_PyObject_AsDouble(__pyx_v_x); if (unlikely(__pyx_t_8 == ((double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      if (unlikely(((double)__pyx_v_self->_depth) == 0)) {
        PyErr_Format(PyExc_ZeroDivisionError, "float division");
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_9 = PyFloat_FromDouble((__pyx_t_8 / ((double)__pyx_v_self->_depth))); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_11);
      PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9);
      __Pyx_GIVEREF(__pyx_t_9);
      __pyx_t_9 = 0;
      __pyx_t_9 = PyObject_Call(__pyx_t_10, ((PyObject *)__pyx_t_11), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0;
      __pyx_t_11 = PyNumber_Multiply(__pyx_t_6, __pyx_t_9); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_5 = __pyx_t_11;
      __pyx_t_11 = 0;
    } else {
      __Pyx_INCREF(__pyx_int_0);
      __pyx_t_5 = __pyx_int_0;
    }
    if (unlikely(PyList_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF(((PyObject *)__pyx_t_1));
  PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_1));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_builtin_sum, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
  __pyx_t_5 = PyNumber_Multiply(__pyx_int_neg_1, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("jointpysam.pileup.PileupColumn.entropy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_x);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10jointpysam_6pileup_12PileupColumn_7base_count(PyObject *__pyx_v_self, PyObject *__pyx_v_base); /*proto*/
static PyObject *__pyx_pw_10jointpysam_6pileup_12PileupColumn_7base_count(PyObject *__pyx_v_self, PyObject *__pyx_v_base) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("base_count (wrapper)", 0);
  __pyx_r = __pyx_pf_10jointpysam_6pileup_12PileupColumn_6base_count(((struct __pyx_obj_10jointpysam_6pileup_PileupColumn *)__pyx_v_self), ((PyObject *)__pyx_v_base));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
 128:     def base_count(self, base):
/* "jointpysam/pileup.pyx":128
 *         #print [x for x in self._base_counts[:4]], "\t", self._bases
 *         return -1 * sum([((float(x) / float(self._depth)) * math.log(float(x) / float(self._depth))) if x > 0 else 0 for x in self._base_counts[:4]])
 *     def base_count(self, base):             # <<<<<<<<<<<<<<
 *         return self.get_nucleotide_count(base, 0, 0)
 *     property base_info:
 */

static PyObject *__pyx_pf_10jointpysam_6pileup_12PileupColumn_6base_count(struct __pyx_obj_10jointpysam_6pileup_PileupColumn *__pyx_v_self, PyObject *__pyx_v_base) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("base_count", 0);
 129:         return self.get_nucleotide_count(base, 0, 0)
  /* "jointpysam/pileup.pyx":129
 *         return -1 * sum([((float(x) / float(self._depth)) * math.log(float(x) / float(self._depth))) if x > 0 else 0 for x in self._base_counts[:4]])
 *     def base_count(self, base):
 *         return self.get_nucleotide_count(base, 0, 0)             # <<<<<<<<<<<<<<
 *     property base_info:
 *         def __get__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyBytes_AsString(__pyx_v_base); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = PyInt_FromLong(((struct __pyx_vtabstruct_10jointpysam_6pileup_PileupColumn *)__pyx_v_self->__pyx_vtab)->get_nucleotide_count(__pyx_v_self, __pyx_t_1, 0, 0)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("jointpysam.pileup.PileupColumn.base_count", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10jointpysam_6pileup_12PileupColumn_9base_info_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10jointpysam_6pileup_12PileupColumn_9base_info_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10jointpysam_6pileup_12PileupColumn_9base_info___get__(((struct __pyx_obj_10jointpysam_6pileup_PileupColumn *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
 130:     property base_info:
 131:         def __get__(self):
/* "jointpysam/pileup.pyx":131
 *         return self.get_nucleotide_count(base, 0, 0)
 *     property base_info:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             r = []
 *             for i in range(self._depth):
 */

static PyObject *__pyx_pf_10jointpysam_6pileup_12PileupColumn_9base_info___get__(struct __pyx_obj_10jointpysam_6pileup_PileupColumn *__pyx_v_self) {
  PyObject *__pyx_v_r = NULL;
  int __pyx_v_i;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
 132:             r = []
  /* "jointpysam/pileup.pyx":132
 *     property base_info:
 *         def __get__(self):
 *             r = []             # <<<<<<<<<<<<<<
 *             for i in range(self._depth):
 *                 r.append({'base': chr(self._bases[i]),
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_r = __pyx_t_1;
  __pyx_t_1 = 0;
 133:             for i in range(self._depth):
  /* "jointpysam/pileup.pyx":133
 *         def __get__(self):
 *             r = []
 *             for i in range(self._depth):             # <<<<<<<<<<<<<<
 *                 r.append({'base': chr(self._bases[i]),
 *                         'map_qual': self._map_quals[i],
 */
  __pyx_t_2 = __pyx_v_self->_depth;
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;
 134:                 r.append({'base': chr(self._bases[i]),
    /* "jointpysam/pileup.pyx":134
 *             r = []
 *             for i in range(self._depth):
 *                 r.append({'base': chr(self._bases[i]),             # <<<<<<<<<<<<<<
 *                         'map_qual': self._map_quals[i],
 *                         'base_qual': self._base_quals[i],
 */
    __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_1));
    __pyx_t_4 = PyInt_FromLong((__pyx_v_self->_bases[__pyx_v_i])); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_4 = PyObject_Call(__pyx_builtin_chr, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
    if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__base), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
 135:                         'map_qual': self._map_quals[i],
    /* "jointpysam/pileup.pyx":135
 *             for i in range(self._depth):
 *                 r.append({'base': chr(self._bases[i]),
 *                         'map_qual': self._map_quals[i],             # <<<<<<<<<<<<<<
 *                         'base_qual': self._base_quals[i],
 *                         'tail_distance': self._tail_distance[i],
 */
    __pyx_t_4 = PyInt_FromLong((__pyx_v_self->_map_quals[__pyx_v_i])); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__map_qual), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
 136:                         'base_qual': self._base_quals[i],
    /* "jointpysam/pileup.pyx":136
 *                 r.append({'base': chr(self._bases[i]),
 *                         'map_qual': self._map_quals[i],
 *                         'base_qual': self._base_quals[i],             # <<<<<<<<<<<<<<
 *                         'tail_distance': self._tail_distance[i],
 *                         'is_forward_strand': self._is_forward_strand[i],
 */
    __pyx_t_4 = PyInt_FromLong((__pyx_v_self->_base_quals[__pyx_v_i])); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__base_qual), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
 137:                         'tail_distance': self._tail_distance[i],
    /* "jointpysam/pileup.pyx":137
 *                         'map_qual': self._map_quals[i],
 *                         'base_qual': self._base_quals[i],
 *                         'tail_distance': self._tail_distance[i],             # <<<<<<<<<<<<<<
 *                         'is_forward_strand': self._is_forward_strand[i],
 *                         'indels': self._indels[i],
 */
    __pyx_t_4 = PyInt_FromLong((__pyx_v_self->_tail_distance[__pyx_v_i])); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__tail_distance), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
 138:                         'is_forward_strand': self._is_forward_strand[i],
    /* "jointpysam/pileup.pyx":138
 *                         'base_qual': self._base_quals[i],
 *                         'tail_distance': self._tail_distance[i],
 *                         'is_forward_strand': self._is_forward_strand[i],             # <<<<<<<<<<<<<<
 *                         'indels': self._indels[i],
 *                         'alignment_length': self._alignment_length[i]})
 */
    __pyx_t_4 = __Pyx_PyBool_FromLong((__pyx_v_self->_is_forward_strand[__pyx_v_i])); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__is_forward_strand), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
 139:                         'indels': self._indels[i],
    /* "jointpysam/pileup.pyx":139
 *                         'tail_distance': self._tail_distance[i],
 *                         'is_forward_strand': self._is_forward_strand[i],
 *                         'indels': self._indels[i],             # <<<<<<<<<<<<<<
 *                         'alignment_length': self._alignment_length[i]})
 * 
 */
    __pyx_t_4 = PyInt_FromLong((__pyx_v_self->_indels[__pyx_v_i])); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__indels), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
 140:                         'alignment_length': self._alignment_length[i]})
    /* "jointpysam/pileup.pyx":140
 *                         'is_forward_strand': self._is_forward_strand[i],
 *                         'indels': self._indels[i],
 *                         'alignment_length': self._alignment_length[i]})             # <<<<<<<<<<<<<<
 * 
 *             return r
 */
    __pyx_t_4 = PyInt_FromLong((__pyx_v_self->_alignment_length[__pyx_v_i])); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__alignment_length), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_6 = PyList_Append(__pyx_v_r, ((PyObject *)__pyx_t_1)); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  }
 141: 
 142:             return r
  /* "jointpysam/pileup.pyx":142
 *                         'alignment_length': self._alignment_length[i]})
 * 
 *             return r             # <<<<<<<<<<<<<<
 * 
 * #    property entropy:
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_r));
  __pyx_r = ((PyObject *)__pyx_v_r);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("jointpysam.pileup.PileupColumn.base_info.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_r);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10jointpysam_6pileup_12PileupColumn_8position_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10jointpysam_6pileup_12PileupColumn_8position_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10jointpysam_6pileup_12PileupColumn_8position___get__(((struct __pyx_obj_10jointpysam_6pileup_PileupColumn *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
 143: 
 144: #    property entropy:
 145: #	def __get__(self):
 146: #            return self._entropy
 147:     property position:
 148:         def __get__(self):
/* "jointpysam/pileup.pyx":148
 * #            return self._entropy
 *     property position:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._pos + 1
 *     property base_quals:
 */

static PyObject *__pyx_pf_10jointpysam_6pileup_12PileupColumn_8position___get__(struct __pyx_obj_10jointpysam_6pileup_PileupColumn *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
 149:             return self._pos + 1
  /* "jointpysam/pileup.pyx":149
 *     property position:
 *         def __get__(self):
 *             return self._pos + 1             # <<<<<<<<<<<<<<
 *     property base_quals:
 *         def __get__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyInt_FromLong((__pyx_v_self->_pos + 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("jointpysam.pileup.PileupColumn.position.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10jointpysam_6pileup_12PileupColumn_10base_quals_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10jointpysam_6pileup_12PileupColumn_10base_quals_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10jointpysam_6pileup_12PileupColumn_10base_quals___get__(((struct __pyx_obj_10jointpysam_6pileup_PileupColumn *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
 150:     property base_quals:
 151:         def __get__(self):
/* "jointpysam/pileup.pyx":151
 *             return self._pos + 1
 *     property base_quals:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return [x for x in self._base_quals[:self._depth]]
 *     property map_quals:
 */

static PyObject *__pyx_pf_10jointpysam_6pileup_12PileupColumn_10base_quals___get__(struct __pyx_obj_10jointpysam_6pileup_PileupColumn *__pyx_v_self) {
  PyObject *__pyx_v_x = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
 152:             return [x for x in self._base_quals[:self._depth]]
  /* "jointpysam/pileup.pyx":152
 *     property base_quals:
 *         def __get__(self):
 *             return [x for x in self._base_quals[:self._depth]]             # <<<<<<<<<<<<<<
 *     property map_quals:
 *         def __get__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = (__pyx_v_self->_base_quals + __pyx_v_self->_depth);
  for (__pyx_t_4 = __pyx_v_self->_base_quals; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
    __pyx_t_2 = __pyx_t_4;
    __pyx_t_5 = PyInt_FromLong((__pyx_t_2[0])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_XDECREF(__pyx_v_x);
    __pyx_v_x = __pyx_t_5;
    __pyx_t_5 = 0;
    if (unlikely(PyList_Append(__pyx_t_1, (PyObject*)__pyx_v_x))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_INCREF(((PyObject *)__pyx_t_1));
  __pyx_r = ((PyObject *)__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("jointpysam.pileup.PileupColumn.base_quals.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_x);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10jointpysam_6pileup_12PileupColumn_9map_quals_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10jointpysam_6pileup_12PileupColumn_9map_quals_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10jointpysam_6pileup_12PileupColumn_9map_quals___get__(((struct __pyx_obj_10jointpysam_6pileup_PileupColumn *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
 153:     property map_quals:
 154:         def __get__(self):
/* "jointpysam/pileup.pyx":154
 *             return [x for x in self._base_quals[:self._depth]]
 *     property map_quals:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return [x for x in self._map_quals[:self._depth]]
 *     property dels:
 */

static PyObject *__pyx_pf_10jointpysam_6pileup_12PileupColumn_9map_quals___get__(struct __pyx_obj_10jointpysam_6pileup_PileupColumn *__pyx_v_self) {
  PyObject *__pyx_v_x = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
 155:             return [x for x in self._map_quals[:self._depth]]
  /* "jointpysam/pileup.pyx":155
 *     property map_quals:
 *         def __get__(self):
 *             return [x for x in self._map_quals[:self._depth]]             # <<<<<<<<<<<<<<
 *     property dels:
 *         def __get__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = (__pyx_v_self->_map_quals + __pyx_v_self->_depth);
  for (__pyx_t_4 = __pyx_v_self->_map_quals; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
    __pyx_t_2 = __pyx_t_4;
    __pyx_t_5 = PyInt_FromLong((__pyx_t_2[0])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_XDECREF(__pyx_v_x);
    __pyx_v_x = __pyx_t_5;
    __pyx_t_5 = 0;
    if (unlikely(PyList_Append(__pyx_t_1, (PyObject*)__pyx_v_x))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_INCREF(((PyObject *)__pyx_t_1));
  __pyx_r = ((PyObject *)__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("jointpysam.pileup.PileupColumn.map_quals.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_x);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10jointpysam_6pileup_12PileupColumn_4dels_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10jointpysam_6pileup_12PileupColumn_4dels_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10jointpysam_6pileup_12PileupColumn_4dels___get__(((struct __pyx_obj_10jointpysam_6pileup_PileupColumn *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
 156:     property dels:
 157:         def __get__(self):
/* "jointpysam/pileup.pyx":157
 *             return [x for x in self._map_quals[:self._depth]]
 *     property dels:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._dels
 *     property bases:
 */

static PyObject *__pyx_pf_10jointpysam_6pileup_12PileupColumn_4dels___get__(struct __pyx_obj_10jointpysam_6pileup_PileupColumn *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
 158:             return self._dels
  /* "jointpysam/pileup.pyx":158
 *     property dels:
 *         def __get__(self):
 *             return self._dels             # <<<<<<<<<<<<<<
 *     property bases:
 *         def __get__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyInt_FromLong(__pyx_v_self->_dels); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("jointpysam.pileup.PileupColumn.dels.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10jointpysam_6pileup_12PileupColumn_5bases_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10jointpysam_6pileup_12PileupColumn_5bases_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10jointpysam_6pileup_12PileupColumn_5bases___get__(((struct __pyx_obj_10jointpysam_6pileup_PileupColumn *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
 159:     property bases:
 160:         def __get__(self):
/* "jointpysam/pileup.pyx":160
 *             return self._dels
 *     property bases:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return [x for x in self._bases[:self._depth]]
 *     property is_forward_strand:
 */

static PyObject *__pyx_pf_10jointpysam_6pileup_12PileupColumn_5bases___get__(struct __pyx_obj_10jointpysam_6pileup_PileupColumn *__pyx_v_self) {
  PyObject *__pyx_v_x = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
 161:             return [x for x in self._bases[:self._depth]]
  /* "jointpysam/pileup.pyx":161
 *     property bases:
 *         def __get__(self):
 *             return [x for x in self._bases[:self._depth]]             # <<<<<<<<<<<<<<
 *     property is_forward_strand:
 *         def __get__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyBytes_FromStringAndSize(__pyx_v_self->_bases + 0, __pyx_v_self->_depth - 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __pyx_t_3 = PyObject_GetIter(((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = Py_TYPE(__pyx_t_3)->tp_iternext;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  for (;;) {
    {
      __pyx_t_2 = __pyx_t_4(__pyx_t_3);
      if (unlikely(!__pyx_t_2)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_XDECREF(__pyx_v_x);
    __pyx_v_x = __pyx_t_2;
    __pyx_t_2 = 0;
    if (unlikely(PyList_Append(__pyx_t_1, (PyObject*)__pyx_v_x))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_INCREF(((PyObject *)__pyx_t_1));
  __pyx_r = ((PyObject *)__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("jointpysam.pileup.PileupColumn.bases.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_x);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10jointpysam_6pileup_12PileupColumn_17is_forward_strand_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10jointpysam_6pileup_12PileupColumn_17is_forward_strand_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10jointpysam_6pileup_12PileupColumn_17is_forward_strand___get__(((struct __pyx_obj_10jointpysam_6pileup_PileupColumn *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
 162:     property is_forward_strand:
 163:         def __get__(self):
/* "jointpysam/pileup.pyx":163
 *             return [x for x in self._bases[:self._depth]]
 *     property is_forward_strand:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             t = sum([x for x in self._is_forward_strand[:self._depth]])
 *             #print float(t) / float(self._depth)
 */

static PyObject *__pyx_pf_10jointpysam_6pileup_12PileupColumn_17is_forward_strand___get__(struct __pyx_obj_10jointpysam_6pileup_PileupColumn *__pyx_v_self) {
  CYTHON_UNUSED PyObject *__pyx_v_t = NULL;
  int __pyx_v_x;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
 164:             t = sum([x for x in self._is_forward_strand[:self._depth]])
  /* "jointpysam/pileup.pyx":164
 *     property is_forward_strand:
 *         def __get__(self):
 *             t = sum([x for x in self._is_forward_strand[:self._depth]])             # <<<<<<<<<<<<<<
 *             #print float(t) / float(self._depth)
 *             return [x for x in self._is_forward_strand[:self._depth]]
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = (__pyx_v_self->_is_forward_strand + __pyx_v_self->_depth);
  for (__pyx_t_4 = __pyx_v_self->_is_forward_strand; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
    __pyx_t_2 = __pyx_t_4;
    __pyx_v_x = (__pyx_t_2[0]);
    __pyx_t_5 = __Pyx_PyBool_FromLong(__pyx_v_x); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    if (unlikely(PyList_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF(((PyObject *)__pyx_t_1));
  PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_1));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_builtin_sum, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
  __pyx_v_t = __pyx_t_1;
  __pyx_t_1 = 0;
 165:             #print float(t) / float(self._depth)
 166:             return [x for x in self._is_forward_strand[:self._depth]]
  /* "jointpysam/pileup.pyx":166
 *             t = sum([x for x in self._is_forward_strand[:self._depth]])
 *             #print float(t) / float(self._depth)
 *             return [x for x in self._is_forward_strand[:self._depth]]             # <<<<<<<<<<<<<<
 *     property depth:
 *         def __get__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = (__pyx_v_self->_is_forward_strand + __pyx_v_self->_depth);
  for (__pyx_t_4 = __pyx_v_self->_is_forward_strand; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
    __pyx_t_2 = __pyx_t_4;
    __pyx_v_x = (__pyx_t_2[0]);
    __pyx_t_5 = __Pyx_PyBool_FromLong(__pyx_v_x); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    if (unlikely(PyList_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_INCREF(((PyObject *)__pyx_t_1));
  __pyx_r = ((PyObject *)__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("jointpysam.pileup.PileupColumn.is_forward_strand.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_t);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10jointpysam_6pileup_12PileupColumn_5depth_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10jointpysam_6pileup_12PileupColumn_5depth_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10jointpysam_6pileup_12PileupColumn_5depth___get__(((struct __pyx_obj_10jointpysam_6pileup_PileupColumn *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
 167:     property depth:
 168:         def __get__(self):
/* "jointpysam/pileup.pyx":168
 *             return [x for x in self._is_forward_strand[:self._depth]]
 *     property depth:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._depth
 *     property is_del:
 */

static PyObject *__pyx_pf_10jointpysam_6pileup_12PileupColumn_5depth___get__(struct __pyx_obj_10jointpysam_6pileup_PileupColumn *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
 169:             return self._depth
  /* "jointpysam/pileup.pyx":169
 *     property depth:
 *         def __get__(self):
 *             return self._depth             # <<<<<<<<<<<<<<
 *     property is_del:
 *         def __get__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyInt_FromLong(__pyx_v_self->_depth); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("jointpysam.pileup.PileupColumn.depth.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10jointpysam_6pileup_12PileupColumn_6is_del_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10jointpysam_6pileup_12PileupColumn_6is_del_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10jointpysam_6pileup_12PileupColumn_6is_del___get__(((struct __pyx_obj_10jointpysam_6pileup_PileupColumn *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
 170:     property is_del:
 171:         def __get__(self):
/* "jointpysam/pileup.pyx":171
 *             return self._depth
 *     property is_del:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return [x for x in self._is_del[:self._depth]]
 *     property alignment_length:
 */

static PyObject *__pyx_pf_10jointpysam_6pileup_12PileupColumn_6is_del___get__(struct __pyx_obj_10jointpysam_6pileup_PileupColumn *__pyx_v_self) {
  PyObject *__pyx_v_x = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
 172:             return [x for x in self._is_del[:self._depth]]
  /* "jointpysam/pileup.pyx":172
 *     property is_del:
 *         def __get__(self):
 *             return [x for x in self._is_del[:self._depth]]             # <<<<<<<<<<<<<<
 *     property alignment_length:
 *         def __get__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s___is_del); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PySequence_GetSlice(__pyx_t_2, 0, __pyx_v_self->_depth); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyList_CheckExact(__pyx_t_3) || PyTuple_CheckExact(__pyx_t_3)) {
    __pyx_t_2 = __pyx_t_3; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
  } else {
    __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  for (;;) {
    if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_2)) {
      if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break;
      __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++;
    } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_2)) {
      if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
      __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++;
    } else {
      __pyx_t_3 = __pyx_t_5(__pyx_t_2);
      if (unlikely(!__pyx_t_3)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_XDECREF(__pyx_v_x);
    __pyx_v_x = __pyx_t_3;
    __pyx_t_3 = 0;
    if (unlikely(PyList_Append(__pyx_t_1, (PyObject*)__pyx_v_x))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_INCREF(((PyObject *)__pyx_t_1));
  __pyx_r = ((PyObject *)__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("jointpysam.pileup.PileupColumn.is_del.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_x);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10jointpysam_6pileup_12PileupColumn_16alignment_length_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10jointpysam_6pileup_12PileupColumn_16alignment_length_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10jointpysam_6pileup_12PileupColumn_16alignment_length___get__(((struct __pyx_obj_10jointpysam_6pileup_PileupColumn *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
 173:     property alignment_length:
 174:         def __get__(self):
/* "jointpysam/pileup.pyx":174
 *             return [x for x in self._is_del[:self._depth]]
 *     property alignment_length:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return [x for x in self._alignment_length[:self._depth]]
 * 
 */

static PyObject *__pyx_pf_10jointpysam_6pileup_12PileupColumn_16alignment_length___get__(struct __pyx_obj_10jointpysam_6pileup_PileupColumn *__pyx_v_self) {
  PyObject *__pyx_v_x = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
 175:             return [x for x in self._alignment_length[:self._depth]]
  /* "jointpysam/pileup.pyx":175
 *     property alignment_length:
 *         def __get__(self):
 *             return [x for x in self._alignment_length[:self._depth]]             # <<<<<<<<<<<<<<
 * 
 *     property indels:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = (__pyx_v_self->_alignment_length + __pyx_v_self->_depth);
  for (__pyx_t_4 = __pyx_v_self->_alignment_length; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
    __pyx_t_2 = __pyx_t_4;
    __pyx_t_5 = PyInt_FromLong((__pyx_t_2[0])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_XDECREF(__pyx_v_x);
    __pyx_v_x = __pyx_t_5;
    __pyx_t_5 = 0;
    if (unlikely(PyList_Append(__pyx_t_1, (PyObject*)__pyx_v_x))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_INCREF(((PyObject *)__pyx_t_1));
  __pyx_r = ((PyObject *)__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("jointpysam.pileup.PileupColumn.alignment_length.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_x);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10jointpysam_6pileup_12PileupColumn_6indels_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10jointpysam_6pileup_12PileupColumn_6indels_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10jointpysam_6pileup_12PileupColumn_6indels___get__(((struct __pyx_obj_10jointpysam_6pileup_PileupColumn *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
 176: 
 177:     property indels:
 178:         def __get__(self):
/* "jointpysam/pileup.pyx":178
 * 
 *     property indels:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return [x for x in self._indels[:self._depth]]
 *     property tail_distance:
 */

static PyObject *__pyx_pf_10jointpysam_6pileup_12PileupColumn_6indels___get__(struct __pyx_obj_10jointpysam_6pileup_PileupColumn *__pyx_v_self) {
  PyObject *__pyx_v_x = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
 179:             return [x for x in self._indels[:self._depth]]
  /* "jointpysam/pileup.pyx":179
 *     property indels:
 *         def __get__(self):
 *             return [x for x in self._indels[:self._depth]]             # <<<<<<<<<<<<<<
 *     property tail_distance:
 *         def __get__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = (__pyx_v_self->_indels + __pyx_v_self->_depth);
  for (__pyx_t_4 = __pyx_v_self->_indels; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
    __pyx_t_2 = __pyx_t_4;
    __pyx_t_5 = PyInt_FromLong((__pyx_t_2[0])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_XDECREF(__pyx_v_x);
    __pyx_v_x = __pyx_t_5;
    __pyx_t_5 = 0;
    if (unlikely(PyList_Append(__pyx_t_1, (PyObject*)__pyx_v_x))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_INCREF(((PyObject *)__pyx_t_1));
  __pyx_r = ((PyObject *)__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("jointpysam.pileup.PileupColumn.indels.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_x);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10jointpysam_6pileup_12PileupColumn_13tail_distance_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10jointpysam_6pileup_12PileupColumn_13tail_distance_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10jointpysam_6pileup_12PileupColumn_13tail_distance___get__(((struct __pyx_obj_10jointpysam_6pileup_PileupColumn *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
 180:     property tail_distance:
 181:         def __get__(self):
/* "jointpysam/pileup.pyx":181
 *             return [x for x in self._indels[:self._depth]]
 *     property tail_distance:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return [x for x in self._tail_distance[:self._depth]]
 *     cdef int get_depth(self):
 */

static PyObject *__pyx_pf_10jointpysam_6pileup_12PileupColumn_13tail_distance___get__(struct __pyx_obj_10jointpysam_6pileup_PileupColumn *__pyx_v_self) {
  PyObject *__pyx_v_x = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
 182:             return [x for x in self._tail_distance[:self._depth]]
  /* "jointpysam/pileup.pyx":182
 *     property tail_distance:
 *         def __get__(self):
 *             return [x for x in self._tail_distance[:self._depth]]             # <<<<<<<<<<<<<<
 *     cdef int get_depth(self):
 *         return self._depth
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = (__pyx_v_self->_tail_distance + __pyx_v_self->_depth);
  for (__pyx_t_4 = __pyx_v_self->_tail_distance; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
    __pyx_t_2 = __pyx_t_4;
    __pyx_t_5 = PyInt_FromLong((__pyx_t_2[0])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_XDECREF(__pyx_v_x);
    __pyx_v_x = __pyx_t_5;
    __pyx_t_5 = 0;
    if (unlikely(PyList_Append(__pyx_t_1, (PyObject*)__pyx_v_x))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_INCREF(((PyObject *)__pyx_t_1));
  __pyx_r = ((PyObject *)__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("jointpysam.pileup.PileupColumn.tail_distance.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_x);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
 183:     cdef int get_depth(self):
/* "jointpysam/pileup.pyx":183
 *         def __get__(self):
 *             return [x for x in self._tail_distance[:self._depth]]
 *     cdef int get_depth(self):             # <<<<<<<<<<<<<<
 *         return self._depth
 * 
 */

static int __pyx_f_10jointpysam_6pileup_12PileupColumn_get_depth(struct __pyx_obj_10jointpysam_6pileup_PileupColumn *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_depth", 0);
 184:         return self._depth
  /* "jointpysam/pileup.pyx":184
 *             return [x for x in self._tail_distance[:self._depth]]
 *     cdef int get_depth(self):
 *         return self._depth             # <<<<<<<<<<<<<<
 * 
 *     cdef int get_nucleotide_count(self, char * base, int min_base_qual, int min_map_qual):
 */
  __pyx_r = __pyx_v_self->_depth;
  goto __pyx_L0;

  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
 185: 
 186:     cdef int get_nucleotide_count(self, char * base, int min_base_qual, int min_map_qual):
/* "jointpysam/pileup.pyx":186
 *         return self._depth
 * 
 *     cdef int get_nucleotide_count(self, char * base, int min_base_qual, int min_map_qual):             # <<<<<<<<<<<<<<
 *         '''
 *         Retrieve the number of nucleotides found at this position. Counts will be initialised to 0 in the method.
 */

static int __pyx_f_10jointpysam_6pileup_12PileupColumn_get_nucleotide_count(struct __pyx_obj_10jointpysam_6pileup_PileupColumn *__pyx_v_self, char *__pyx_v_base, int __pyx_v_min_base_qual, int __pyx_v_min_map_qual) {
  int __pyx_v_i;
  int __pyx_v_count;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_nucleotide_count", 0);
 187:         '''
 188:         Retrieve the number of nucleotides found at this position. Counts will be initialised to 0 in the method.
 189: 
 190:         Arguments:
 191:         base - a char * containing the query base.
 192:         min_base_qual - nucleotides will only be counted if their base quality exceeds this value.
 193:         min_map_qual - nucleotides will only be counted if their mapping quality exceeds this value.
 194:         '''
 195:         cdef int i
 196:         cdef int count
 197: 
 198:         count = 0
  /* "jointpysam/pileup.pyx":198
 *         cdef int count
 * 
 *         count = 0             # <<<<<<<<<<<<<<
 * 
 *         for i in range(self._depth):
 */
  __pyx_v_count = 0;
 199: 
 200:         for i in range(self._depth):
  /* "jointpysam/pileup.pyx":200
 *         count = 0
 * 
 *         for i in range(self._depth):             # <<<<<<<<<<<<<<
 *             if self._base_quals[i] < min_base_qual or self._map_quals[i] < min_map_qual:
 *                 continue
 */
  __pyx_t_1 = __pyx_v_self->_depth;
  for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
    __pyx_v_i = __pyx_t_2;
 201:             if self._base_quals[i] < min_base_qual or self._map_quals[i] < min_map_qual:
    /* "jointpysam/pileup.pyx":201
 * 
 *         for i in range(self._depth):
 *             if self._base_quals[i] < min_base_qual or self._map_quals[i] < min_map_qual:             # <<<<<<<<<<<<<<
 *                 continue
 * 
 */
    __pyx_t_3 = ((__pyx_v_self->_base_quals[__pyx_v_i]) < __pyx_v_min_base_qual);
    if (!__pyx_t_3) {
      __pyx_t_4 = ((__pyx_v_self->_map_quals[__pyx_v_i]) < __pyx_v_min_map_qual);
      __pyx_t_5 = __pyx_t_4;
    } else {
      __pyx_t_5 = __pyx_t_3;
    }
    if (__pyx_t_5) {
 202:                 continue
      /* "jointpysam/pileup.pyx":202
 *         for i in range(self._depth):
 *             if self._base_quals[i] < min_base_qual or self._map_quals[i] < min_map_qual:
 *                 continue             # <<<<<<<<<<<<<<
 * 
 *             if base[0] == self._bases[i]:
 */
      goto __pyx_L3_continue;
      goto __pyx_L5;
    }
    __pyx_L5:;
 203: 
 204:             if base[0] == self._bases[i]:
    /* "jointpysam/pileup.pyx":204
 *                 continue
 * 
 *             if base[0] == self._bases[i]:             # <<<<<<<<<<<<<<
 *                 count += 1
 * 
 */
    __pyx_t_5 = ((__pyx_v_base[0]) == (__pyx_v_self->_bases[__pyx_v_i]));
    if (__pyx_t_5) {
 205:                 count += 1
      /* "jointpysam/pileup.pyx":205
 * 
 *             if base[0] == self._bases[i]:
 *                 count += 1             # <<<<<<<<<<<<<<
 * 
 *         return count
 */
      __pyx_v_count = (__pyx_v_count + 1);
      goto __pyx_L6;
    }
    __pyx_L6:;
    __pyx_L3_continue:;
  }
 206: 
 207:         return count
  /* "jointpysam/pileup.pyx":207
 *                 count += 1
 * 
 *         return count             # <<<<<<<<<<<<<<
 * 
 * #    cdef int is_forward_strand(self):
 */
  __pyx_r = __pyx_v_count;
  goto __pyx_L0;

  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
 208: 
 209: #    cdef int is_forward_strand(self):
 210: #        return 0
 211: #=======================================================================================================================
 212: # Factory methods
 213: #=======================================================================================================================
 214: #cdef alignment_read makeAlignmentRead(bam1_t * alignment, int qpos):
 215: #    cdef alignment_read read
 216: #    read.qpos = qpos
 217: #    read.base = get_base(alignment, qpos)
 218: #    read.is_forward_strand = ((alignment.core.flag & BAM_FREVERSE) == 0)
 219: #    read.tail_distance = alignment.core.l_qseq - qpos
 220: #    read.alignment_length = alignment.core.l_qseq
 221: #    read.map_qual = alignment.core.qual
 222: #    read.base_qual = get_qual(alignment, qpos)
 223: #    read.base_matches_before = 0
 224: #    read.base_matches_after = 0
 225: #    return read
 226: 
 227: cdef makePileupColumn(bam_pileup1_t * plp, int tid, int pos, int n_plp):
/* "jointpysam/pileup.pyx":227
 * #    return read
 * 
 * cdef makePileupColumn(bam_pileup1_t * plp, int tid, int pos, int n_plp):             # <<<<<<<<<<<<<<
 *     cdef int i, depth, index, qpos, entropy
 *     cdef bam1_t * alignment
 */

static PyObject *__pyx_f_10jointpysam_6pileup_makePileupColumn(bam_pileup1_t *__pyx_v_plp, int __pyx_v_tid, int __pyx_v_pos, int __pyx_v_n_plp) {
  int __pyx_v_i;
  int __pyx_v_index;
  int __pyx_v_qpos;
  bam1_t *__pyx_v_alignment;
  bam_pileup1_t *__pyx_v_pileup;
  struct __pyx_obj_10jointpysam_6pileup_PileupColumn *__pyx_v_column = 0;
  int __pyx_v__dels;
  char __pyx_v_base;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("makePileupColumn", 0);
 228:     cdef int i, depth, index, qpos, entropy
 229:     cdef bam1_t * alignment
 230:     cdef bam_pileup1_t * pileup
 231: 
 232:     cdef PileupColumn column = PileupColumn.__new__(PileupColumn)
  /* "jointpysam/pileup.pyx":232
 *     cdef bam_pileup1_t * pileup
 * 
 *     cdef PileupColumn column = PileupColumn.__new__(PileupColumn)             # <<<<<<<<<<<<<<
 * 
 *     column._tid = tid
 */
  __pyx_t_1 = __Pyx_tp_new(((PyObject*)__pyx_ptype_10jointpysam_6pileup_PileupColumn)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_10jointpysam_6pileup_PileupColumn)))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_column = ((struct __pyx_obj_10jointpysam_6pileup_PileupColumn *)__pyx_t_1);
  __pyx_t_1 = 0;
 233: 
 234:     column._tid = tid
  /* "jointpysam/pileup.pyx":234
 *     cdef PileupColumn column = PileupColumn.__new__(PileupColumn)
 * 
 *     column._tid = tid             # <<<<<<<<<<<<<<
 *     column._pos = pos
 *     #cdef int[4] base_counts = [0, 0, 0, 0]
 */
  __pyx_v_column->_tid = __pyx_v_tid;
 235:     column._pos = pos
  /* "jointpysam/pileup.pyx":235
 * 
 *     column._tid = tid
 *     column._pos = pos             # <<<<<<<<<<<<<<
 *     #cdef int[4] base_counts = [0, 0, 0, 0]
 *     column._depth = get_covered_depth(plp, n_plp)
 */
  __pyx_v_column->_pos = __pyx_v_pos;
 236:     #cdef int[4] base_counts = [0, 0, 0, 0]
 237:     column._depth = get_covered_depth(plp, n_plp)
  /* "jointpysam/pileup.pyx":237
 *     column._pos = pos
 *     #cdef int[4] base_counts = [0, 0, 0, 0]
 *     column._depth = get_covered_depth(plp, n_plp)             # <<<<<<<<<<<<<<
 *     cdef int _dels = 0
 * #    column._reads = < alignment_read *> malloc(sizeof(alignment_read) * column._depth)
 */
  __pyx_v_column->_depth = __pyx_f_10jointpysam_6pileup_get_covered_depth(__pyx_v_plp, __pyx_v_n_plp);
 238:     cdef int _dels = 0
  /* "jointpysam/pileup.pyx":238
 *     #cdef int[4] base_counts = [0, 0, 0, 0]
 *     column._depth = get_covered_depth(plp, n_plp)
 *     cdef int _dels = 0             # <<<<<<<<<<<<<<
 * #    column._reads = < alignment_read *> malloc(sizeof(alignment_read) * column._depth)
 *     column._bases = < char *> malloc(sizeof(char) * column._depth)
 */
  __pyx_v__dels = 0;
 239: #    column._reads = < alignment_read *> malloc(sizeof(alignment_read) * column._depth)
 240:     column._bases = < char *> malloc(sizeof(char) * column._depth)
  /* "jointpysam/pileup.pyx":240
 *     cdef int _dels = 0
 * #    column._reads = < alignment_read *> malloc(sizeof(alignment_read) * column._depth)
 *     column._bases = < char *> malloc(sizeof(char) * column._depth)             # <<<<<<<<<<<<<<
 *     column._base_quals = < int *> malloc(sizeof(int) * column._depth)
 *     column._map_quals = < int *> malloc(sizeof(int) * column._depth)
 */
  __pyx_v_column->_bases = ((char *)malloc(((sizeof(char)) * __pyx_v_column->_depth)));
 241:     column._base_quals = < int *> malloc(sizeof(int) * column._depth)
  /* "jointpysam/pileup.pyx":241
 * #    column._reads = < alignment_read *> malloc(sizeof(alignment_read) * column._depth)
 *     column._bases = < char *> malloc(sizeof(char) * column._depth)
 *     column._base_quals = < int *> malloc(sizeof(int) * column._depth)             # <<<<<<<<<<<<<<
 *     column._map_quals = < int *> malloc(sizeof(int) * column._depth)
 *     column._tail_distance = < int *> malloc(sizeof(int) * column._depth)
 */
  __pyx_v_column->_base_quals = ((int *)malloc(((sizeof(int)) * __pyx_v_column->_depth)));
 242:     column._map_quals = < int *> malloc(sizeof(int) * column._depth)
  /* "jointpysam/pileup.pyx":242
 *     column._bases = < char *> malloc(sizeof(char) * column._depth)
 *     column._base_quals = < int *> malloc(sizeof(int) * column._depth)
 *     column._map_quals = < int *> malloc(sizeof(int) * column._depth)             # <<<<<<<<<<<<<<
 *     column._tail_distance = < int *> malloc(sizeof(int) * column._depth)
 *     column._is_forward_strand = < bint *>  malloc(sizeof(int) * column._depth)
 */
  __pyx_v_column->_map_quals = ((int *)malloc(((sizeof(int)) * __pyx_v_column->_depth)));
 243:     column._tail_distance = < int *> malloc(sizeof(int) * column._depth)
  /* "jointpysam/pileup.pyx":243
 *     column._base_quals = < int *> malloc(sizeof(int) * column._depth)
 *     column._map_quals = < int *> malloc(sizeof(int) * column._depth)
 *     column._tail_distance = < int *> malloc(sizeof(int) * column._depth)             # <<<<<<<<<<<<<<
 *     column._is_forward_strand = < bint *>  malloc(sizeof(int) * column._depth)
 *     column._indels = < int *> malloc(sizeof(int) * column._depth)
 */
  __pyx_v_column->_tail_distance = ((int *)malloc(((sizeof(int)) * __pyx_v_column->_depth)));
 244:     column._is_forward_strand = < bint *>  malloc(sizeof(int) * column._depth)
  /* "jointpysam/pileup.pyx":244
 *     column._map_quals = < int *> malloc(sizeof(int) * column._depth)
 *     column._tail_distance = < int *> malloc(sizeof(int) * column._depth)
 *     column._is_forward_strand = < bint *>  malloc(sizeof(int) * column._depth)             # <<<<<<<<<<<<<<
 *     column._indels = < int *> malloc(sizeof(int) * column._depth)
 *     column._alignment_length = < int *> malloc(sizeof(int) * column._depth)
 */
  __pyx_v_column->_is_forward_strand = ((int *)malloc(((sizeof(int)) * __pyx_v_column->_depth)));
 245:     column._indels = < int *> malloc(sizeof(int) * column._depth)
  /* "jointpysam/pileup.pyx":245
 *     column._tail_distance = < int *> malloc(sizeof(int) * column._depth)
 *     column._is_forward_strand = < bint *>  malloc(sizeof(int) * column._depth)
 *     column._indels = < int *> malloc(sizeof(int) * column._depth)             # <<<<<<<<<<<<<<
 *     column._alignment_length = < int *> malloc(sizeof(int) * column._depth)
 *     column._base_counts = < int *> malloc(sizeof(int) * 4)
 */
  __pyx_v_column->_indels = ((int *)malloc(((sizeof(int)) * __pyx_v_column->_depth)));
 246:     column._alignment_length = < int *> malloc(sizeof(int) * column._depth)
  /* "jointpysam/pileup.pyx":246
 *     column._is_forward_strand = < bint *>  malloc(sizeof(int) * column._depth)
 *     column._indels = < int *> malloc(sizeof(int) * column._depth)
 *     column._alignment_length = < int *> malloc(sizeof(int) * column._depth)             # <<<<<<<<<<<<<<
 *     column._base_counts = < int *> malloc(sizeof(int) * 4)
 *     index = 0
 */
  __pyx_v_column->_alignment_length = ((int *)malloc(((sizeof(int)) * __pyx_v_column->_depth)));
 247:     column._base_counts = < int *> malloc(sizeof(int) * 4)
  /* "jointpysam/pileup.pyx":247
 *     column._indels = < int *> malloc(sizeof(int) * column._depth)
 *     column._alignment_length = < int *> malloc(sizeof(int) * column._depth)
 *     column._base_counts = < int *> malloc(sizeof(int) * 4)             # <<<<<<<<<<<<<<
 *     index = 0
 *     column._base_counts[0] = 0
 */
  __pyx_v_column->_base_counts = ((int *)malloc(((sizeof(int)) * 4)));
 248:     index = 0
  /* "jointpysam/pileup.pyx":248
 *     column._alignment_length = < int *> malloc(sizeof(int) * column._depth)
 *     column._base_counts = < int *> malloc(sizeof(int) * 4)
 *     index = 0             # <<<<<<<<<<<<<<
 *     column._base_counts[0] = 0
 *     column._base_counts[1] = 0
 */
  __pyx_v_index = 0;
 249:     column._base_counts[0] = 0
  /* "jointpysam/pileup.pyx":249
 *     column._base_counts = < int *> malloc(sizeof(int) * 4)
 *     index = 0
 *     column._base_counts[0] = 0             # <<<<<<<<<<<<<<
 *     column._base_counts[1] = 0
 *     column._base_counts[2] = 0
 */
  (__pyx_v_column->_base_counts[0]) = 0;
 250:     column._base_counts[1] = 0
  /* "jointpysam/pileup.pyx":250
 *     index = 0
 *     column._base_counts[0] = 0
 *     column._base_counts[1] = 0             # <<<<<<<<<<<<<<
 *     column._base_counts[2] = 0
 *     column._base_counts[3] = 0
 */
  (__pyx_v_column->_base_counts[1]) = 0;
 251:     column._base_counts[2] = 0
  /* "jointpysam/pileup.pyx":251
 *     column._base_counts[0] = 0
 *     column._base_counts[1] = 0
 *     column._base_counts[2] = 0             # <<<<<<<<<<<<<<
 *     column._base_counts[3] = 0
 *     # print "alignment indels:"
 */
  (__pyx_v_column->_base_counts[2]) = 0;
 252:     column._base_counts[3] = 0
  /* "jointpysam/pileup.pyx":252
 *     column._base_counts[1] = 0
 *     column._base_counts[2] = 0
 *     column._base_counts[3] = 0             # <<<<<<<<<<<<<<
 *     # print "alignment indels:"
 *     #cdef char base
 */
  (__pyx_v_column->_base_counts[3]) = 0;
 253:     # print "alignment indels:"
 254:     #cdef char base
 255:     for i in range(n_plp):
  /* "jointpysam/pileup.pyx":255
 *     # print "alignment indels:"
 *     #cdef char base
 *     for i in range(n_plp):             # <<<<<<<<<<<<<<
 *         pileup = & plp[i]
 *         if pileup.is_del:
 */
  __pyx_t_2 = __pyx_v_n_plp;
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;
 256:         pileup = & plp[i]
    /* "jointpysam/pileup.pyx":256
 *     #cdef char base
 *     for i in range(n_plp):
 *         pileup = & plp[i]             # <<<<<<<<<<<<<<
 *         if pileup.is_del:
 *             _dels += 1
 */
    __pyx_v_pileup = (&(__pyx_v_plp[__pyx_v_i]));
 257:         if pileup.is_del:
    /* "jointpysam/pileup.pyx":257
 *     for i in range(n_plp):
 *         pileup = & plp[i]
 *         if pileup.is_del:             # <<<<<<<<<<<<<<
 *             _dels += 1
 *             continue
 */
    if (__pyx_v_pileup->is_del) {
 258:             _dels += 1
      /* "jointpysam/pileup.pyx":258
 *         pileup = & plp[i]
 *         if pileup.is_del:
 *             _dels += 1             # <<<<<<<<<<<<<<
 *             continue
 *         alignment = bam_dup1(pileup.b)
 */
      __pyx_v__dels = (__pyx_v__dels + 1);
 259:             continue
      /* "jointpysam/pileup.pyx":259
 *         if pileup.is_del:
 *             _dels += 1
 *             continue             # <<<<<<<<<<<<<<
 *         alignment = bam_dup1(pileup.b)
 *         qpos = pileup.qpos
 */
      goto __pyx_L3_continue;
      goto __pyx_L5;
    }
    __pyx_L5:;
 260:         alignment = bam_dup1(pileup.b)
    /* "jointpysam/pileup.pyx":260
 *             _dels += 1
 *             continue
 *         alignment = bam_dup1(pileup.b)             # <<<<<<<<<<<<<<
 *         qpos = pileup.qpos
 *         base = get_base(alignment, qpos)
 */
    __pyx_v_alignment = bam_dup1(__pyx_v_pileup->b);
 261:         qpos = pileup.qpos
    /* "jointpysam/pileup.pyx":261
 *             continue
 *         alignment = bam_dup1(pileup.b)
 *         qpos = pileup.qpos             # <<<<<<<<<<<<<<
 *         base = get_base(alignment, qpos)
 *         if base == 'A':
 */
    __pyx_v_qpos = __pyx_v_pileup->qpos;
 262:         base = get_base(alignment, qpos)
    /* "jointpysam/pileup.pyx":262
 *         alignment = bam_dup1(pileup.b)
 *         qpos = pileup.qpos
 *         base = get_base(alignment, qpos)             # <<<<<<<<<<<<<<
 *         if base == 'A':
 *             column._base_counts[0] += 1
 */
    __pyx_v_base = __pyx_f_10jointpysam_6pileup_get_base(__pyx_v_alignment, __pyx_v_qpos);
 263:         if base == 'A':
    /* "jointpysam/pileup.pyx":263
 *         qpos = pileup.qpos
 *         base = get_base(alignment, qpos)
 *         if base == 'A':             # <<<<<<<<<<<<<<
 *             column._base_counts[0] += 1
 *         if base == 'C':
 */
    __pyx_t_4 = (__pyx_v_base == 'A');
    if (__pyx_t_4) {
 264:             column._base_counts[0] += 1
      /* "jointpysam/pileup.pyx":264
 *         base = get_base(alignment, qpos)
 *         if base == 'A':
 *             column._base_counts[0] += 1             # <<<<<<<<<<<<<<
 *         if base == 'C':
 *             column._base_counts[1] += 1
 */
      __pyx_t_5 = 0;
      (__pyx_v_column->_base_counts[__pyx_t_5]) = ((__pyx_v_column->_base_counts[__pyx_t_5]) + 1);
      goto __pyx_L6;
    }
    __pyx_L6:;
 265:         if base == 'C':
    /* "jointpysam/pileup.pyx":265
 *         if base == 'A':
 *             column._base_counts[0] += 1
 *         if base == 'C':             # <<<<<<<<<<<<<<
 *             column._base_counts[1] += 1
 *         if base == 'G':
 */
    __pyx_t_4 = (__pyx_v_base == 'C');
    if (__pyx_t_4) {
 266:             column._base_counts[1] += 1
      /* "jointpysam/pileup.pyx":266
 *             column._base_counts[0] += 1
 *         if base == 'C':
 *             column._base_counts[1] += 1             # <<<<<<<<<<<<<<
 *         if base == 'G':
 *             column._base_counts[2] += 1
 */
      __pyx_t_5 = 1;
      (__pyx_v_column->_base_counts[__pyx_t_5]) = ((__pyx_v_column->_base_counts[__pyx_t_5]) + 1);
      goto __pyx_L7;
    }
    __pyx_L7:;
 267:         if base == 'G':
    /* "jointpysam/pileup.pyx":267
 *         if base == 'C':
 *             column._base_counts[1] += 1
 *         if base == 'G':             # <<<<<<<<<<<<<<
 *             column._base_counts[2] += 1
 *         if base == 'T':
 */
    __pyx_t_4 = (__pyx_v_base == 'G');
    if (__pyx_t_4) {
 268:             column._base_counts[2] += 1
      /* "jointpysam/pileup.pyx":268
 *             column._base_counts[1] += 1
 *         if base == 'G':
 *             column._base_counts[2] += 1             # <<<<<<<<<<<<<<
 *         if base == 'T':
 *             column._base_counts[3] += 1
 */
      __pyx_t_5 = 2;
      (__pyx_v_column->_base_counts[__pyx_t_5]) = ((__pyx_v_column->_base_counts[__pyx_t_5]) + 1);
      goto __pyx_L8;
    }
    __pyx_L8:;
 269:         if base == 'T':
    /* "jointpysam/pileup.pyx":269
 *         if base == 'G':
 *             column._base_counts[2] += 1
 *         if base == 'T':             # <<<<<<<<<<<<<<
 *             column._base_counts[3] += 1
 *     #if base == base_filter or base_filter == '0':
 */
    __pyx_t_4 = (__pyx_v_base == 'T');
    if (__pyx_t_4) {
 270:             column._base_counts[3] += 1
      /* "jointpysam/pileup.pyx":270
 *             column._base_counts[2] += 1
 *         if base == 'T':
 *             column._base_counts[3] += 1             # <<<<<<<<<<<<<<
 *     #if base == base_filter or base_filter == '0':
 * #        column._reads[index] = makeAlignmentRead(alignment, qpos)
 */
      __pyx_t_5 = 3;
      (__pyx_v_column->_base_counts[__pyx_t_5]) = ((__pyx_v_column->_base_counts[__pyx_t_5]) + 1);
      goto __pyx_L9;
    }
    __pyx_L9:;
 271:     #if base == base_filter or base_filter == '0':
 272: #        column._reads[index] = makeAlignmentRead(alignment, qpos)
 273:         column._bases[index] = get_base(alignment, qpos)
    /* "jointpysam/pileup.pyx":273
 *     #if base == base_filter or base_filter == '0':
 * #        column._reads[index] = makeAlignmentRead(alignment, qpos)
 *         column._bases[index] = get_base(alignment, qpos)             # <<<<<<<<<<<<<<
 *         column._base_quals[index] = get_qual(alignment, qpos)
 *         column._map_quals[index] = alignment.core.qual
 */
    (__pyx_v_column->_bases[__pyx_v_index]) = __pyx_f_10jointpysam_6pileup_get_base(__pyx_v_alignment, __pyx_v_qpos);
 274:         column._base_quals[index] = get_qual(alignment, qpos)
    /* "jointpysam/pileup.pyx":274
 * #        column._reads[index] = makeAlignmentRead(alignment, qpos)
 *         column._bases[index] = get_base(alignment, qpos)
 *         column._base_quals[index] = get_qual(alignment, qpos)             # <<<<<<<<<<<<<<
 *         column._map_quals[index] = alignment.core.qual
 *         column._tail_distance[index] = min(alignment.core.l_qseq - qpos, qpos)
 */
    (__pyx_v_column->_base_quals[__pyx_v_index]) = __pyx_f_10jointpysam_6pileup_get_qual(__pyx_v_alignment, __pyx_v_qpos);
 275:         column._map_quals[index] = alignment.core.qual
    /* "jointpysam/pileup.pyx":275
 *         column._bases[index] = get_base(alignment, qpos)
 *         column._base_quals[index] = get_qual(alignment, qpos)
 *         column._map_quals[index] = alignment.core.qual             # <<<<<<<<<<<<<<
 *         column._tail_distance[index] = min(alignment.core.l_qseq - qpos, qpos)
 *         column._alignment_length[index] = alignment.core.l_qseq
 */
    (__pyx_v_column->_map_quals[__pyx_v_index]) = __pyx_v_alignment->core.qual;
 276:         column._tail_distance[index] = min(alignment.core.l_qseq - qpos, qpos)
    /* "jointpysam/pileup.pyx":276
 *         column._base_quals[index] = get_qual(alignment, qpos)
 *         column._map_quals[index] = alignment.core.qual
 *         column._tail_distance[index] = min(alignment.core.l_qseq - qpos, qpos)             # <<<<<<<<<<<<<<
 *         column._alignment_length[index] = alignment.core.l_qseq
 *         column._is_forward_strand[index] = ((alignment.core.flag & BAM_FREVERSE) == 0)
 */
    __pyx_t_6 = __pyx_v_qpos;
    __pyx_t_7 = (__pyx_v_alignment->core.l_qseq - __pyx_v_qpos);
    if ((__pyx_t_6 < __pyx_t_7)) {
      __pyx_t_8 = __pyx_t_6;
    } else {
      __pyx_t_8 = __pyx_t_7;
    }
    (__pyx_v_column->_tail_distance[__pyx_v_index]) = __pyx_t_8;
 277:         column._alignment_length[index] = alignment.core.l_qseq
    /* "jointpysam/pileup.pyx":277
 *         column._map_quals[index] = alignment.core.qual
 *         column._tail_distance[index] = min(alignment.core.l_qseq - qpos, qpos)
 *         column._alignment_length[index] = alignment.core.l_qseq             # <<<<<<<<<<<<<<
 *         column._is_forward_strand[index] = ((alignment.core.flag & BAM_FREVERSE) == 0)
 *         column._indels[index] = pileup.indel
 */
    (__pyx_v_column->_alignment_length[__pyx_v_index]) = __pyx_v_alignment->core.l_qseq;
 278:         column._is_forward_strand[index] = ((alignment.core.flag & BAM_FREVERSE) == 0)
    /* "jointpysam/pileup.pyx":278
 *         column._tail_distance[index] = min(alignment.core.l_qseq - qpos, qpos)
 *         column._alignment_length[index] = alignment.core.l_qseq
 *         column._is_forward_strand[index] = ((alignment.core.flag & BAM_FREVERSE) == 0)             # <<<<<<<<<<<<<<
 *         column._indels[index] = pileup.indel
 *      #   print pileup.indel,
 */
    (__pyx_v_column->_is_forward_strand[__pyx_v_index]) = ((__pyx_v_alignment->core.flag & BAM_FREVERSE) == 0);
 279:         column._indels[index] = pileup.indel
    /* "jointpysam/pileup.pyx":279
 *         column._alignment_length[index] = alignment.core.l_qseq
 *         column._is_forward_strand[index] = ((alignment.core.flag & BAM_FREVERSE) == 0)
 *         column._indels[index] = pileup.indel             # <<<<<<<<<<<<<<
 *      #   print pileup.indel,
 *         bam_destroy1(alignment)
 */
    (__pyx_v_column->_indels[__pyx_v_index]) = __pyx_v_pileup->indel;
 280:      #   print pileup.indel,
 281:         bam_destroy1(alignment)
    /* "jointpysam/pileup.pyx":281
 *         column._indels[index] = pileup.indel
 *      #   print pileup.indel,
 *         bam_destroy1(alignment)             # <<<<<<<<<<<<<<
 * 
 *         index += 1
 */
    bam_destroy1(__pyx_v_alignment);
 282: 
 283:         index += 1
    /* "jointpysam/pileup.pyx":283
 *         bam_destroy1(alignment)
 * 
 *         index += 1             # <<<<<<<<<<<<<<
 *     return column
 * #=======================================================================================================================
 */
    __pyx_v_index = (__pyx_v_index + 1);
    __pyx_L3_continue:;
  }
 284:     return column
  /* "jointpysam/pileup.pyx":284
 * 
 *         index += 1
 *     return column             # <<<<<<<<<<<<<<
 * #=======================================================================================================================
 * # Utility functions and structs
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_column));
  __pyx_r = ((PyObject *)__pyx_v_column);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("jointpysam.pileup.makePileupColumn", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_column);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
 285: #=======================================================================================================================
 286: # Utility functions and structs
 287: #=======================================================================================================================
 288: cdef int advance_all(void * data, bam1_t * b):
/* "jointpysam/pileup.pyx":288
 * # Utility functions and structs
 * #=======================================================================================================================
 * cdef int advance_all(void * data, bam1_t * b):             # <<<<<<<<<<<<<<
 *     '''
 *     Advance without any read filtering.
 */

static int __pyx_f_10jointpysam_6pileup_advance_all(void *__pyx_v_data, bam1_t *__pyx_v_b) {
  __pyx_t_10jointpysam_6pileup_iter_data_t *__pyx_v_d;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("advance_all", 0);
 289:     '''
 290:     Advance without any read filtering.
 291:     '''
 292:     cdef iter_data_t * d
 293: 
 294:     d = < iter_data_t *> data
  /* "jointpysam/pileup.pyx":294
 *     cdef iter_data_t * d
 * 
 *     d = < iter_data_t *> data             # <<<<<<<<<<<<<<
 * 
 *     return bam_iter_read(d.bam_file_ptr.x.bam, d.iter, b)
 */
  __pyx_v_d = ((__pyx_t_10jointpysam_6pileup_iter_data_t *)__pyx_v_data);
 295: 
 296:     return bam_iter_read(d.bam_file_ptr.x.bam, d.iter, b)
  /* "jointpysam/pileup.pyx":296
 *     d = < iter_data_t *> data
 * 
 *     return bam_iter_read(d.bam_file_ptr.x.bam, d.iter, b)             # <<<<<<<<<<<<<<
 * 
 * cdef char get_base(bam1_t * src, int pos):
 */
  __pyx_r = bam_iter_read(__pyx_v_d->bam_file_ptr->x.bam, __pyx_v_d->iter, __pyx_v_b);
  goto __pyx_L0;

  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
 297: 
 298: cdef char get_base(bam1_t * src, int pos):
/* "jointpysam/pileup.pyx":298
 *     return bam_iter_read(d.bam_file_ptr.x.bam, d.iter, b)
 * 
 * cdef char get_base(bam1_t * src, int pos):             # <<<<<<<<<<<<<<
 *     cdef char base
 * 
 */

static char __pyx_f_10jointpysam_6pileup_get_base(bam1_t *__pyx_v_src, int __pyx_v_pos) {
  char __pyx_v_base;
  uint8_t *__pyx_v_seq;
  char __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_base", 0);
 299:     cdef char base
 300: 
 301:     if src.core.l_qseq == 0:
  /* "jointpysam/pileup.pyx":301
 *     cdef char base
 * 
 *     if src.core.l_qseq == 0:             # <<<<<<<<<<<<<<
 *         return None
 * 
 */
  __pyx_t_1 = (__pyx_v_src->core.l_qseq == 0);
  if (__pyx_t_1) {
 302:         return None
    /* "jointpysam/pileup.pyx":302
 * 
 *     if src.core.l_qseq == 0:
 *         return None             # <<<<<<<<<<<<<<
 * 
 *     if not src.core.l_qseq:
 */
    __pyx_t_2 = __Pyx_PyInt_AsChar(Py_None); if (unlikely((__pyx_t_2 == (char)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_r = __pyx_t_2;
    goto __pyx_L0;
    goto __pyx_L3;
  }
  __pyx_L3:;
 303: 
 304:     if not src.core.l_qseq:
  /* "jointpysam/pileup.pyx":304
 *         return None
 * 
 *     if not src.core.l_qseq:             # <<<<<<<<<<<<<<
 *         return None
 * 
 */
  __pyx_t_1 = (!__pyx_v_src->core.l_qseq);
  if (__pyx_t_1) {
 305:         return None
    /* "jointpysam/pileup.pyx":305
 * 
 *     if not src.core.l_qseq:
 *         return None             # <<<<<<<<<<<<<<
 * 
 *     seq = bam1_seq(src)
 */
    __pyx_t_2 = __Pyx_PyInt_AsChar(Py_None); if (unlikely((__pyx_t_2 == (char)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_r = __pyx_t_2;
    goto __pyx_L0;
    goto __pyx_L4;
  }
  __pyx_L4:;
 306: 
 307:     seq = bam1_seq(src)
  /* "jointpysam/pileup.pyx":307
 *         return None
 * 
 *     seq = bam1_seq(src)             # <<<<<<<<<<<<<<
 * 
 *     base = bam_nt16_rev_table[seq[pos / 2] >> 4 * (1 - pos % 2) & 0xf]
 */
  __pyx_v_seq = bam1_seq(__pyx_v_src);
 308: 
 309:     base = bam_nt16_rev_table[seq[pos / 2] >> 4 * (1 - pos % 2) & 0xf]
  /* "jointpysam/pileup.pyx":309
 *     seq = bam1_seq(src)
 * 
 *     base = bam_nt16_rev_table[seq[pos / 2] >> 4 * (1 - pos % 2) & 0xf]             # <<<<<<<<<<<<<<
 * 
 *     return base
 */
  __pyx_v_base = (__pyx_v_10jointpysam_6pileup_bam_nt16_rev_table[(((__pyx_v_seq[__Pyx_div_long(__pyx_v_pos, 2)]) >> (4 * (1 - __Pyx_mod_long(__pyx_v_pos, 2)))) & 0xf)]);
 310: 
 311:     return base
  /* "jointpysam/pileup.pyx":311
 *     base = bam_nt16_rev_table[seq[pos / 2] >> 4 * (1 - pos % 2) & 0xf]
 * 
 *     return base             # <<<<<<<<<<<<<<
 * cdef int get_cigar(bam1_t * src, int pos):
 *     cdef int * p
 */
  __pyx_r = __pyx_v_base;
  goto __pyx_L0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_WriteUnraisable("jointpysam.pileup.get_base", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
 312: cdef int get_cigar(bam1_t * src, int pos):
/* "jointpysam/pileup.pyx":312
 * 
 *     return base
 * cdef int get_cigar(bam1_t * src, int pos):             # <<<<<<<<<<<<<<
 *     cdef int * p
 *     p = bam1_cigar(src)
 */

static int __pyx_f_10jointpysam_6pileup_get_cigar(bam1_t *__pyx_v_src, int __pyx_v_pos) {
  int *__pyx_v_p;
  PyObject *__pyx_v_i = NULL;
  int __pyx_v_x;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_cigar", 0);
 313:     cdef int * p
 314:     p = bam1_cigar(src)
  /* "jointpysam/pileup.pyx":314
 * cdef int get_cigar(bam1_t * src, int pos):
 *     cdef int * p
 *     p = bam1_cigar(src)             # <<<<<<<<<<<<<<
 *     i = 0
 *     for x in p[:1000]:
 */
  __pyx_v_p = bam1_cigar(__pyx_v_src);
 315:     i = 0
  /* "jointpysam/pileup.pyx":315
 *     cdef int * p
 *     p = bam1_cigar(src)
 *     i = 0             # <<<<<<<<<<<<<<
 *     for x in p[:1000]:
 *         print x,
 */
  __Pyx_INCREF(__pyx_int_0);
  __pyx_v_i = __pyx_int_0;
 316:     for x in p[:1000]:
  /* "jointpysam/pileup.pyx":316
 *     p = bam1_cigar(src)
 *     i = 0
 *     for x in p[:1000]:             # <<<<<<<<<<<<<<
 *         print x,
 *         i+=1
 */
  __pyx_t_2 = (__pyx_v_p + 1000);
  for (__pyx_t_3 = __pyx_v_p; __pyx_t_3 < __pyx_t_2; __pyx_t_3++) {
    __pyx_t_1 = __pyx_t_3;
    __pyx_v_x = (__pyx_t_1[0]);
 317:         print x,
    /* "jointpysam/pileup.pyx":317
 *     i = 0
 *     for x in p[:1000]:
 *         print x,             # <<<<<<<<<<<<<<
 *         i+=1
 *     print "TRACE CIGAR ", i,") END"
 */
    __pyx_t_4 = PyInt_FromLong(__pyx_v_x); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    if (__Pyx_Print(0, ((PyObject *)__pyx_t_5), 0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
 318:         i+=1
    /* "jointpysam/pileup.pyx":318
 *     for x in p[:1000]:
 *         print x,
 *         i+=1             # <<<<<<<<<<<<<<
 *     print "TRACE CIGAR ", i,") END"
 *     return p[pos]
 */
    __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_i, __pyx_int_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_v_i);
    __pyx_v_i = __pyx_t_5;
    __pyx_t_5 = 0;
  }
 319:     print "TRACE CIGAR ", i,") END"
  /* "jointpysam/pileup.pyx":319
 *         print x,
 *         i+=1
 *     print "TRACE CIGAR ", i,") END"             # <<<<<<<<<<<<<<
 *     return p[pos]
 * 
 */
  __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_5));
  PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_kp_s_5));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_5));
  __Pyx_INCREF(__pyx_v_i);
  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_i);
  __Pyx_GIVEREF(__pyx_v_i);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_6));
  PyTuple_SET_ITEM(__pyx_t_5, 2, ((PyObject *)__pyx_kp_s_6));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_6));
  if (__Pyx_Print(0, ((PyObject *)__pyx_t_5), 1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
 320:     return p[pos]
  /* "jointpysam/pileup.pyx":320
 *         i+=1
 *     print "TRACE CIGAR ", i,") END"
 *     return p[pos]             # <<<<<<<<<<<<<<
 * 
 * cdef int get_qual(bam1_t * src, int pos):
 */
  __pyx_r = (__pyx_v_p[__pyx_v_pos]);
  goto __pyx_L0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_WriteUnraisable("jointpysam.pileup.get_cigar", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
 321: 
 322: cdef int get_qual(bam1_t * src, int pos):
/* "jointpysam/pileup.pyx":322
 *     return p[pos]
 * 
 * cdef int get_qual(bam1_t * src, int pos):             # <<<<<<<<<<<<<<
 *     cdef uint8_t * p
 * 
 */

static int __pyx_f_10jointpysam_6pileup_get_qual(bam1_t *__pyx_v_src, int __pyx_v_pos) {
  uint8_t *__pyx_v_p;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_qual", 0);
 323:     cdef uint8_t * p
 324: 
 325:     p = bam1_qual(src)
  /* "jointpysam/pileup.pyx":325
 *     cdef uint8_t * p
 * 
 *     p = bam1_qual(src)             # <<<<<<<<<<<<<<
 * 
 *     if p[0] == 0xff:
 */
  __pyx_v_p = bam1_qual(__pyx_v_src);
 326: 
 327:     if p[0] == 0xff:
  /* "jointpysam/pileup.pyx":327
 *     p = bam1_qual(src)
 * 
 *     if p[0] == 0xff:             # <<<<<<<<<<<<<<
 *         return None
 * 
 */
  __pyx_t_1 = ((__pyx_v_p[0]) == 0xff);
  if (__pyx_t_1) {
 328:         return None
    /* "jointpysam/pileup.pyx":328
 * 
 *     if p[0] == 0xff:
 *         return None             # <<<<<<<<<<<<<<
 * 
 *     return p[pos]
 */
    __pyx_t_2 = __Pyx_PyInt_AsInt(Py_None); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_r = __pyx_t_2;
    goto __pyx_L0;
    goto __pyx_L3;
  }
  __pyx_L3:;
 329: 
 330:     return p[pos]
  /* "jointpysam/pileup.pyx":330
 *         return None
 * 
 *     return p[pos]             # <<<<<<<<<<<<<<
 * 
 * cdef int get_covered_depth(bam_pileup1_t * plp, int n):
 */
  __pyx_r = (__pyx_v_p[__pyx_v_pos]);
  goto __pyx_L0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_WriteUnraisable("jointpysam.pileup.get_qual", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
 331: 
 332: cdef int get_covered_depth(bam_pileup1_t * plp, int n):
/* "jointpysam/pileup.pyx":332
 *     return p[pos]
 * 
 * cdef int get_covered_depth(bam_pileup1_t * plp, int n):             # <<<<<<<<<<<<<<
 *     '''
 *     Gets the number of reads without deletions in a proxy object.
 */

static int __pyx_f_10jointpysam_6pileup_get_covered_depth(bam_pileup1_t *__pyx_v_plp, int __pyx_v_n) {
  int __pyx_v_i;
  int __pyx_v_depth;
  bam_pileup1_t *__pyx_v_pileup;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_covered_depth", 0);
 333:     '''
 334:     Gets the number of reads without deletions in a proxy object.
 335:     '''
 336:     cdef int i, depth
 337:     cdef bam_pileup1_t * pileup
 338: 
 339:     depth = 0
  /* "jointpysam/pileup.pyx":339
 *     cdef bam_pileup1_t * pileup
 * 
 *     depth = 0             # <<<<<<<<<<<<<<
 * 
 *     for i in range(n):
 */
  __pyx_v_depth = 0;
 340: 
 341:     for i in range(n):
  /* "jointpysam/pileup.pyx":341
 *     depth = 0
 * 
 *     for i in range(n):             # <<<<<<<<<<<<<<
 *         pileup = & plp[i]
 * 
 */
  __pyx_t_1 = __pyx_v_n;
  for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
    __pyx_v_i = __pyx_t_2;
 342:         pileup = & plp[i]
    /* "jointpysam/pileup.pyx":342
 * 
 *     for i in range(n):
 *         pileup = & plp[i]             # <<<<<<<<<<<<<<
 * 
 *         if pileup.is_del:
 */
    __pyx_v_pileup = (&(__pyx_v_plp[__pyx_v_i]));
 343: 
 344:         if pileup.is_del:
    /* "jointpysam/pileup.pyx":344
 *         pileup = & plp[i]
 * 
 *         if pileup.is_del:             # <<<<<<<<<<<<<<
 *             continue
 * 
 */
    if (__pyx_v_pileup->is_del) {
 345:             continue
      /* "jointpysam/pileup.pyx":345
 * 
 *         if pileup.is_del:
 *             continue             # <<<<<<<<<<<<<<
 * 
 *         depth += 1
 */
      goto __pyx_L3_continue;
      goto __pyx_L5;
    }
    __pyx_L5:;
 346: 
 347:         depth += 1
    /* "jointpysam/pileup.pyx":347
 *             continue
 * 
 *         depth += 1             # <<<<<<<<<<<<<<
 * 
 *     return depth
 */
    __pyx_v_depth = (__pyx_v_depth + 1);
    __pyx_L3_continue:;
  }
 348: 
 349:     return depth
  /* "jointpysam/pileup.pyx":349
 *         depth += 1
 * 
 *     return depth             # <<<<<<<<<<<<<<
 */
  __pyx_r = __pyx_v_depth;
  goto __pyx_L0;

  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}