This repository has been archived by the owner on Jan 13, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 42
/
setup.py
executable file
·103 lines (92 loc) · 3.58 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
from glob import glob
import os
from setuptools import setup, find_packages
from setuptools.extension import Extension
import sys
import taiyaki
version = taiyaki.__version__
# Minimal list of requirements for the package to work once installed
# Used by pip
install_requires = [
"h5py >= 2.10.0",
"numpy >= 1.14.5",
# Biopython 1.76 last version to support Python 3.5
"biopython >= 1.63, <=1.76",
"Cython >= 0.25.2",
"ont_fast5_api >= 1.2.0",
"matplotlib >= 2.0.0",
"pysam >= 0.15.0",
# Scipy 1.5.1 last version to support Python 3.5
"scipy >= 1, <=1.5.1",
"statsmodels >= 0.10.1",
"torch >= 1.5"
]
# Build extensions
try:
import numpy as np
from Cython.Build import cythonize
extensions = cythonize([
Extension(
"taiyaki.squiggle_match.squiggle_match",
[os.path.join("taiyaki/squiggle_match", "squiggle_match.pyx"),
os.path.join("taiyaki/squiggle_match", "c_squiggle_match.c")],
include_dirs=[np.get_include()],
extra_compile_args=["-O3", "-fopenmp", "-std=c99"],
extra_link_args=["-fopenmp"]),
Extension(
"taiyaki.ctc.ctc",
[os.path.join("taiyaki/ctc", "ctc.pyx"),
os.path.join("taiyaki/ctc", "c_crf_flipflop.c"),
os.path.join("taiyaki/ctc", "c_cat_mod_flipflop.c")],
include_dirs=[np.get_include()],
extra_compile_args=["-O3", "-fopenmp", "-std=c11", "-mavx2"],
extra_link_args=["-fopenmp"]),
Extension(
"taiyaki.decodeutil.decodeutil",
[os.path.join("taiyaki/decodeutil", "decodeutil.pyx"),
os.path.join("taiyaki/decodeutil", "c_flipflopfwdbwd.c"),
os.path.join("taiyaki/decodeutil", "c_hashdecode.c"),
os.path.join("taiyaki/decodeutil", "fasthash.c"),
os.path.join("taiyaki/decodeutil", "yastring.c")],
include_dirs=[np.get_include()],
extra_compile_args=["-O3", "-std=c11"])])
except ImportError:
extensions = []
sys.stderr.write(
"WARNING: Numpy and Cython are required to build taiyaki extensions\n")
if any([cmd in sys.argv for cmd in
["install", "build", "build_clib", "build_ext", "bdist_wheel"]]):
raise
setup(
name='taiyaki',
version=version,
description='Neural network model training for Nanopore base calling',
maintainer='Tim Massingham',
maintainer_email='[email protected]',
url='http://www.nanoporetech.com',
long_description='Taiyaki is a library to support training and ' +
'developing new base calling models for Oxford Nanopore ' +
'Technologies sequencing platforms.',
classifiers=[
'Development Status :: 3 - Alpha',
'Environment :: Console',
'Intended Audience :: Developers',
'Intended Audience :: Science/Research',
'Natural Language :: English',
'Operating System :: Unix',
'Programming Language :: Python :: 3 :: Only',
'Topic :: Scientific/Engineering :: Artificial Intelligence',
'Topic :: Scientific/Engineering :: Bio-Informatics',
'Topic :: Scientific/Engineering :: Mathematics'
],
packages=find_packages(
exclude=["*.test", "*.test.*", "test.*", "test", "bin"]),
exclude_package_data={'': ['*.hdf', '*.c', '*.h']},
ext_modules=extensions,
setup_requires=["pytest-runner", "pytest-xdist"],
tests_require=["parameterized", "pytest"],
install_requires=install_requires,
dependency_links=[],
zip_safe=False,
scripts=[x for x in glob('bin/*.py')],
)