forked from amcpherson/remixt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
62 lines (54 loc) · 2.06 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
import fnmatch
import os
import sys
import numpy
import versioneer
from setuptools import setup, find_packages, Extension
from Cython.Build import cythonize
external_dir = os.path.abspath('src/external')
bamtools_dir = os.path.join(external_dir, 'bamtools', 'src')
bamtools_api_dir = os.path.join(bamtools_dir, 'api')
bamtools_utils_dir = os.path.join(bamtools_dir, 'utils')
def find_files(directory, pattern):
for root, dirs, files in os.walk(directory):
for basename in files:
if fnmatch.fnmatch(basename, pattern):
filename = os.path.join(root, basename)
yield filename
bamtools_sources = []
bamtools_sources += list(find_files(bamtools_api_dir, '*.cpp'))
bamtools_sources += list(find_files(bamtools_utils_dir, '*.cpp'))
bamtools_sources = filter(lambda a: not a.endswith('win_p.cpp'), bamtools_sources)
libraries = []
if 'linux' in sys.platform:
libraries.append('rt')
extensions = [
Extension(
name='remixt.bamreader',
sources=['remixt/bamreader.pyx', 'src/BamAlleleReader.cpp'] + bamtools_sources,
include_dirs=['src', external_dir, bamtools_dir, numpy.get_include()],
libraries=['z', 'bz2'],
extra_compile_args=['-g'],
),
Extension(
name='remixt.bpmodel',
sources=['remixt/bpmodel.pyx'],
include_dirs=[numpy.get_include()],
extra_compile_args=['-g', '-Wno-unused-function'],
),
]
setup(
name='remixt',
packages=find_packages(),
version=versioneer.get_version(),
cmdclass=versioneer.get_cmdclass(),
description='ReMixT is a tool for joint inference of clone specific segment and breakpoint copy number',
author='Andrew McPherson',
author_email='[email protected]',
url='http://bitbucket.org/dranew/remixt',
download_url='https://bitbucket.org/dranew/remixt/get/v{}.tar.gz'.format(versioneer.get_version()),
keywords=['scientific', 'sequence analysis', 'cancer'],
classifiers=[],
ext_modules=cythonize(extensions),
entry_points={'console_scripts': ['remixt = remixt.ui.main:main']},
)