forked from adamewing/tebreak
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
executable file
·77 lines (62 loc) · 2.16 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
#!/usr/bin/env python
import sys
import subprocess
from setuptools import setup
def check_bwa():
p = subprocess.Popen(['bwa'], stderr=subprocess.PIPE)
for line in p.stderr:
if line.startswith('Version:'):
major, minor, sub = line.strip().split()[1].split('.')
sub = sub.split('-')[0]
if int(major) >= 0 and int(minor) >= 7 and int(sub) >= 12:
return True
return False
def check_samtools():
p = subprocess.Popen(['samtools'], stderr=subprocess.PIPE)
for line in p.stderr:
if line.startswith('Version:'):
major, minor = line.strip().split()[1].split('.')
minor = minor.split('-')[0]
if int(major) >= 1 and int(minor) >= 2:
return True
return False
def check_minia():
p = subprocess.Popen(['minia'], stdout=subprocess.PIPE)
for line in p.stdout:
if line.startswith('[minia options]'):
return True
return False
def check_LAST():
p = subprocess.Popen(['lastal'], stderr=subprocess.PIPE)
for line in p.stderr:
if line.startswith('lastal'):
return True
return False
def check_python():
return sys.hexversion >= 0x20702f0
if __name__ == '__main__':
if not check_python(): sys.exit('Dependency problem: python >= 2.7.2 is required')
if not check_bwa(): sys.exit('Dependency problem: bwa >= 0.7.12 not found')
if not check_samtools(): sys.exit('Dependency problem: samtools >= 1.0 not found')
if not check_minia(): sys.exit('Dependency problem: minia not found')
if not check_LAST(): sys.exit('Dependency problem: LAST >= 548 not found')
setup(
name='TEBreak',
version='0.0.1',
author='Adam Ewing',
author_email='[email protected]',
description=("Insertion finder for high throughput sequence data"),
license='MIT',
url='https://github.com/adamewing/tebreak',
packages=['tebreak'],
install_requires = [
'pysam>=0.8.1',
'bx-python>=0.5.0',
'scipy>=0.14.0',
'numpy>=1.9.0',
'align>=0.1',
],
dependency_links = [
'git+http://github.com/adamewing/align.git#egg=align-0.1'
],
)