minimap2 0.2.25.0 → 0.2.25.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -8,7 +8,7 @@ void mm_idxopt_init(mm_idxopt_t *opt)
8
8
  opt->k = 15, opt->w = 10, opt->flag = 0;
9
9
  opt->bucket_bits = 14;
10
10
  opt->mini_batch_size = 50000000;
11
- opt->batch_size = 4000000000ULL;
11
+ opt->batch_size = 8000000000ULL;
12
12
  }
13
13
 
14
14
  void mm_mapopt_init(mm_mapopt_t *opt)
@@ -0,0 +1,2 @@
1
+ [build-system]
2
+ requires = ["setuptools", "wheel", "Cython"]
@@ -3,7 +3,7 @@ from libc.stdlib cimport free
3
3
  cimport cmappy
4
4
  import sys
5
5
 
6
- __version__ = '2.24'
6
+ __version__ = '2.25'
7
7
 
8
8
  cmappy.mm_reset_timer()
9
9
 
@@ -172,6 +172,7 @@ cdef class Aligner:
172
172
  cdef cmappy.mm_mapopt_t map_opt
173
173
 
174
174
  if self._idx == NULL: return
175
+ if ((self.map_opt.flag & 4) and (self._idx.flag & 2)): return
175
176
  map_opt = self.map_opt
176
177
  if max_frag_len is not None: map_opt.max_frag_len = max_frag_len
177
178
  if extra_flags is not None: map_opt.flag |= extra_flags
@@ -217,6 +218,7 @@ cdef class Aligner:
217
218
  cdef int l
218
219
  cdef char *s
219
220
  if self._idx == NULL: return
221
+ if ((self.map_opt.flag & 4) and (self._idx.flag & 2)): return
220
222
  s = cmappy.mappy_fetch_seq(self._idx, name.encode(), start, end, &l)
221
223
  if l == 0: return None
222
224
  r = s[:l] if isinstance(s, str) else s[:l].decode()
data/ext/minimap2/seed.c CHANGED
@@ -7,7 +7,7 @@ void mm_seed_mz_flt(void *km, mm128_v *mv, int32_t q_occ_max, float q_occ_frac)
7
7
  mm128_t *a;
8
8
  size_t i, j, st;
9
9
  if (mv->n <= q_occ_max || q_occ_frac <= 0.0f || q_occ_max <= 0) return;
10
- KMALLOC(km, a, mv->n);
10
+ a = Kmalloc(km, mm128_t, mv->n);
11
11
  for (i = 0; i < mv->n; ++i)
12
12
  a[i].x = mv->a[i].x, a[i].y = i;
13
13
  radix_sort_128x(a, a + mv->n);
@@ -1,29 +1,40 @@
1
1
  try:
2
2
  from setuptools import setup, Extension
3
+ from setuptools.command.build_ext import build_ext
3
4
  except ImportError:
4
5
  from distutils.core import setup
5
6
  from distutils.extension import Extension
7
+ from distutils.command.build_ext import build_ext
6
8
 
7
- import sys, platform
9
+ import sys, platform, subprocess
8
10
 
9
- sys.path.append('python')
10
-
11
- extra_compile_args = ['-DHAVE_KALLOC']
12
- include_dirs = ["."]
13
-
14
- if platform.machine() in ["aarch64", "arm64"]:
15
- include_dirs.append("sse2neon/")
16
- extra_compile_args.extend(['-ftree-vectorize', '-DKSW_SSE2_ONLY', '-D__SSE2__'])
17
- else:
18
- extra_compile_args.append('-msse4.1') # WARNING: ancient x86_64 CPUs don't have SSE4
19
11
 
20
12
  def readme():
21
13
  with open('python/README.rst') as f:
22
14
  return f.read()
23
15
 
16
+
17
+ class LibMM2Build(build_ext):
18
+ # Uses Makefile to build library, avoids duplicating logic
19
+ # determining which objects to compile but does require
20
+ # end users to have Make (since precompiled wheels are not
21
+ # distributed on PyPI).
22
+ def run(self):
23
+ def compile_libminimap2(*args, **kwargs):
24
+ cmd = ['make', 'libminimap2.a'] + list(args)
25
+ subprocess.check_call(cmd)
26
+ options = []
27
+ if platform.machine() in ["aarch64", "arm64"]:
28
+ options = ["arm_neon=1", "aarch64=1"]
29
+ self.execute(
30
+ compile_libminimap2, options,
31
+ 'Compiling libminimap2 using Makefile')
32
+ build_ext.run(self)
33
+
34
+
24
35
  setup(
25
36
  name = 'mappy',
26
- version = '2.24',
37
+ version = '2.25',
27
38
  url = 'https://github.com/lh3/minimap2',
28
39
  description = 'Minimap2 python binding',
29
40
  long_description = readme(),
@@ -32,16 +43,15 @@ setup(
32
43
  license = 'MIT',
33
44
  keywords = 'sequence-alignment',
34
45
  scripts = ['python/minimap2.py'],
35
- ext_modules = [Extension('mappy',
36
- sources = ['python/mappy.pyx', 'align.c', 'bseq.c', 'lchain.c', 'seed.c', 'format.c', 'hit.c', 'index.c', 'pe.c', 'options.c',
37
- 'ksw2_extd2_sse.c', 'ksw2_exts2_sse.c', 'ksw2_extz2_sse.c', 'ksw2_ll_sse.c',
38
- 'kalloc.c', 'kthread.c', 'map.c', 'misc.c', 'sdust.c', 'sketch.c', 'esterr.c', 'splitidx.c'],
39
- depends = ['minimap.h', 'bseq.h', 'kalloc.h', 'kdq.h', 'khash.h', 'kseq.h', 'ksort.h',
40
- 'ksw2.h', 'kthread.h', 'kvec.h', 'mmpriv.h', 'sdust.h',
41
- 'python/cmappy.h', 'python/cmappy.pxd'],
42
- extra_compile_args = extra_compile_args,
43
- include_dirs = include_dirs,
44
- libraries = ['z', 'm', 'pthread'])],
46
+ cmdclass = {'build_ext': LibMM2Build},
47
+ ext_modules = [
48
+ Extension(
49
+ 'mappy',
50
+ sources = ['python/mappy.pyx'],
51
+ depends = ['python/cmappy.h', 'python/cmappy.pxd'],
52
+ include_dirs = ['.'],
53
+ extra_objects = ['libminimap2.a'],
54
+ libraries = ['z', 'm', 'pthread'])],
45
55
  classifiers = [
46
56
  'Development Status :: 5 - Production/Stable',
47
57
  'License :: OSI Approved :: MIT License',
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Minimap2
4
4
  # Minimap2-2.25 (r1173)
5
- VERSION = "0.2.25.0"
5
+ VERSION = "0.2.25.2"
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: minimap2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.25.0
4
+ version: 0.2.25.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - kojix2
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-04-27 00:00:00.000000000 Z
11
+ date: 2023-05-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ffi
@@ -98,6 +98,7 @@ files:
98
98
  - ext/minimap2/mmpriv.h
99
99
  - ext/minimap2/options.c
100
100
  - ext/minimap2/pe.c
101
+ - ext/minimap2/pyproject.toml
101
102
  - ext/minimap2/python/README.rst
102
103
  - ext/minimap2/python/cmappy.h
103
104
  - ext/minimap2/python/cmappy.pxd
@@ -164,7 +165,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
164
165
  - !ruby/object:Gem::Version
165
166
  version: '0'
166
167
  requirements: []
167
- rubygems_version: 3.4.1
168
+ rubygems_version: 3.4.6
168
169
  signing_key:
169
170
  specification_version: 4
170
171
  summary: minimap2