pybcf 1.3.2__tar.gz → 1.3.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pybcf-1.3.2/src/pybcf.egg-info → pybcf-1.3.4}/PKG-INFO +4 -4
- {pybcf-1.3.2 → pybcf-1.3.4}/README.md +3 -3
- {pybcf-1.3.2 → pybcf-1.3.4}/setup.py +4 -58
- {pybcf-1.3.2 → pybcf-1.3.4}/src/pybcf/reader.cpp +191 -130
- {pybcf-1.3.2 → pybcf-1.3.4}/src/pybcf/reader.pyx +3 -0
- {pybcf-1.3.2 → pybcf-1.3.4/src/pybcf.egg-info}/PKG-INFO +4 -4
- pybcf-1.3.4/src/sample_data.cpp +494 -0
- {pybcf-1.3.2 → pybcf-1.3.4}/src/sample_data.h +3 -0
- {pybcf-1.3.2 → pybcf-1.3.4}/test/test_pybcf.py +56 -4
- pybcf-1.3.2/src/sample_data.cpp +0 -247
- {pybcf-1.3.2 → pybcf-1.3.4}/LICENSE.txt +0 -0
- {pybcf-1.3.2 → pybcf-1.3.4}/MANIFEST.in +0 -0
- {pybcf-1.3.2 → pybcf-1.3.4}/pyproject.toml +0 -0
- {pybcf-1.3.2 → pybcf-1.3.4}/setup.cfg +0 -0
- {pybcf-1.3.2 → pybcf-1.3.4}/src/bcf.cpp +0 -0
- {pybcf-1.3.2 → pybcf-1.3.4}/src/bcf.h +0 -0
- {pybcf-1.3.2 → pybcf-1.3.4}/src/gzstream.cpp +0 -0
- {pybcf-1.3.2 → pybcf-1.3.4}/src/gzstream.h +0 -0
- {pybcf-1.3.2 → pybcf-1.3.4}/src/header.cpp +0 -0
- {pybcf-1.3.2 → pybcf-1.3.4}/src/header.h +0 -0
- {pybcf-1.3.2 → pybcf-1.3.4}/src/index.cpp +0 -0
- {pybcf-1.3.2 → pybcf-1.3.4}/src/index.h +0 -0
- {pybcf-1.3.2 → pybcf-1.3.4}/src/info.cpp +0 -0
- {pybcf-1.3.2 → pybcf-1.3.4}/src/info.h +0 -0
- {pybcf-1.3.2 → pybcf-1.3.4}/src/pybcf/__init__.py +0 -0
- {pybcf-1.3.2 → pybcf-1.3.4}/src/pybcf.egg-info/SOURCES.txt +0 -0
- {pybcf-1.3.2 → pybcf-1.3.4}/src/pybcf.egg-info/dependency_links.txt +0 -0
- {pybcf-1.3.2 → pybcf-1.3.4}/src/pybcf.egg-info/requires.txt +0 -0
- {pybcf-1.3.2 → pybcf-1.3.4}/src/pybcf.egg-info/top_level.txt +0 -0
- {pybcf-1.3.2 → pybcf-1.3.4}/src/types.h +0 -0
- {pybcf-1.3.2 → pybcf-1.3.4}/src/variant.cpp +0 -0
- {pybcf-1.3.2 → pybcf-1.3.4}/src/variant.h +0 -0
- {pybcf-1.3.2 → pybcf-1.3.4}/src/zlib-ng/adler32.c +0 -0
- {pybcf-1.3.2 → pybcf-1.3.4}/src/zlib-ng/adler32_p.h +0 -0
- {pybcf-1.3.2 → pybcf-1.3.4}/src/zlib-ng/arch_functions.h +0 -0
- {pybcf-1.3.2 → pybcf-1.3.4}/src/zlib-ng/chunkset_tpl.h +0 -0
- {pybcf-1.3.2 → pybcf-1.3.4}/src/zlib-ng/compare256_rle.h +0 -0
- {pybcf-1.3.2 → pybcf-1.3.4}/src/zlib-ng/compress.c +0 -0
- {pybcf-1.3.2 → pybcf-1.3.4}/src/zlib-ng/cpu_features.c +0 -0
- {pybcf-1.3.2 → pybcf-1.3.4}/src/zlib-ng/cpu_features.h +0 -0
- {pybcf-1.3.2 → pybcf-1.3.4}/src/zlib-ng/crc32.c +0 -0
- {pybcf-1.3.2 → pybcf-1.3.4}/src/zlib-ng/crc32.h +0 -0
- {pybcf-1.3.2 → pybcf-1.3.4}/src/zlib-ng/crc32_braid_comb.c +0 -0
- {pybcf-1.3.2 → pybcf-1.3.4}/src/zlib-ng/crc32_braid_comb_p.h +0 -0
- {pybcf-1.3.2 → pybcf-1.3.4}/src/zlib-ng/crc32_braid_p.h +0 -0
- {pybcf-1.3.2 → pybcf-1.3.4}/src/zlib-ng/crc32_braid_tbl.h +0 -0
- {pybcf-1.3.2 → pybcf-1.3.4}/src/zlib-ng/deflate.c +0 -0
- {pybcf-1.3.2 → pybcf-1.3.4}/src/zlib-ng/deflate.h +0 -0
- {pybcf-1.3.2 → pybcf-1.3.4}/src/zlib-ng/deflate_fast.c +0 -0
- {pybcf-1.3.2 → pybcf-1.3.4}/src/zlib-ng/deflate_huff.c +0 -0
- {pybcf-1.3.2 → pybcf-1.3.4}/src/zlib-ng/deflate_medium.c +0 -0
- {pybcf-1.3.2 → pybcf-1.3.4}/src/zlib-ng/deflate_p.h +0 -0
- {pybcf-1.3.2 → pybcf-1.3.4}/src/zlib-ng/deflate_quick.c +0 -0
- {pybcf-1.3.2 → pybcf-1.3.4}/src/zlib-ng/deflate_rle.c +0 -0
- {pybcf-1.3.2 → pybcf-1.3.4}/src/zlib-ng/deflate_slow.c +0 -0
- {pybcf-1.3.2 → pybcf-1.3.4}/src/zlib-ng/deflate_stored.c +0 -0
- {pybcf-1.3.2 → pybcf-1.3.4}/src/zlib-ng/fallback_builtins.h +0 -0
- {pybcf-1.3.2 → pybcf-1.3.4}/src/zlib-ng/functable.c +0 -0
- {pybcf-1.3.2 → pybcf-1.3.4}/src/zlib-ng/functable.h +0 -0
- {pybcf-1.3.2 → pybcf-1.3.4}/src/zlib-ng/gzguts.h +0 -0
- {pybcf-1.3.2 → pybcf-1.3.4}/src/zlib-ng/gzlib.c +0 -0
- {pybcf-1.3.2 → pybcf-1.3.4}/src/zlib-ng/gzwrite.c +0 -0
- {pybcf-1.3.2 → pybcf-1.3.4}/src/zlib-ng/infback.c +0 -0
- {pybcf-1.3.2 → pybcf-1.3.4}/src/zlib-ng/inffast_tpl.h +0 -0
- {pybcf-1.3.2 → pybcf-1.3.4}/src/zlib-ng/inffixed_tbl.h +0 -0
- {pybcf-1.3.2 → pybcf-1.3.4}/src/zlib-ng/inflate.c +0 -0
- {pybcf-1.3.2 → pybcf-1.3.4}/src/zlib-ng/inflate.h +0 -0
- {pybcf-1.3.2 → pybcf-1.3.4}/src/zlib-ng/inflate_p.h +0 -0
- {pybcf-1.3.2 → pybcf-1.3.4}/src/zlib-ng/inftrees.c +0 -0
- {pybcf-1.3.2 → pybcf-1.3.4}/src/zlib-ng/inftrees.h +0 -0
- {pybcf-1.3.2 → pybcf-1.3.4}/src/zlib-ng/insert_string.c +0 -0
- {pybcf-1.3.2 → pybcf-1.3.4}/src/zlib-ng/insert_string_roll.c +0 -0
- {pybcf-1.3.2 → pybcf-1.3.4}/src/zlib-ng/insert_string_tpl.h +0 -0
- {pybcf-1.3.2 → pybcf-1.3.4}/src/zlib-ng/match_tpl.h +0 -0
- {pybcf-1.3.2 → pybcf-1.3.4}/src/zlib-ng/trees.c +0 -0
- {pybcf-1.3.2 → pybcf-1.3.4}/src/zlib-ng/trees.h +0 -0
- {pybcf-1.3.2 → pybcf-1.3.4}/src/zlib-ng/trees_emit.h +0 -0
- {pybcf-1.3.2 → pybcf-1.3.4}/src/zlib-ng/trees_tbl.h +0 -0
- {pybcf-1.3.2 → pybcf-1.3.4}/src/zlib-ng/uncompr.c +0 -0
- {pybcf-1.3.2 → pybcf-1.3.4}/src/zlib-ng/zbuild.h +0 -0
- {pybcf-1.3.2 → pybcf-1.3.4}/src/zlib-ng/zendian.h +0 -0
- {pybcf-1.3.2 → pybcf-1.3.4}/src/zlib-ng/zutil.c +0 -0
- {pybcf-1.3.2 → pybcf-1.3.4}/src/zlib-ng/zutil.h +0 -0
- {pybcf-1.3.2 → pybcf-1.3.4}/src/zlib-ng/zutil_p.h +0 -0
- {pybcf-1.3.2 → pybcf-1.3.4}/test/test_indexed.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: pybcf
|
|
3
|
-
Version: 1.3.
|
|
3
|
+
Version: 1.3.4
|
|
4
4
|
Summary: Package for loading data from bcf files
|
|
5
5
|
Home-page: https://github.com/jeremymcrae/pybcf
|
|
6
6
|
Author: Jeremy McRae
|
|
@@ -23,8 +23,8 @@ data into numpy arrays quickly.
|
|
|
23
23
|
|
|
24
24
|
This performs relatively better at larger sample sizes e.g. it's 7X faster than
|
|
25
25
|
pysam with 2k samples, but improves to 50X faster than pysam with 30k samples.
|
|
26
|
-
Currently it's slower than pysam for BCFs without
|
|
27
|
-
|
|
26
|
+
Currently it's slower than pysam for BCFs without sample level data, but BCFs
|
|
27
|
+
without genotypes aren't generally a limiting factor e.g. it still parses
|
|
28
28
|
300k variants/second under those conditions.
|
|
29
29
|
|
|
30
30
|
```py
|
|
@@ -41,7 +41,7 @@ for var in bcf:
|
|
|
41
41
|
|
|
42
42
|
# sample data is accessed as numpy arrays via the format keys
|
|
43
43
|
keys = list(var.samples)
|
|
44
|
-
genotypes = var.samples['GT'] # as n x 2 numpy array, missing
|
|
44
|
+
genotypes = var.samples['GT'] # as n x 2 numpy array, missing=nan
|
|
45
45
|
|
|
46
46
|
# or fetch from random regions if bcf is indexed
|
|
47
47
|
for var in bcf.fetch('chr1', 10000, 200000):
|
|
@@ -7,8 +7,8 @@ data into numpy arrays quickly.
|
|
|
7
7
|
|
|
8
8
|
This performs relatively better at larger sample sizes e.g. it's 7X faster than
|
|
9
9
|
pysam with 2k samples, but improves to 50X faster than pysam with 30k samples.
|
|
10
|
-
Currently it's slower than pysam for BCFs without
|
|
11
|
-
|
|
10
|
+
Currently it's slower than pysam for BCFs without sample level data, but BCFs
|
|
11
|
+
without genotypes aren't generally a limiting factor e.g. it still parses
|
|
12
12
|
300k variants/second under those conditions.
|
|
13
13
|
|
|
14
14
|
```py
|
|
@@ -25,7 +25,7 @@ for var in bcf:
|
|
|
25
25
|
|
|
26
26
|
# sample data is accessed as numpy arrays via the format keys
|
|
27
27
|
keys = list(var.samples)
|
|
28
|
-
genotypes = var.samples['GT'] # as n x 2 numpy array, missing
|
|
28
|
+
genotypes = var.samples['GT'] # as n x 2 numpy array, missing=nan
|
|
29
29
|
|
|
30
30
|
# or fetch from random regions if bcf is indexed
|
|
31
31
|
for var in bcf.fetch('chr1', 10000, 200000):
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
|
|
2
|
-
import glob
|
|
3
2
|
import io
|
|
4
3
|
from pathlib import Path
|
|
5
4
|
from setuptools import setup
|
|
@@ -9,7 +8,6 @@ import os
|
|
|
9
8
|
import platform
|
|
10
9
|
|
|
11
10
|
from distutils.core import Extension
|
|
12
|
-
from distutils.ccompiler import new_compiler
|
|
13
11
|
from Cython.Build import cythonize
|
|
14
12
|
|
|
15
13
|
EXTRA_COMPILE_ARGS = ['-std=c++11', '-I/usr/include']
|
|
@@ -19,6 +17,8 @@ if sys.platform == "darwin":
|
|
|
19
17
|
"-stdlib=libc++",
|
|
20
18
|
"-I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1",
|
|
21
19
|
"-I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include",
|
|
20
|
+
'-mavx',
|
|
21
|
+
'-mavx2',
|
|
22
22
|
]
|
|
23
23
|
EXTRA_LINK_ARGS += [
|
|
24
24
|
"-L/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib",
|
|
@@ -27,9 +27,6 @@ if sys.platform == "darwin":
|
|
|
27
27
|
if platform.machine() == 'x86_64':
|
|
28
28
|
EXTRA_COMPILE_ARGS += ['-mavx', '-mavx2']
|
|
29
29
|
|
|
30
|
-
def flatten(*lists):
|
|
31
|
-
return [str(x) for sublist in lists for x in sublist]
|
|
32
|
-
|
|
33
30
|
def build_zlib():
|
|
34
31
|
''' compile zlib code to object files for linking
|
|
35
32
|
|
|
@@ -57,65 +54,14 @@ def build_zlib():
|
|
|
57
54
|
|
|
58
55
|
return str(build_dir), objs
|
|
59
56
|
|
|
60
|
-
def get_gzstream_path():
|
|
61
|
-
''' workaround for building gzstream on windows
|
|
62
|
-
|
|
63
|
-
cython on windows didn't like the .C extension for gzstream. This just
|
|
64
|
-
renames the file (on windows only), and returns the relative path.
|
|
65
|
-
'''
|
|
66
|
-
# gzstream_path = 'src/gzstream/gzstream.C'
|
|
67
|
-
gzstream_path = 'src/gzstream.cpp'
|
|
68
|
-
# if sys.platform == 'win32':
|
|
69
|
-
# gzstream_win_path = 'src/gzstream/gzstream.cpp'
|
|
70
|
-
# try:
|
|
71
|
-
# os.rename(gzstream_path, gzstream_win_path)
|
|
72
|
-
# except FileNotFoundError:
|
|
73
|
-
# pass # avoid error on github actions
|
|
74
|
-
# gzstream_path = gzstream_win_path
|
|
75
|
-
return gzstream_path
|
|
76
|
-
|
|
77
|
-
def scrub_gzstream():
|
|
78
|
-
''' workaround for compilation error on macos
|
|
79
|
-
|
|
80
|
-
compiling gzstream requires the corresponding gzstream.h file, but if we
|
|
81
|
-
include the gzstream directory in the include dirs, then clang complains
|
|
82
|
-
about the version file in the gzstream folder. If we remove the gzstream
|
|
83
|
-
directory from the include dirs, then clang complains about the missing
|
|
84
|
-
gzstream.h. This is because gzstream.C identifies it's header file with
|
|
85
|
-
angle brackets. Replacing the angle brackets in that line seems to work.
|
|
86
|
-
|
|
87
|
-
We also need to do the same for the "#include <zlib.h>" in the gzstream
|
|
88
|
-
header, since this now uses zlib-ng for better performance.
|
|
89
|
-
'''
|
|
90
|
-
with open(get_gzstream_path(), 'rt') as handle:
|
|
91
|
-
lines = handle.readlines()
|
|
92
|
-
|
|
93
|
-
with open(get_gzstream_path(), 'wt') as handle:
|
|
94
|
-
for line in lines:
|
|
95
|
-
if line == '#include <gzstream.h>\n':
|
|
96
|
-
line = '#include "gzstream.h"\n'
|
|
97
|
-
handle.write(line)
|
|
98
|
-
|
|
99
|
-
# rejig the header file
|
|
100
|
-
gzstream_header_path = get_gzstream_path().rsplit('.')[0] + '.h'
|
|
101
|
-
with open(gzstream_header_path, 'rt') as handle:
|
|
102
|
-
lines = handle.readlines()
|
|
103
|
-
|
|
104
|
-
with open(gzstream_header_path, 'wt') as handle:
|
|
105
|
-
for line in lines:
|
|
106
|
-
if line == '#include <zlib.h>\n':
|
|
107
|
-
line = '#include "zlib.h"\n'
|
|
108
|
-
handle.write(line)
|
|
109
|
-
|
|
110
57
|
include_dir, zlib = build_zlib()
|
|
111
|
-
scrub_gzstream()
|
|
112
58
|
|
|
113
59
|
ext = cythonize([
|
|
114
60
|
Extension('pybcf.reader',
|
|
115
61
|
extra_compile_args=EXTRA_COMPILE_ARGS,
|
|
116
62
|
extra_link_args=EXTRA_LINK_ARGS,
|
|
117
63
|
sources=['src/pybcf/reader.pyx',
|
|
118
|
-
|
|
64
|
+
'src/gzstream.cpp',
|
|
119
65
|
'src/bcf.cpp',
|
|
120
66
|
'src/index.cpp',
|
|
121
67
|
'src/header.cpp',
|
|
@@ -131,7 +77,7 @@ setup(name='pybcf',
|
|
|
131
77
|
description='Package for loading data from bcf files',
|
|
132
78
|
long_description=io.open('README.md', encoding='utf-8').read(),
|
|
133
79
|
long_description_content_type='text/markdown',
|
|
134
|
-
version='1.3.
|
|
80
|
+
version='1.3.4',
|
|
135
81
|
author='Jeremy McRae',
|
|
136
82
|
author_email='jmcrae@illumina.com',
|
|
137
83
|
license="MIT",
|