Loading .travis.yml +0 −1 Original line number Diff line number Diff line Loading @@ -3,7 +3,6 @@ os: - osx language: c sudo: false env: matrix: Loading MANIFEST.in +2 −2 Original line number Diff line number Diff line Loading @@ -50,8 +50,8 @@ include htslib/htslib.pc.in include htslib/htslib/*.h include htslib/cram/*.c include htslib/cram/*.h include htslib/win/*.c include htslib/win/*.h include htslib/os/*.c include htslib/os/*.h include cy_build.py include pysam.py include requirements.txt Loading NEWS +11 −0 Original line number Diff line number Diff line Loading @@ -5,6 +5,17 @@ http://pysam.readthedocs.io/en/latest/release.html Release notes ============= Release 0.15.2 ============== Bugfix release. * [#746] catch pileup itorator out-of-scope segfaults * [#747] fix faixd fetch with region * [#748] increase max_pos to (1<<31)-1 * [#645] Add missing macOS stub files in `MANIFEST.in`, @SoapZA * [#737] Fix bug in get_aligned_pairs, @bkohrn Release 0.15.1 ============== Loading doc/release.rst +11 −0 Original line number Diff line number Diff line Loading @@ -7,6 +7,17 @@ Release 0.15.1 Bugfix release. * [#746] catch pileup itorator out-of-scope segfaults * [#747] fix faixd fetch with region * [#748] increase max_pos to (1<<31)-1 * [#645] Add missing macOS stub files in `MANIFEST.in`, @SoapZA * [#737] Fix bug in get_aligned_pairs, @bkohrn Release 0.15.1 ============== Bugfix release. * [#716] raise ValueError if tid is out of range when writing * [#697] release version using cython 0.28.5 for python 3.7 compatibility Loading pysam/libcalignedsegment.pyx +60 −5 Original line number Diff line number Diff line Loading @@ -402,6 +402,13 @@ cdef inline pack_tags(tags): # use array.tostring() to retrieve byte representation and # save as bytes datafmt = "2sBBI%is" % (len(value) * DATATYPE2FORMAT[typecode][1]) if IS_PYTHON3: args.extend([pytag[:2], ord("B"), typecode, len(value), value.tobytes()]) else: args.extend([pytag[:2], ord("B"), typecode, Loading Loading @@ -1945,6 +1952,8 @@ cdef class AlignedSegment: else: for i from pos <= i < pos + l: result.append((None, i)) else: r_idx += l pos += l elif op == BAM_CHARD_CLIP: Loading Loading @@ -2845,6 +2854,10 @@ cdef class PileupColumn: # out of sync. for x from 0 <= x < self.n_pu: p = &(self.plp[0][x]) if p == NULL: raise ValueError( "pileup buffer out of sync - most likely use of iterator " "outside loop") if pileup_base_qual_skip(p, self.min_base_quality): continue pileups.append(makePileupRead(p, self.header)) Loading Loading @@ -2887,8 +2900,15 @@ cdef class PileupColumn: cdef uint32_t c = 0 cdef uint32_t cnt = 0 cdef bam_pileup1_t * p = NULL if self.plp == NULL or self.plp[0] == NULL: raise ValueError("PileupColumn accessed after iterator finished") for x from 0 <= x < self.n_pu: p = &(self.plp[0][x]) if p == NULL: raise ValueError( "pileup buffer out of sync - most likely use of iterator " "outside loop") if pileup_base_qual_skip(p, self.min_base_quality): continue cnt += 1 Loading Loading @@ -2957,10 +2977,17 @@ cdef class PileupColumn: cdef uint8_t * buf = self.buf cdef bam_pileup1_t * p = NULL if self.plp == NULL or self.plp[0] == NULL: raise ValueError("PileupColumn accessed after iterator finished") # todo: reference sequence to count matches/mismatches # todo: convert assertions to exceptions for x from 0 <= x < self.n_pu: p = &(self.plp[0][x]) if p == NULL: raise ValueError( "pileup buffer out of sync - most likely use of iterator " "outside loop") if pileup_base_qual_skip(p, self.min_base_quality): continue # see samtools pileup_seq Loading Loading @@ -3062,6 +3089,11 @@ cdef class PileupColumn: result = [] for x from 0 <= x < self.n_pu: p = &(self.plp[0][x]) if p == NULL: raise ValueError( "pileup buffer out of sync - most likely use of iterator " "outside loop") if p.qpos < p.b.core.l_qseq: c = bam_get_qual(p.b)[p.qpos] else: Loading @@ -3079,11 +3111,19 @@ cdef class PileupColumn: list: a list of quality scores """ if self.plp == NULL or self.plp[0] == NULL: raise ValueError("PileupColumn accessed after iterator finished") cdef uint32_t x = 0 cdef bam_pileup1_t * p = NULL result = [] for x from 0 <= x < self.n_pu: p = &(self.plp[0][x]) if p == NULL: raise ValueError( "pileup buffer out of sync - most likely use of iterator " "outside loop") if pileup_base_qual_skip(p, self.min_base_quality): continue result.append(p.b.core.qual) Loading @@ -3097,12 +3137,19 @@ cdef class PileupColumn: list: a list of read positions """ if self.plp == NULL or self.plp[0] == NULL: raise ValueError("PileupColumn accessed after iterator finished") cdef uint32_t x = 0 cdef bam_pileup1_t * p = NULL result = [] for x from 0 <= x < self.n_pu: p = &(self.plp[0][x]) if p == NULL: raise ValueError( "pileup buffer out of sync - most likely use of iterator " "outside loop") if pileup_base_qual_skip(p, self.min_base_quality): continue result.append(p.qpos) Loading @@ -3116,11 +3163,19 @@ cdef class PileupColumn: list: a list of query names at pileup column position. """ if self.plp == NULL or self.plp[0] == NULL: raise ValueError("PileupColumn accessed after iterator finished") cdef uint32_t x = 0 cdef bam_pileup1_t * p = NULL result = [] for x from 0 <= x < self.n_pu: p = &(self.plp[0][x]) if p == NULL: raise ValueError( "pileup buffer out of sync - most likely use of iterator " "outside loop") if pileup_base_qual_skip(p, self.min_base_quality): continue result.append(charptr_to_str(pysam_bam_get_qname(p.b))) Loading Loading
.travis.yml +0 −1 Original line number Diff line number Diff line Loading @@ -3,7 +3,6 @@ os: - osx language: c sudo: false env: matrix: Loading
MANIFEST.in +2 −2 Original line number Diff line number Diff line Loading @@ -50,8 +50,8 @@ include htslib/htslib.pc.in include htslib/htslib/*.h include htslib/cram/*.c include htslib/cram/*.h include htslib/win/*.c include htslib/win/*.h include htslib/os/*.c include htslib/os/*.h include cy_build.py include pysam.py include requirements.txt Loading
NEWS +11 −0 Original line number Diff line number Diff line Loading @@ -5,6 +5,17 @@ http://pysam.readthedocs.io/en/latest/release.html Release notes ============= Release 0.15.2 ============== Bugfix release. * [#746] catch pileup itorator out-of-scope segfaults * [#747] fix faixd fetch with region * [#748] increase max_pos to (1<<31)-1 * [#645] Add missing macOS stub files in `MANIFEST.in`, @SoapZA * [#737] Fix bug in get_aligned_pairs, @bkohrn Release 0.15.1 ============== Loading
doc/release.rst +11 −0 Original line number Diff line number Diff line Loading @@ -7,6 +7,17 @@ Release 0.15.1 Bugfix release. * [#746] catch pileup itorator out-of-scope segfaults * [#747] fix faixd fetch with region * [#748] increase max_pos to (1<<31)-1 * [#645] Add missing macOS stub files in `MANIFEST.in`, @SoapZA * [#737] Fix bug in get_aligned_pairs, @bkohrn Release 0.15.1 ============== Bugfix release. * [#716] raise ValueError if tid is out of range when writing * [#697] release version using cython 0.28.5 for python 3.7 compatibility Loading
pysam/libcalignedsegment.pyx +60 −5 Original line number Diff line number Diff line Loading @@ -402,6 +402,13 @@ cdef inline pack_tags(tags): # use array.tostring() to retrieve byte representation and # save as bytes datafmt = "2sBBI%is" % (len(value) * DATATYPE2FORMAT[typecode][1]) if IS_PYTHON3: args.extend([pytag[:2], ord("B"), typecode, len(value), value.tobytes()]) else: args.extend([pytag[:2], ord("B"), typecode, Loading Loading @@ -1945,6 +1952,8 @@ cdef class AlignedSegment: else: for i from pos <= i < pos + l: result.append((None, i)) else: r_idx += l pos += l elif op == BAM_CHARD_CLIP: Loading Loading @@ -2845,6 +2854,10 @@ cdef class PileupColumn: # out of sync. for x from 0 <= x < self.n_pu: p = &(self.plp[0][x]) if p == NULL: raise ValueError( "pileup buffer out of sync - most likely use of iterator " "outside loop") if pileup_base_qual_skip(p, self.min_base_quality): continue pileups.append(makePileupRead(p, self.header)) Loading Loading @@ -2887,8 +2900,15 @@ cdef class PileupColumn: cdef uint32_t c = 0 cdef uint32_t cnt = 0 cdef bam_pileup1_t * p = NULL if self.plp == NULL or self.plp[0] == NULL: raise ValueError("PileupColumn accessed after iterator finished") for x from 0 <= x < self.n_pu: p = &(self.plp[0][x]) if p == NULL: raise ValueError( "pileup buffer out of sync - most likely use of iterator " "outside loop") if pileup_base_qual_skip(p, self.min_base_quality): continue cnt += 1 Loading Loading @@ -2957,10 +2977,17 @@ cdef class PileupColumn: cdef uint8_t * buf = self.buf cdef bam_pileup1_t * p = NULL if self.plp == NULL or self.plp[0] == NULL: raise ValueError("PileupColumn accessed after iterator finished") # todo: reference sequence to count matches/mismatches # todo: convert assertions to exceptions for x from 0 <= x < self.n_pu: p = &(self.plp[0][x]) if p == NULL: raise ValueError( "pileup buffer out of sync - most likely use of iterator " "outside loop") if pileup_base_qual_skip(p, self.min_base_quality): continue # see samtools pileup_seq Loading Loading @@ -3062,6 +3089,11 @@ cdef class PileupColumn: result = [] for x from 0 <= x < self.n_pu: p = &(self.plp[0][x]) if p == NULL: raise ValueError( "pileup buffer out of sync - most likely use of iterator " "outside loop") if p.qpos < p.b.core.l_qseq: c = bam_get_qual(p.b)[p.qpos] else: Loading @@ -3079,11 +3111,19 @@ cdef class PileupColumn: list: a list of quality scores """ if self.plp == NULL or self.plp[0] == NULL: raise ValueError("PileupColumn accessed after iterator finished") cdef uint32_t x = 0 cdef bam_pileup1_t * p = NULL result = [] for x from 0 <= x < self.n_pu: p = &(self.plp[0][x]) if p == NULL: raise ValueError( "pileup buffer out of sync - most likely use of iterator " "outside loop") if pileup_base_qual_skip(p, self.min_base_quality): continue result.append(p.b.core.qual) Loading @@ -3097,12 +3137,19 @@ cdef class PileupColumn: list: a list of read positions """ if self.plp == NULL or self.plp[0] == NULL: raise ValueError("PileupColumn accessed after iterator finished") cdef uint32_t x = 0 cdef bam_pileup1_t * p = NULL result = [] for x from 0 <= x < self.n_pu: p = &(self.plp[0][x]) if p == NULL: raise ValueError( "pileup buffer out of sync - most likely use of iterator " "outside loop") if pileup_base_qual_skip(p, self.min_base_quality): continue result.append(p.qpos) Loading @@ -3116,11 +3163,19 @@ cdef class PileupColumn: list: a list of query names at pileup column position. """ if self.plp == NULL or self.plp[0] == NULL: raise ValueError("PileupColumn accessed after iterator finished") cdef uint32_t x = 0 cdef bam_pileup1_t * p = NULL result = [] for x from 0 <= x < self.n_pu: p = &(self.plp[0][x]) if p == NULL: raise ValueError( "pileup buffer out of sync - most likely use of iterator " "outside loop") if pileup_base_qual_skip(p, self.min_base_quality): continue result.append(charptr_to_str(pysam_bam_get_qname(p.b))) Loading