[med-svn] [Git][med-team/python-bx][master] 4 commits: New upstream version 0.8.5

Steffen Möller gitlab at salsa.debian.org
Fri Nov 8 18:16:01 GMT 2019



Steffen Möller pushed to branch master at Debian Med / python-bx


Commits:
f4801501 by Steffen Moeller at 2019-11-08T18:11:30Z
New upstream version 0.8.5
- - - - -
edf4f65c by Steffen Moeller at 2019-11-08T18:11:30Z
New upstream version

- - - - -
86fe89cf by Steffen Moeller at 2019-11-08T18:11:32Z
Update upstream source from tag 'upstream/0.8.5'

Update to upstream version '0.8.5'
with Debian dir 343b0555d78f909b56c23a2048f4d54ff0c331bb
- - - - -
0959230f by Steffen Moeller at 2019-11-08T18:14:37Z
New upstream version.

- - - - -


6 changed files:

- debian/changelog
- debian/control
- debian/patches/no-download.patch
- lib/bx/bbi/bigwig_file.pyx
- lib/bx/bbi/bpt_file.pyx
- setup.py


Changes:

=====================================
debian/changelog
=====================================
@@ -1,3 +1,9 @@
+python-bx (0.8.5-1) unstable; urgency=medium
+
+  * New upstream version
+
+ -- Steffen Moeller <moeller at debian.org>  Fri, 08 Nov 2019 19:12:56 +0100
+
 python-bx (0.8.4-2) unstable; urgency=medium
 
   * Team upload.


=====================================
debian/control
=====================================
@@ -15,7 +15,7 @@ Build-Depends: debhelper-compat (= 12),
                python3-numpy,
                python3-six,
                cython3
-Standards-Version: 4.4.0
+Standards-Version: 4.4.1
 Vcs-Browser: https://salsa.debian.org/med-team/python-bx
 Vcs-Git: https://salsa.debian.org/med-team/python-bx.git
 Homepage: https://github.com/bxlab/bx-python


=====================================
debian/patches/no-download.patch
=====================================
@@ -6,7 +6,7 @@ Index: python-bx/setup.py
 ===================================================================
 --- python-bx.orig/setup.py
 +++ python-bx/setup.py
-@@ -9,8 +9,8 @@ elif sys.version_info > (3, ) and sys.ve
+@@ -11,8 +11,8 @@ elif sys.version_info > (3, ) and sys.ve
  try:
      from setuptools import setup, find_packages
  except ImportError:
@@ -15,5 +15,5 @@ Index: python-bx/setup.py
 +    print >> sys.stderr, "ERROR: setuptools not installed. Please report this bug as instructed on https://bugs.debian.org/cgi-bin/pkgreport.cgi?package=python-bx"
 +    sys.exit()
  
- from setuptools import *
- from glob import glob
+ from setuptools import Extension  # noqa: E402
+ 


=====================================
lib/bx/bbi/bigwig_file.pyx
=====================================
@@ -123,7 +123,37 @@ cdef class ArrayAccumulatingBlockHandler( BigWigBlockHandler ):
         for i from s - self.start <= i < e - self.start:
             array[ i ] = val
 
-cdef class BigWigFile( BBIFile ): 
+cdef class BigWigHeaderBlockHandler( BigWigBlockHandler ):
+    "Reads and returns headers"
+    cdef list headers
+
+    def __init__( self, bits32 start, bits32 end ):
+        BigWigBlockHandler.__init__( self, start, end )
+        self.headers = []
+
+    cdef handle_block( self, bytes block_data, BBIFile bbi_file ):
+        cdef bits32 b_chrom_id, b_start, b_end, b_valid_count
+        cdef bits32 b_item_step, b_item_span
+        cdef bits16 b_item_count
+        cdef UBYTE b_type
+        cdef int s, e
+        cdef float val
+        # parse the block header
+        block_reader = BinaryFileReader( BytesIO( block_data ), is_little_endian=bbi_file.reader.is_little_endian )
+        b_chrom_id = block_reader.read_uint32()
+        b_start = block_reader.read_uint32()
+        b_end = block_reader.read_uint32()
+        b_item_step = block_reader.read_uint32()
+        b_item_span = block_reader.read_uint32()
+        b_type = block_reader.read_uint8()
+        block_reader.skip(1)
+        b_item_count = block_reader.read_uint16()
+        self.handle_header( b_start, b_end,  b_item_step, b_item_span, b_type, b_item_count )
+
+    cdef handle_header( self, bits32 start, bits32 end, bits32 step, bits32 span, bits8 type, bits16 itemCount ):
+        self.headers.append( ( start, end, step, span, type, itemCount ) )
+
+cdef class BigWigFile( BBIFile ):
     """
     A "big binary indexed" file whose raw data is in wiggle format.
     """
@@ -140,7 +170,7 @@ cdef class BigWigFile( BBIFile ):
         for i from 0 <= i < summary_size:
             v.sd.valid_count[i] = round( v.sd.valid_count[i] )
         return v.sd
-        
+
     cpdef get( self, char * chrom, bits32 start, bits32 end ):
         """
         Gets all data points over the regions `chrom`:`start`-`end`.
@@ -167,6 +197,15 @@ cdef class BigWigFile( BBIFile ):
         self.visit_blocks_in_region( chrom_id, start, end, v )
         return v.array
 
+    cpdef get_headers( self, char * chrom, bits32 start, bits32 end ):
+        if start >= end:
+            return None
+        chrom_id, chrom_size = self._get_chrom_id_and_size( chrom )
+        if chrom_id is None:
+            return None
+        v = BigWigHeaderBlockHandler( start, end )
+        self.visit_blocks_in_region( chrom_id, start, end, v )
+        return v.headers
 
 
 


=====================================
lib/bx/bbi/bpt_file.pyx
=====================================
@@ -10,26 +10,26 @@ cdef class BPTFile:
     On disk B+ tree compatible with Jim Kent's bPlusTree.c
     """
 
-    def __init__( self, file=None ):
+    def __init__(self, file=None):
         if file is not None:
-            self.attach( file )
+            self.attach(file)
 
-    def attach( self, file ):
+    def attach(self, file):
         """
         Attach to an open file
         """
         self.file = file
-        self.reader = reader = BinaryFileReader( file, bpt_sig )
+        self.reader = reader = BinaryFileReader(file, bpt_sig)
         self.is_byteswapped = self.reader.byteswap_needed
         # Read header stuff
         self.block_size = reader.read_uint32()
         self.key_size = reader.read_uint32()
         self.value_size = reader.read_uint32()
         self.item_count = reader.read_uint64()
-        reader.skip( 8 )
+        reader.skip(8)
         self.root_offset = reader.tell()
 
-    def r_find( self, bits64 block_start, key ):
+    def r_find(self, bits64 block_start, key):
         """
         Recursively seek the value matching key under the subtree starting
         at file offset `block_start`
@@ -37,31 +37,31 @@ cdef class BPTFile:
         cdef UBYTE is_leaf
         cdef bits16 child_count
         cdef bits64 offset
-        self.reader.seek( block_start )
+        self.reader.seek(block_start)
         # Block header
         is_leaf = self.reader.read_uint8()
         self.reader.read_uint8()
         child_count = self.reader.read_uint16()
         if is_leaf:
             for i from 0 <= i < child_count:
-                node_key = self.reader.read( self.key_size )
-                node_value = self.reader.read( self.value_size )
+                node_key = self.reader.read(self.key_size)
+                node_value = self.reader.read(self.value_size)
                 if node_key == key:
                     return node_value
             return None
         else:
             # Read and discard first key, store offset
-            self.reader.read( self.key_size )
+            self.reader.read(self.key_size)
             offset = self.reader.read_uint64()
             # Loop until correct subtree is found
             for i from 0 <= i < child_count - 1:
-                node_key = self.reader.read( self.key_size )
+                node_key = self.reader.read(self.key_size)
                 if node_key > key:
                     break
                 offset = self.reader.read_uint64()
-            return self.r_find( offset, key )
+            return self.r_find(offset, key)
 
-    def find( self, key ):
+    def find(self, key):
         """
         Find the value matching `key` (a bytestring). Returns the matching
         value as a bytestring if found, or None
@@ -71,6 +71,6 @@ cdef class BPTFile:
             return None
         # Key is less than key_size, right pad with 0 bytes
         if len(key) < self.key_size:
-            key += ( '\0' * ( self.key_size - len(key) ) )
+            key += b'\0' * (self.key_size - len(key))
         # Call the recursive finder
-        return self.r_find( self.root_offset, key )
+        return self.r_find(self.root_offset, key)


=====================================
setup.py
=====================================
@@ -1,5 +1,7 @@
 import platform
 import sys
+from distutils.core import Command
+from glob import glob
 
 if sys.version_info < (2, 6):
     sys.exit("ERROR: bx-python requires Python 2.6 or greater")
@@ -12,57 +14,56 @@ except ImportError:
     from ez_setup import use_setuptools
     use_setuptools()
 
-from setuptools import *
-from glob import glob
+from setuptools import Extension  # noqa: E402
+
 
 def main():
 
-    metadata = \
-      dict( name = "bx-python",
-            version = "0.8.4",
-            setup_requires=['numpy', 'cython'],
-            install_requires=['numpy', 'six'],
-            py_modules = [ 'psyco_full' ],
-            package_dir = { '': 'lib' },
-            package_data = { '': ['*.ps'] },
-            scripts = glob( "scripts/*.py" ),
-            test_suite = 'nose.collector',
-            tests_require = ['nose','python-lzo'],
-            author = "James Taylor, Bob Harris, David King, Brent Pedersen, Kanwei Li, and others",
-            author_email = "james at jamestaylor.org",
-            description = "Tools for manipulating biological data, particularly multiple sequence alignments",
-            url = "https://github.com/bxlab/bx-python",
-            license = "MIT",
-            classifiers = [
-                "Development Status :: 5 - Production/Stable",
-                "Intended Audience :: Developers",
-                "Intended Audience :: Science/Research",
-                "License :: OSI Approved :: MIT License",
-                "Operating System :: POSIX",
-                "Programming Language :: Python :: 2",
-                "Programming Language :: Python :: 2.6",
-                "Programming Language :: Python :: 2.7",
-                "Programming Language :: Python :: 3",
-                "Programming Language :: Python :: 3.3",
-                "Programming Language :: Python :: 3.4",
-                "Programming Language :: Python :: 3.5",
-                "Topic :: Scientific/Engineering :: Bio-Informatics",
-                "Topic :: Software Development :: Libraries :: Python Modules"
-            ],
-            zip_safe = False,
-            dependency_links = [],
-            cmdclass=command_classes )
+    metadata = dict(
+        name="bx-python",
+        version="0.8.5",
+        setup_requires=['numpy', 'cython'],
+        install_requires=['numpy', 'six'],
+        py_modules=['psyco_full'],
+        package_dir={'': 'lib'},
+        package_data={'': ['*.ps']},
+        scripts=glob("scripts/*.py"),
+        test_suite='nose.collector',
+        tests_require=['nose', 'python-lzo'],
+        author="James Taylor, Bob Harris, David King, Brent Pedersen, Kanwei Li, and others",
+        author_email="james at jamestaylor.org",
+        description="Tools for manipulating biological data, particularly multiple sequence alignments",
+        url="https://github.com/bxlab/bx-python",
+        license="MIT",
+        classifiers=[
+            "Development Status :: 5 - Production/Stable",
+            "Intended Audience :: Developers",
+            "Intended Audience :: Science/Research",
+            "License :: OSI Approved :: MIT License",
+            "Operating System :: POSIX",
+            "Programming Language :: Python :: 2",
+            "Programming Language :: Python :: 2.7",
+            "Programming Language :: Python :: 3",
+            "Programming Language :: Python :: 3.5",
+            "Programming Language :: Python :: 3.6",
+            "Programming Language :: Python :: 3.7",
+            "Programming Language :: Python :: 3.8",
+            "Topic :: Scientific/Engineering :: Bio-Informatics",
+            "Topic :: Software Development :: Libraries :: Python Modules"],
+        zip_safe=False,
+        dependency_links=[],
+        cmdclass=command_classes)
 
     numpy = None
     try:
         import numpy
         # Suppress numpy tests
         numpy.test = None
-    except:
+    except Exception:
         pass
-    
-    if len(sys.argv) >= 2 and ('--help' in sys.argv[1:] or
-            sys.argv[1] in ('--help-commands', 'egg_info', '--version', 'clean')):
+
+    if len(sys.argv) >= 2 and \
+            ('--help' in sys.argv[1:] or sys.argv[1] in ('--help-commands', 'egg_info', '--version', 'clean')):
         # For these actions, NumPy is not required.
         #
         # They are required to succeed without Numpy for example when
@@ -71,23 +72,21 @@ def main():
         pass
     else:
         if numpy is None:
-            raise Exception( "numpy must be installed to build" )
-        metadata['packages'] = find_packages( 'lib' )
-        metadata['ext_modules'] = get_extension_modules( numpy_include=numpy.get_include() )
+            raise Exception("numpy must be installed to build")
+        metadata['packages'] = find_packages('lib')
+        metadata['ext_modules'] = get_extension_modules(numpy_include=numpy.get_include())
 
     setup(**metadata)
 
 
 # ---- Commands -------------------------------------------------------------
 
-from distutils.core import Command
-
 # Use build_ext from Cython if found
 command_classes = {}
 try:
     import Cython.Distutils
     command_classes['build_ext'] = Cython.Distutils.build_ext
-except:
+except Exception:
     pass
 
 # Run 2to3 builder if we're on Python 3.x, from
@@ -102,16 +101,22 @@ command_classes['build_py'] = build_py
 # Use epydoc if found
 try:
     import pkg_resources
-    pkg_resources.require( "epydoc" )
-    import epydoc.cli, sys, os, os.path
+    pkg_resources.require("epydoc")
+    import epydoc.cli
+    import os
+    import os.path
+
     # Create command class to build API documentation
-    class BuildAPIDocs( Command ):
+    class BuildAPIDocs(Command):
         user_options = []
-        def initialize_options( self ):
+
+        def initialize_options(self):
             pass
-        def finalize_options( self ):
+
+        def finalize_options(self):
             pass
-        def run( self ):
+
+        def run(self):
             # Save working directory and args
             old_argv = sys.argv
             old_cwd = os.getcwd()
@@ -122,18 +127,18 @@ try:
                                        --docformat=reStructuredText
                                        --output=../doc/docbuild/html/apidoc""".split()
             # Make output directory
-            if not os.path.exists( "./doc/docbuild/html/apidoc" ):
-                os.mkdir( "./doc/docbuild/html/apidoc" )
+            if not os.path.exists("./doc/docbuild/html/apidoc"):
+                os.mkdir("./doc/docbuild/html/apidoc")
             # Move to lib directory (so bx package is in current directory)
-            os.chdir( "./lib" )
+            os.chdir("./lib")
             # Invoke epydoc
             epydoc.cli.cli()
             # Restore args and working directory
             sys.argv = old_argv
-            os.chdir( old_cwd )
-    # Add to extra_commands    
+            os.chdir(old_cwd)
+    # Add to extra_commands
     command_classes['build_apidocs'] = BuildAPIDocs
-except:
+except Exception:
     pass
 
 # ---- Extension Modules ----------------------------------------------------
@@ -143,81 +148,80 @@ except:
 # _Extension = Extension
 # Extension = partial(_Extension, extra_compile_args=["-Wno-cpp"])
 
-def get_extension_modules( numpy_include=None ):
+
+def get_extension_modules(numpy_include=None):
     extensions = []
     # Bitsets
-    extensions.append( Extension( "bx.bitset",
-                                  [ "lib/bx/bitset.pyx", 
-                                    "src/binBits.c",
-                                    "src/kent/bits.c",
-                                    "src/kent/common.c" ],
-                                  include_dirs=[ "src/kent", "src"] ) )
+    extensions.append(Extension("bx.bitset",
+                                ["lib/bx/bitset.pyx",
+                                 "src/binBits.c",
+                                 "src/kent/bits.c",
+                                 "src/kent/common.c"],
+                                include_dirs=["src/kent", "src"]))
     # Interval intersection
-    extensions.append( Extension( "bx.intervals.intersection", [ "lib/bx/intervals/intersection.pyx" ] ) )
+    extensions.append(Extension("bx.intervals.intersection", ["lib/bx/intervals/intersection.pyx"]))
     # Alignment object speedups
-    extensions.append( Extension( "bx.align._core", [ "lib/bx/align/_core.pyx" ] ) )
+    extensions.append(Extension("bx.align._core", ["lib/bx/align/_core.pyx"]))
     # NIB reading speedups
-    extensions.append( Extension( "bx.seq._nib", [ "lib/bx/seq/_nib.pyx" ] ) )
+    extensions.append(Extension("bx.seq._nib", ["lib/bx/seq/_nib.pyx"]))
     # 2bit reading speedups
-    extensions.append( Extension( "bx.seq._twobit", [ "lib/bx/seq/_twobit.pyx" ] ) )
-    # Translation if character / integer strings 
-    extensions.append( Extension( "bx._seqmapping", [ "lib/bx/_seqmapping.pyx" ] ) )
+    extensions.append(Extension("bx.seq._twobit", ["lib/bx/seq/_twobit.pyx"]))
+    # Translation if character / integer strings
+    extensions.append(Extension("bx._seqmapping", ["lib/bx/_seqmapping.pyx"]))
     # BGZF
-    extensions.append( Extension( "bx.misc.bgzf",
-                                  [ "lib/bx/misc/bgzf.pyx", "src/samtools/bgzf.c" ],
-                                  include_dirs=[ "src/samtools"],
-                                  libraries=['z'] ) )
+    extensions.append(Extension("bx.misc.bgzf",
+                                ["lib/bx/misc/bgzf.pyx", "src/samtools/bgzf.c"],
+                                include_dirs=["src/samtools"],
+                                libraries=['z']))
 
-    
     # The following extensions won't (currently) compile on windows
-    if platform.system() not in ( 'Microsoft', 'Windows' ):
-        
-        # Interval clustering                
-        extensions.append( Extension( "bx.intervals.cluster",
-                                  [ "lib/bx/intervals/cluster.pyx", 
-                                    "src/cluster.c"],
-                                  include_dirs=["src"] ) )
+    if platform.system() not in ('Microsoft', 'Windows'):
+        # Interval clustering
+        extensions.append(Extension("bx.intervals.cluster",
+                                    ["lib/bx/intervals/cluster.pyx",
+                                     "src/cluster.c"],
+                                    include_dirs=["src"]))
         # Position weight matrices
-        extensions.append( Extension( "bx.pwm._position_weight_matrix",
-                                  [ "lib/bx/pwm/_position_weight_matrix.pyx", "src/pwm_utils.c" ],
-                                  include_dirs=["src"]  ) )
- 
-        extensions.append( Extension( "bx.motif._pwm", [ "lib/bx/motif/_pwm.pyx" ], 
-                                      include_dirs=[numpy_include] ) )
-            
+        extensions.append(Extension("bx.pwm._position_weight_matrix",
+                                    ["lib/bx/pwm/_position_weight_matrix.pyx", "src/pwm_utils.c"],
+                                    include_dirs=["src"]))
+
+        extensions.append(Extension("bx.motif._pwm", ["lib/bx/motif/_pwm.pyx"],
+                                    include_dirs=[numpy_include]))
+
         # Sparse arrays with summaries organized as trees on disk
-        extensions.append( Extension( "bx.arrays.array_tree", [ "lib/bx/arrays/array_tree.pyx" ], include_dirs=[numpy_include] ) )  
-        
+        extensions.append(Extension("bx.arrays.array_tree", ["lib/bx/arrays/array_tree.pyx"], include_dirs=[numpy_include]))
+
         # Reading UCSC "big binary index" files
-        extensions.append( Extension( "bx.bbi.bpt_file", [ "lib/bx/bbi/bpt_file.pyx" ] ) )
-        extensions.append( Extension( "bx.bbi.cirtree_file", [ "lib/bx/bbi/cirtree_file.pyx" ] ) )
-        extensions.append( Extension( "bx.bbi.bbi_file", [ "lib/bx/bbi/bbi_file.pyx" ], include_dirs=[numpy_include] ) )
-        extensions.append( Extension( "bx.bbi.bigwig_file", [ "lib/bx/bbi/bigwig_file.pyx" ], include_dirs=[numpy_include] ) )
-        extensions.append( Extension( "bx.bbi.bigbed_file", [ "lib/bx/bbi/bigbed_file.pyx" ], include_dirs=[numpy_include] ) )
+        extensions.append(Extension("bx.bbi.bpt_file", ["lib/bx/bbi/bpt_file.pyx"]))
+        extensions.append(Extension("bx.bbi.cirtree_file", ["lib/bx/bbi/cirtree_file.pyx"]))
+        extensions.append(Extension("bx.bbi.bbi_file", ["lib/bx/bbi/bbi_file.pyx"], include_dirs=[numpy_include]))
+        extensions.append(Extension("bx.bbi.bigwig_file", ["lib/bx/bbi/bigwig_file.pyx"], include_dirs=[numpy_include]))
+        extensions.append(Extension("bx.bbi.bigbed_file", ["lib/bx/bbi/bigbed_file.pyx"], include_dirs=[numpy_include]))
 
         # EPO and Chain arithmetics and IO speedups
-        extensions.append( Extension( "bx.align._epo", [ "lib/bx/align/_epo.pyx" ], include_dirs=[numpy_include] ) )
+        extensions.append(Extension("bx.align._epo", ["lib/bx/align/_epo.pyx"], include_dirs=[numpy_include]))
 
         # Reading UCSC bed and wiggle formats
-        extensions.append( Extension( "bx.arrays.bed", [ "lib/bx/arrays/bed.pyx" ] ) )
-        extensions.append( Extension( "bx.arrays.wiggle", [ "lib/bx/arrays/wiggle.pyx" ] ) )
-
+        extensions.append(Extension("bx.arrays.bed", ["lib/bx/arrays/bed.pyx"]))
+        extensions.append(Extension("bx.arrays.wiggle", ["lib/bx/arrays/wiggle.pyx"]))
 
         # CpG masking
-        extensions.append( Extension( "bx.align.sitemask._cpg", \
-                                      [ "lib/bx/align/sitemask/_cpg.pyx", 
-                                        "lib/bx/align/sitemask/find_cpg.c" ] ) )
-        
+        extensions.append(Extension("bx.align.sitemask._cpg",
+                                    ["lib/bx/align/sitemask/_cpg.pyx",
+                                     "lib/bx/align/sitemask/find_cpg.c"]))
+
         # Counting n-grams in integer strings
-        extensions.append( Extension( "bx.intseq.ngramcount", [ "lib/bx/intseq/ngramcount.pyx" ],
-                                      include_dirs=["src"] ) )
+        extensions.append(Extension("bx.intseq.ngramcount", ["lib/bx/intseq/ngramcount.pyx"],
+                                    include_dirs=["src"]))
 
         # Seekable access to bzip2 files
-        extensions.append( Extension( "bx.misc._seekbzip2", 
-                                      [ "lib/bx/misc/_seekbzip2.pyx",
-                                        "src/bunzip/micro-bunzip.c" ],
-                                      include_dirs=[ "src/bunzip" ] ) )   
-    return extensions     
-     
+        extensions.append(Extension("bx.misc._seekbzip2",
+                                    ["lib/bx/misc/_seekbzip2.pyx",
+                                     "src/bunzip/micro-bunzip.c"],
+                                    include_dirs=["src/bunzip"]))
+    return extensions
+
+
 if __name__ == "__main__":
     main()



View it on GitLab: https://salsa.debian.org/med-team/python-bx/compare/07e1c2fcd6739c88bd20934164717c36bbe27cb7...0959230f02f4822bbb639c0dda8d52e9db513a5d

-- 
View it on GitLab: https://salsa.debian.org/med-team/python-bx/compare/07e1c2fcd6739c88bd20934164717c36bbe27cb7...0959230f02f4822bbb639c0dda8d52e9db513a5d
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20191108/d0e0f619/attachment-0001.html>


More information about the debian-med-commit mailing list