ctypedef struct hts_idx_t
---- python-pysam.orig/pysam/libchtslib.pyx
-+++ python-pysam/pysam/libchtslib.pyx
-@@ -489,9 +489,6 @@
- if self.htsfile.format.compression == bgzf:
- with nogil:
- ret = bgzf_seek(hts_get_bgzfp(self.htsfile), offset, SEEK_SET)
-- elif self.htsfile.format.compression == no_compression:
-- with nogil:
-- ret = hts_useek(self.htsfile, <int>offset, SEEK_SET)
- else:
- raise NotImplementedError("seek not implemented in files compressed by method {}".format(
- self.htsfile.format.compression))
-@@ -508,9 +505,6 @@
- if self.htsfile.format.compression == bgzf:
- with nogil:
- ret = bgzf_tell(hts_get_bgzfp(self.htsfile))
-- elif self.htsfile.format.compression == no_compression:
-- with nogil:
-- ret = hts_utell(self.htsfile)
- elif self.htsfile.format.format == cram:
- with nogil:
- ret = htell(cram_fd_get_fp(self.htsfile.fp.cram))
--- python-pysam.orig/tests/00README.txt
+++ python-pysam/tests/00README.txt
@@ -15,7 +15,7 @@
package_dirs = {'pysam': 'pysam',
'pysam.include.samtools': 'samtools',
'pysam.include.bcftools': 'bcftools'}
-
+--- python-pysam.orig/pysam/libchtslib.pyx
++++ python-pysam/pysam/libchtslib.pyx
+@@ -490,8 +490,7 @@
+ with nogil:
+ ret = bgzf_seek(hts_get_bgzfp(self.htsfile), offset, SEEK_SET)
+ elif self.htsfile.format.compression == no_compression:
+- with nogil:
+- ret = hts_useek(self.htsfile, <int>offset, SEEK_SET)
++ ret = 0 if (hseek(self.htsfile.fp.hfile, <int>offset, SEEK_SET) >= 0) else -1
+ else:
+ raise NotImplementedError("seek not implemented in files compressed by method {}".format(
+ self.htsfile.format.compression))
+@@ -509,8 +508,7 @@
+ with nogil:
+ ret = bgzf_tell(hts_get_bgzfp(self.htsfile))
+ elif self.htsfile.format.compression == no_compression:
+- with nogil:
+- ret = hts_utell(self.htsfile)
++ ret = htell(self.htsfile.fp.hfile)
+ elif self.htsfile.format.format == cram:
+ with nogil:
+ ret = htell(cram_fd_get_fp(self.htsfile.fp.cram))
ex2_truncated.bam \
empty.bam empty.bam.bai \
explicit_index.bam explicit_index.cram \
+--- python-pysam.orig/pysam/alternatives.py.obsolete
++++ python-pysam/pysam/alternatives.py.obsolete
+@@ -12,7 +12,6 @@
+ int bam_merge(int argc, char *argv[])
+ int bam_index(int argc, char *argv[])
+ int bam_sort(int argc, char *argv[])
+- int bam_tview_main(int argc, char *argv[])
+ int bam_mating(int argc, char *argv[])
+ int bam_rmdup(int argc, char *argv[])
+ int bam_rmdupse(int argc, char *argv[])
+--- python-pysam.orig/tests/AlignmentFile_test.py
++++ python-pysam/tests/AlignmentFile_test.py
+@@ -1382,19 +1382,19 @@
+ os.unlink(tmpfilename)
+
+
+-class TestDeNovoConstructionUserTags(TestDeNovoConstruction):
+-
+- '''test de novo construction with a header that contains lower-case tags.'''
+-
+- header = {'HD': {'VN': '1.0'},
+- 'SQ': [{'LN': 1575, 'SN': 'chr1'},
+- {'LN': 1584, 'SN': 'chr2'}],
+- 'x1': {'A': 2, 'B': 5},
+- 'x3': {'A': 6, 'B': 5},
+- 'x2': {'A': 4, 'B': 5}}
+-
+- bamfile = os.path.join(BAM_DATADIR, "example_user_header.bam")
+- samfile = os.path.join(BAM_DATADIR, "example_user_header.sam")
++# class TestDeNovoConstructionUserTags(TestDeNovoConstruction):
++#
++# '''test de novo construction with a header that contains lower-case tags.'''
++#
++# header = {'HD': {'VN': '1.0'},
++# 'SQ': [{'LN': 1575, 'SN': 'chr1'},
++# {'LN': 1584, 'SN': 'chr2'}],
++# 'x1': {'A': 2, 'B': 5},
++# 'x3': {'A': 6, 'B': 5},
++# 'x2': {'A': 4, 'B': 5}}
++#
++# bamfile = os.path.join(BAM_DATADIR, "example_user_header.bam")
++# samfile = os.path.join(BAM_DATADIR, "example_user_header.sam")
+
+
+ class TestEmptyHeader(unittest.TestCase):
+--- python-pysam.orig/tests/samtools_test.py
++++ python-pysam/tests/samtools_test.py
+@@ -78,7 +78,7 @@
+ # ("view -bT ex1.fa -o %(out)s_ex1.view2 ex1.sam",
+ "sort ex1.bam -o %(out)s_ex1.sort.bam",
+ "mpileup ex1.bam > %(out)s_ex1.pileup",
+- "depth ex1.bam > %(out)s_ex1.depth",
++ #"depth ex1.bam > %(out)s_ex1.depth",
+ # TODO: issues with file naming
+ # "faidx ex1.fa; %(out)s_ex1.fa.fai",
+ "index ex1.bam %(out)s_ex1.bam.fai",
+@@ -100,8 +100,8 @@
+ "cat -o %(out)s_ex1.cat.bam ex1.bam ex1.bam",
+ "targetcut ex1.bam > %(out)s_ex1.targetcut",
+ "phase ex1.bam > %(out)s_ex1.phase",
+- "import ex1.fa.fai ex1.sam.gz %(out)s_ex1.bam",
+- "bam2fq ex1.bam > %(out)s_ex1.bam2fq",
++ #"view -bt ex1.fa.fai -o %(out)s_ex1.bam ex1.sam.gz",
++ #"bam2fq ex1.bam > %(out)s_ex1.bam2fq",
+ # TODO: not the same
+ # "pad2unpad -T ex1.fa ex2.bam > %(out)s_ex2.unpad",
+ # TODO: command line option problem