forked from SigProfilerSuite/SigProfilerExtractor
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
81 lines (72 loc) · 2.76 KB
/
setup.py
File metadata and controls
81 lines (72 loc) · 2.76 KB
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
from setuptools import setup
import shutil
import os
import sys
import subprocess
#remove the dist folder first if exists
if os.path.exists("dist"):
shutil.rmtree("dist")
VERSION = '1.1.4'
with open('README.md') as f:
long_description = f.read()
def write_version_py(filename='SigProfilerExtractor/version.py'):
# Copied from numpy setup.py
cnt = """
# THIS FILE IS GENERATED FROM SIGPROFILEREXTRACTOR SETUP.PY
short_version = '%(version)s'
version = '%(version)s'
Update = 'Heirarchy option deleted, clustering deleted and signatures orders by the mutation burden'
"""
fh = open(filename, 'w')
fh.write(cnt % {'version': VERSION,})
fh.close()
requirements=[
'matplotlib>=3.4.2',
'scipy>=1.6.3',
'torch>=1.8.1',
'numpy>=1.20.3',
'pandas>=1.2.4',
'nimfa>=1.1.0',
'SigProfilerMatrixGenerator>=1.1.30',
'sigProfilerPlotting>=1.1.15',
'pillow',
'statsmodels>=0.9.0',
'scikit-learn>=0.24.2',
'psutil>=5.6.1',
'reportlab>=3.5.42',
'PyPDF2>=1.26.0'
]
operating_system = sys.platform
print(operating_system)
if operating_system in ['win32','cygwin','windows']:
requirements.remove('matplotlib>=3.3.0')
requirements.remove('torch==1.5.1')
print('Trying to install pytorch!')
code = 1
try:
code = subprocess.call(['pip', 'install', 'torch===1.5.1+cpu', '-f', 'https://download.pytorch.org/whl/torch_stable.html'])
if code != 0:
raise Exception('Torch instalation failed !')
except:
try:
code = subprocess.call(['pip3', 'install', 'torch===1.5.1+cpu', '-f', 'https://download.pytorch.org/whl/torch_stable.html'])
if code != 0:
raise Exception('Torch instalation failed !')
except:
print('Failed to install pytroch, please install pytroch manually be following the simple instructions over at: https://pytorch.org/get-started/locally/')
if code == 0:
print('Successfully installed pytorch version! (If you need the GPU version, please install it manually, checkout the mindsdb docs and the pytroch docs if you need help)')
write_version_py()
setup(name='SigProfilerExtractor',
version=VERSION,
description='Extracts mutational signatures from mutational catalogues',
long_description=long_description,
long_description_content_type='text/markdown', # This is important!
url="https://github.com/AlexandrovLab/SigProfilerExtractor.git",
author='S Mishu Ashiqul Islam',
author_email='m0islam@ucsd.edu',
license='UCSD',
packages=['SigProfilerExtractor'],
install_requires=requirements,
include_package_data=True,
zip_safe=False)