0
|
1 #!/bin/bash
|
|
2 set -e
|
|
3
|
9
|
4 DIR=`dirname $0`
|
|
5 . ${DIR}/./bin/deseq_config.sh
|
0
|
6
|
|
7 echo ==========================================
|
|
8 echo DESeq-hts setup script \(DESeq version $DESEQ_VERSION\)
|
|
9 echo ==========================================
|
|
10 echo
|
|
11 echo DESeq-hts base directory \(currently set to \"$DESEQ_PATH\", suggest to set to \"`pwd`\", used if left empty\)
|
|
12 read DESEQ_PATH
|
|
13 if [ "$DESEQ_PATH" == "" ];
|
|
14 then
|
|
15 DESEQ_PATH=`pwd`
|
|
16 fi
|
|
17 echo '=>' Setting DESeq-hts base directory to \"$DESEQ_PATH\"
|
|
18 echo
|
|
19 echo SAMTools directory \(currently set to \"$SAMTOOLS_DIR\", system version used if left empty\)
|
|
20 read SAMTOOLS_DIR
|
|
21 if [ "$SAMTOOLS_DIR" == "" ];
|
|
22 then
|
|
23 if [ "$(which samtools)" != "" ] ;
|
|
24 then
|
|
25 SAMTOOLS_DIR=$(dirname $(which samtools))
|
|
26 else
|
|
27 echo samtools not found
|
|
28 exit -1 ;
|
|
29 fi
|
|
30 fi
|
|
31 echo '=>' Setting SAMTools directory to \"$SAMTOOLS_DIR\"
|
|
32 echo
|
|
33
|
|
34 echo Path to the python binary \(currently set to \"$PYTHON_PATH\", system version used, if left empty\)
|
|
35 read PYTHON_PATH
|
|
36 if [ "$PYTHON_PATH" == "" ];
|
|
37 then
|
|
38 PYTHON_PATH=`which python`
|
|
39 if [ "$PYTHON_PATH" == "" ];
|
|
40 then
|
|
41 echo python not found
|
|
42 exit -1
|
|
43 fi
|
|
44 fi
|
|
45 echo '=>' Setting Python path to \"$PYTHON_PATH\"
|
|
46 echo
|
|
47
|
|
48 echo Path to the R binary \(currently set to \"$R_PATH\", system version used, if left empty\)
|
|
49 read R_PATH
|
|
50 if [ "$R_PATH" == "" ];
|
|
51 then
|
|
52 R_PATH=`which R`
|
|
53 if [ "$R_PATH" == "" ];
|
|
54 then
|
|
55 echo R not found
|
|
56 exit -1
|
|
57 fi
|
|
58 fi
|
|
59 echo '=>' Setting R path to \"$R_PATH\"
|
|
60 echo
|
|
61
|
|
62 echo Path to Scipy library files \(currently set to \"$SCIPY_PATH\", system version is used if left empty\)
|
|
63 read SCIPY_PATH
|
|
64 echo '=>' Setting Scipy path to \"$SCIPY_PATH\"
|
|
65 echo
|
|
66
|
|
67 echo Which interpreter should be used \(\"octave\" or \"matlab\"\)
|
|
68 read INTERPRETER
|
|
69 if [ "$INTERPRETER" != 'octave' -a "$INTERPRETER" != 'matlab' ];
|
|
70 then
|
|
71 echo Unrecognized choice: \"$INTERPRETER\"
|
|
72 echo Aborting
|
|
73 false
|
|
74 fi
|
|
75 echo '=>' Setting interpreter to \"$INTERPRETER\"
|
|
76 echo
|
|
77
|
|
78 if [ "$INTERPRETER" == 'octave' ];
|
|
79 then
|
|
80 echo Please enter the full path to octave \(currently set to \"$OCTAVE_BIN_PATH\", system version used, if left empty\)
|
|
81 read OCTAVE_BIN_PATH
|
|
82 if [ "$OCTAVE_BIN_PATH" == "" ];
|
|
83 then
|
|
84 OCTAVE_BIN_PATH=`which octave`
|
|
85 if [ "$OCTAVE_BIN_PATH" == "" ];
|
|
86 then
|
|
87 echo octave not found
|
|
88 exit -1
|
|
89 fi
|
|
90 fi
|
|
91 echo '=>' Setting octave\'s path to \"$OCTAVE_BIN_PATH\"
|
|
92 echo
|
|
93 echo Please enter the full path to mkoctfile \(currently set to \"$OCTAVE_MKOCT\", system version used, if left empty\)
|
|
94 read OCTAVE_MKOCT
|
|
95 if [ "$OCTAVE_MKOCT" == "" ];
|
|
96 then
|
|
97 OCTAVE_MKOCT=`which mkoctfile`
|
|
98 if [ "$OCTAVE_MKOCT" == "" ];
|
|
99 then
|
|
100 OCTAVE_MKOCT=$(dirname $OCTAVE_BIN_PATH)/mkoctfile
|
|
101 if [ ! -f OCTAVE_MKOCT ];
|
|
102 then
|
|
103 echo mkoctfile not found
|
|
104 exit -1
|
|
105 fi
|
|
106 fi
|
|
107 fi
|
|
108 echo '=>' Setting mkoctfile\'s path to \"$OCTAVE_MKOCT\"
|
|
109 echo
|
|
110 MATLAB_BIN_PATH=
|
|
111 fi
|
|
112 if [ "$INTERPRETER" == 'matlab' ];
|
|
113 then
|
|
114 echo Please enter the full path to matlab \(currently set to \"$MATLAB_BIN_PATH\", system version used, if left empty\)
|
|
115 read MATLAB_BIN_PATH
|
|
116 if [ "${MATLAB_BIN_PATH}" == "" ];
|
|
117 then
|
|
118 MATLAB_BIN_PATH=`which matlab`
|
|
119 if [ "$MATLAB_BIN_PATH" == "" ];
|
|
120 then
|
|
121 echo matlab not found
|
|
122 exit -1
|
|
123 fi
|
|
124 fi
|
|
125 if [ ! -f $MATLAB_BIN_PATH ];
|
|
126 then
|
|
127 echo matlab not found
|
|
128 exit -1
|
|
129 fi
|
|
130 echo '=>' Setting matlab\'s path to \"$MATLAB_BIN_PATH\"
|
|
131 echo
|
|
132 echo Please enter the full path to mex binary \(currently set to \"$MATLAB_MEX_PATH\", system version used if left empty\)
|
|
133 read MATLAB_MEX_PATH
|
|
134 if [ "$MATLAB_MEX_PATH" == "" ];
|
|
135 then
|
|
136 MATLAB_MEX_PATH=`which mex`
|
|
137 if [ "$MATLAB_MEX_PATH" == "" ];
|
|
138 then
|
|
139 echo mex not found
|
|
140 exit -1
|
|
141 fi
|
|
142 fi
|
|
143 if [ ! -f "$MATLAB_MEX_PATH" ];
|
|
144 then
|
|
145 echo mex not found
|
|
146 exit -1
|
|
147 fi
|
|
148 echo '=>' Setting mex\' path to \"$MATLAB_MEX_PATH\"
|
|
149 echo
|
|
150 echo Please enter the full path to the matlab include directory \(currently set to \"$MATLAB_INCLUDE_DIR\", system version used, if left empty\)
|
|
151 read MATLAB_INCLUDE_DIR
|
|
152 if [ "$MATLAB_INCLUDE_DIR" == "" ];
|
|
153 then
|
|
154 MATLAB_INCLUDE_DIR=$(dirname $MATLAB_BIN_PATH)/../extern/include
|
|
155 fi
|
|
156 if [ ! -d "$MATLAB_INCLUDE_DIR" ];
|
|
157 then
|
|
158 echo matlab include dir not found
|
|
159 exit -1
|
|
160 fi
|
|
161 echo '=>' Setting matlab\'s include directory to \"$MATLAB_INCLUDE_DIR\"
|
|
162 echo
|
|
163 OCTAVE_BIN_PATH=
|
|
164 fi
|
|
165
|
|
166 cp -p bin/deseq_config.sh bin/deseq_config.sh.bk
|
|
167 grep -v -e OCTAVE_BIN_PATH -e OCTAVE_MKOCT -e MATLAB_BIN_PATH -e MATLAB_MEX_PATH -e MATLAB_INCLUDE_DIR \
|
|
168 -e DESEQ_PATH -e DESEQ_SRC_PATH -e DESEQ_BIN_PATH \
|
|
169 -e INTERPRETER -e SAMTOOLS_DIR -e PYTHON_PATH -e SCIPY_PATH -e R_PATH -e $DESEQ_VERSION bin/deseq_config.sh.bk \
|
|
170 > bin/deseq_config.sh
|
|
171 echo
|
|
172 echo
|
|
173 echo generating config file
|
|
174
|
|
175 echo export DESEQ_VERSION=$DESEQ_VERSION >> bin/deseq_config.sh
|
|
176 echo export DESEQ_PATH=$DESEQ_PATH >> bin/deseq_config.sh
|
|
177 echo export DESEQ_SRC_PATH=${DESEQ_PATH}/src >> bin/deseq_config.sh
|
|
178 echo export DESEQ_BIN_PATH=${DESEQ_PATH}/bin >> bin/deseq_config.sh
|
|
179 echo export INTERPRETER=$INTERPRETER >> bin/deseq_config.sh
|
|
180 echo export MATLAB_BIN_PATH=$MATLAB_BIN_PATH >> bin/deseq_config.sh
|
|
181 echo export MATLAB_MEX_PATH=$MATLAB_MEX_PATH >> bin/deseq_config.sh
|
|
182 echo export MATLAB_INCLUDE_DIR=$MATLAB_INCLUDE_DIR >> bin/deseq_config.sh
|
|
183 echo export OCTAVE_BIN_PATH=$OCTAVE_BIN_PATH >> bin/deseq_config.sh
|
|
184 echo export OCTAVE_MKOCT=$OCTAVE_MKOCT >> bin/deseq_config.sh
|
|
185 echo export SAMTOOLS_DIR=$SAMTOOLS_DIR >> bin/deseq_config.sh
|
|
186 echo export PYTHON_PATH=$PYTHON_PATH >> bin/deseq_config.sh
|
|
187 echo export SCIPY_PATH=$SCIPY_PATH >> bin/deseq_config.sh
|
|
188 echo export R_PATH=$R_PATH >> bin/deseq_config.sh
|
|
189
|
|
190 echo
|
|
191 echo Done.
|
|
192 echo
|