-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinter-install.py
62 lines (58 loc) · 1.47 KB
/
inter-install.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
#inter-install.py
'''
# -----------------------------------------------------------------------
#
# inter-install.py
#
# by Hannah Catabia
# Last Modified: WHEN!?!!?
#
# This script installs the Python packages needed to run
# Inter-Tools.
#
# Inter-Tools: A Python toolkit for interactome research
#
# by Hannah Catabia, Caren Smith, and Jose Ordovas
#
#
# -----------------------------------------------------------------------
#
# This program will use pip to install the eight Python
# packages that are needed in inter-build.py and
# inter-map.py. It only needs to be run once from
# the command line:
#
# Usage example:
# > python inter-install.py
#
'''
import sys
import pip
from subprocess import check_call, CalledProcessError
def system_check():
if int(sys.version.split()[0].split('.')[2]) < 9:
print '\nThis program only runs on Python 2 >= 2.7.9. Please install and try again.'
print '\n Checking that the appropriate Python modules are installed...'
print
pip.main(['install', 'mygene'])
print
pip.main(['install', 'pandas'])
print
pip.main(['install', 'rpy2'])
print
pip.main(['install', 'matplotlib'])
print
pip.main(['install', 'matplotlib_venn'])
print
pip.main(['install', 'networkx'])
print
pip.main(['install', 'numpy'])
# checking if R is installed
try:
check_call(['which', 'R'])
except CalledProcessError:
print 'This program requires R 3.3.3 to run. Please install R 3.3.3!'
print
sys.exit(0)
if __name__ == '__main__':
system_check()