-
Notifications
You must be signed in to change notification settings - Fork 11
/
setup.py
executable file
·91 lines (90 loc) · 3.27 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
import os
import numpy
import sys
import glob
import fnmatch
from Cython.Build import cythonize
#from distutils.core import setup, Extension
from setuptools import setup,Extension
import distutils.command.install_data
def opj(*args):
path = os.path.join(*args)
return os.path.normpath(path)
class wx_smart_install_data(distutils.command.install_data.install_data):
def run(self):
install_cmd = self.get_finalized_command('install')
self.install_dir = getattr(install_cmd, 'install_lib')
return distutils.command.install_data.install_data.run(self)
def find_data_files(srcdir, *wildcards, **kw):
OMIT=['.c','.pyc','.egg-info','.so']
def walk_helper(arg, dirname, files):
if '.svn' in dirname or 'CVS' in dirname:
return
names = []
lst, wildcards = arg
for wc in wildcards:
wc_name = opj(dirname, wc)
for f in files:
filename = opj(dirname, f)
if not any(filename.endswith(x) for x in OMIT):
if fnmatch.fnmatch(filename, wc_name) and not os.path.isdir(filename):
names.append(filename)
if names:
lst.append( (dirname, names ) )
file_list = []
recursive = kw.get('recursive', True)
if recursive:
os.path.walk(srcdir, walk_helper, (file_list, wildcards))
else:
walk_helper((file_list, wildcards),
srcdir,
[os.path.basename(f) for f in glob.glob(opj(srcdir, '*'))])
return file_list
files = find_data_files('sv2/', '*.*')
setup( name='sv2',
version='1.4.3.3',
description='SV2: Support Vector Structural Variation Genotyper',
url='https://github.com/dantaki/SV2',
author='Danny Antaki',
author_email='dantaki@ucsd.edu',
license='MIT',
packages=['sv2'],
package_dir={'sv2': 'sv2/'},
package_data={
'sv2': ['sv2/resources/*','sv2/resources/training_sets/*',]
},
ext_modules=cythonize([
#Extension('sv2.core',['sv2/core.pyx']),]
Extension('sv2.FeatureExtraction',['sv2/FeatureExtraction.pyx']),
Extension('sv2.Genotype',['sv2/Genotype.pyx']),
Extension('sv2.Preprocess',['sv2/Preprocess.pyx']),
Extension('sv2.Snv',['sv2/Snv.pyx']),
Extension('sv2.Svm',['sv2/Svm.pyx']),
]
),
include_dirs=[numpy.get_include()],
requires=[
'cython',
'json',
'numpy',
'pandas',
'pybedtools',
'pysam',
'shutil',
'wget',
],
python_requires='~=2.7',
include_package_data=True,
install_requires= [
'cython',
'numpy',
'pandas',
'pybedtools',
'pysam>=0.9',
'scikit-learn>=0.19',
'wget',
],
data_files = files,
cmdclass = {'install_data': wx_smart_install_data},
scripts = ['sv2/sv2','sv2/sv2train']
)