This repository has been archived by the owner on Dec 16, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 33
/
Copy pathcreate_oncotator_venv.sh
executable file
·133 lines (110 loc) · 3.72 KB
/
create_oncotator_venv.sh
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
#!/bin/bash
# Adapted from internal Broad cgap project.
# Have script stop if there is an error
set -e
#################################################
# Parsing arguments
#################################################
while getopts ":e:ckstm" option; do
case "$option" in
e) ENV="$OPTARG" ;;
c) FLAGS="archflags" ;;
k) COMPIL="skip" ;;
t) TRAVIS=true ;;
m) MAC=true ;;
esac
done
if [ -z "$ENV" ] && [ ! $TRAVIS ]; then
printf "Option -e requires an argument.\n \
Usage: %s: -e <ENV> [-cks] \n \
where <ENV> is the name to associate with this environment \n \
(e.g. create_oncotator_venv.sh oncotator_test_env)\n \
Optional arguments: \n \
-c \t trigger the workaround for the XCode 5.1.1 compilation bug \n \
\t (see documentation for details) \n \
-k \t skip packages that require compilation \n \
-t \t run in travis installation mode \n \
-m \t create venv on Mac (i.e. skip ngslib installation) \n" $0
exit 1
fi
if [ ! -z "$FLAGS" ]; then
printf "Option -c specified -- the ARCHFLAGS workaround will be applied.\n"
fi
if [ ! -z "$COMPIL" ]; then
printf "Option -k specified -- packages that require compilation will be skipped.\n"
fi
if [ ! -z "$TRAVIS" ]; then
printf "TRAVIS environment variable is set. Do not activate/deactivate virtual envs.\n"
fi
SKIP_MSG="Skipping... Make sure to install these packages manually after the script has finished. "
#################################################
# Create the V-ENV
#################################################
if [ ! $TRAVIS ]; then
# Create and activate a test environment
virtualenv $ENV
source $ENV/bin/activate
echo " "
echo "Virtual environment created and activated in $ENV."
echo "Now attempting to install packages into the virtual environment."
else
which python
python --version
fi
echo "Update Pip"
pip --version
pip install -U pip
pip --version
#
# IMPORTANT changes to packages and version numbers must also be reflected in setup.py
#
#################################################
# Installations that require compilation
#################################################
if [ "$COMPIL" == "skip" ];
then
echo $SKIP_MSG
else
echo "Attempting to install packages that require compilation. If this fails, try again with the flag -c added to the script command. If that still does not work, you will need to install them manually."
for C_PACKAGE in 'biopython==1.66' 'cython==0.24' 'numpy==1.11.0' 'pandas==0.18.0' 'sqlalchemy==1.0.12'
do
echo " "
echo "$C_PACKAGE =========================="
if [ "$FLAGS" == "archflags" ]; then
env ARCHFLAGS="-Wno-error=unused-command-line-argument-hard-error-in-future" pip install $C_PACKAGE
else
pip install --no-binary :all: $C_PACKAGE
fi
echo "OK"
done
if [ ! $MAC ]; then
echo " "
echo "ngslib =========================="
if [ "$FLAGS" == "archflags" ]; then
env ARCHFLAGS="-Wno-error=unused-command-line-argument-hard-error-in-future" pip install ngslib==1.1.18
else
pip install --no-binary :all: ngslib==1.1.18
fi
echo "OK"
fi
fi
#################################################
# Easy installations
#################################################
echo " "
echo "Installing dependencies that can be obtained from pypi"
for PACKAGE in 'pyvcf==0.6.8' 'bcbio-gff==0.6.2' 'nose==1.3.7' 'shove==0.6.6' 'python-memcached==1.57' 'natsort==4.0.4' 'more-itertools==2.2' 'enum34==1.1.2'
do
echo " "
echo "$PACKAGE =========================="
pip install -U --no-binary :all: $PACKAGE
echo "OK"
done
#################################################
# All done!
#################################################
echo "NOTE: Oncotator has not been installed, only the dependencies. You MUST still install Oncotator manually. "
if [ ! $TRAVIS ]; then
echo "Deactivating"
deactivate
fi