[med-svn] [python-htseq] 01/02: Add patch to allow compatibility with pysam 0.8.4

Afif Elghraoui afif-guest at moszumanska.debian.org
Sun Dec 6 21:01:59 UTC 2015


This is an automated email from the git hooks/post-receive script.

afif-guest pushed a commit to branch master
in repository python-htseq.

commit 7c93b9c0d42c415ef3296e6ee4a7d61b6fc34cb8
Author: Afif Elghraoui <afif at ghraoui.name>
Date:   Sun Dec 6 12:45:11 2015 -0800

    Add patch to allow compatibility with pysam 0.8.4
---
 debian/patches/series                       |  1 +
 debian/patches/update-pysam-interface.patch | 53 +++++++++++++++++++++++++++++
 2 files changed, 54 insertions(+)

diff --git a/debian/patches/series b/debian/patches/series
index fd4d512..c4f5cd8 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -3,3 +3,4 @@ fix_version.patch
 add_sphinx_man_pages.patch
 skip_tests_with_rounding_differences.patch
 sphinx_1_3.patch
+update-pysam-interface.patch
diff --git a/debian/patches/update-pysam-interface.patch b/debian/patches/update-pysam-interface.patch
new file mode 100644
index 0000000..496a0c4
--- /dev/null
+++ b/debian/patches/update-pysam-interface.patch
@@ -0,0 +1,53 @@
+Description: Update pysam interface for 0.8.4
+ In pysam 0.8.4, interfaces that have been deprecated in
+ 0.8.1 have been removed. This patch makes the necessary
+ changes for 0.8.4 compatibility.
+Author: Afif Elghraoui <afif at ghraoui.name>
+Forwarded: no
+Last-Update: 2015-12-06
+--- python-htseq.orig/HTSeq/__init__.py
++++ python-htseq/HTSeq/__init__.py
+@@ -940,14 +940,14 @@
+            raise
+     
+     def __iter__( self ):
+-        sf = pysam.Samfile(self.filename, "rb")
++        sf = pysam.AlignmentFile(self.filename, "rb")
+         self.record_no = 0
+         for pa in sf:
+             yield SAM_Alignment.from_pysam_AlignedRead( pa, sf )
+             self.record_no += 1
+     
+     def fetch( self, reference = None, start = None, end = None, region = None ):
+-        sf = pysam.Samfile(self.filename, "rb")
++        sf = pysam.AlignmentFile(self.filename, "rb")
+         self.record_no = 0
+         try:
+            for pa in sf.fetch( reference, start, end, region ):
+@@ -972,14 +972,14 @@
+         if not isinstance( iv, GenomicInterval ):
+            raise TypeError, "Use a HTSeq.GenomicInterval to access regions within .bam-file!"        
+         if self.sf is None:
+-           self.sf = pysam.Samfile( self.filename, "rb" )
+-           if not self.sf._hasIndex():
++           self.sf = pysam.AlignmentFile( self.filename, "rb" )
++           if not self.sf.has_index():
+               raise ValueError, "The .bam-file has no index, random-access is disabled!"
+         for pa in self.sf.fetch( iv.chrom, iv.start+1, iv.end ):
+             yield SAM_Alignment.from_pysam_AlignedRead( pa, self.sf )
+     
+     def get_header_dict( self ):
+-       sf = pysam.Samfile(self.filename, "rb")
++       sf = pysam.AlignmentFile(self.filename, "rb")
+        return sf.header
+     
+                
+@@ -997,7 +997,7 @@
+       self.referencelengths = referencelengths
+       self.text = text
+       self.header = header
+-      self.sf = pysam.Samfile( self.filename, mode="wb", template = self.template, referencenames = self.referencenames, referencelengths = self.referencelengths, text = self.text, header = self.header )
++      self.sf = pysam.AlignmentFile( self.filename, mode="wb", template = self.template, referencenames = self.referencenames, referencelengths = self.referencelengths, text = self.text, header = self.header )
+       
+    @classmethod
+    def from_BAM_Reader( cls, fn, br ):

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-med/python-htseq.git



More information about the debian-med-commit mailing list