-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall_FastLeopard.sh
More file actions
348 lines (262 loc) · 7.7 KB
/
Copy pathinstall_FastLeopard.sh
File metadata and controls
348 lines (262 loc) · 7.7 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
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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
#!/bin/bash
#Method for checking if the software is installed on the machine (0 = installed, 1 = non-installed)
test_install()
{
SOFTWARE_NAME="$1"
STATUS=$(dpkg-query -W -f='${Status}' "$SOFTWARE_NAME")
if [ "$STATUS" = "install ok installed" ]; then
echo 0 #True
else
echo 1 #False
fi
}
#Method is asking user if he wants to install a software (name as parameter) and give back the user's response (0 = yes, 1 = no)
yes_no()
{
SOFTWARE_NAME="$1"
continue="true"
while [ $continue = "true" ];
do
echo "Do you wish to install "$SOFTWARE_NAME" ? [y/n]"
read yn
if [ $yn = "y" ]; then
return 0 #yes
continue="false"
elif [ $yn = "n" ]; then
return 1 #no
continue="false"
else
echo "Please answer with y or n"
fi
done
}
#Method for creating directory based on the user inpit and unzip fastleopard inside it
FastLeopard_dir_chooser()
{
continue="true"
while [ $continue = "true" ];
do
echo -n "Please enter the folder in which FastLeopard will be installed > "
read FastLeopard_PATH
#Try to cd to the folder
mkdir -p "$FastLeopard_PATH"
#If the command returns 0 -> success
ret=$?
#If the command returns 0 -> success, we stop the while
if [ $ret = 0 ]; then
continue="false"
else
echo "Please enter an existing directory"
fi
done
#tar xvfz "FastLeopard.tar.gz" --directory "$FastLeopard_PATH";
}
# ----------------------------------------
# Dependencies for FastLeopard
# ----------------------------------------
#Ask for folder
FastLeopard_dir_chooser
# Set directory
FULL_PATH=$PWD/$FastLeopard_PATH
#Perl installation
if [ $(test_install "perl") = 0 ]; then
echo "Perl already installed"
else
echo "\n############################"
echo "Perl installation"
echo "############################\n"
sudo apt-get install perl
echo "\n############################"
echo "Perl installation finished"
echo "############################\n"
fi
sudo apt-get install build-essential
sudo apt-get install liblist-moreutils-perl
sudo apt-get install zlib1g-dev
#R installation
if [ $(test_install "r-base") = 0 ]; then
echo "R already installed"
else
echo "\n####################################################"
echo "R installation and required libraries and packages"
echo "#####################################################\n"
sudo apt-get install r-base
sudo su - -c "R -e \"source('http://bioconductor.org/biocLite.R'); biocLite('Biobase')\""
sudo su - -c "R -e \"source('http://bioconductor.org/biocLite.R'); biocLite('edgeR')\""
sudo su - -c "R -e \"source('http://bioconductor.org/biocLite.R'); biocLite('DESeq2')\""
sudo su - -c "R -e \"source('http://bioconductor.org/biocLite.R'); biocLite('limma')\""
sudo su - -c "R -e \"source('http://bioconductor.org/biocLite.R'); biocLite('qvalue')\""
sudo su - -c "R -e \"source('http://bioconductor.org/biocLite.R'); biocLite('cluster')\""
sudo su - -c "R -e \"source('http://bioconductor.org/biocLite.R'); biocLite('EBSeq')\""
echo "\n############################"
echo "R installation finished"
echo "############################\n"
fi
#Blast installation
if [ $(test_install "ncbi-blast+") = 0 ]; then
echo "Blast+ already installed"
else
echo "Installation of blast+"
sudo apt-get install ncbi-blast+
fi
#Blast databases
DB_PATH="$FastLeopard_PATH/blast/db"
cd "$FastLeopard_PATH/blast/"
mkdir "./db/"
#Swissprot
yes_no "swissprot"
ret=$?
if [ $ret = 0 ]; then
echo "Swissprot DB Downloading... (in $DB_PATH)"
wget -N -P "$DB_PATH" "ftp://ftp.ncbi.nlm.nih.gov/blast/db/swissprot.tar.gz"
tar xvfz "$DB_PATH/swissprot.tar.gz" --directory "$DB_PATH";
fi
#nt
yes_no "nt"
ret=$?
if [ $ret = 0 ]; then
echo "nt Downloading... (in $DB_PATH)"
cd $DB_PATH
NT=which update_blastdb --passive nt
for f in nt.*
do
tar zxvf "$f" "$DB_PATH"
done
fi
#nr
yes_no "nr"
ret=$?
if [ $ret = 0 ]; then
echo "nr Downloading... (in $DB_PATH)"
cd $DB_PATH
NR=which update_blastdb --passive nr
fi
#Update all the paths created
echo "updating paths..."
sudo updatedb
#Bowite installation
if [ $(test_install "bowtie") = 0 ]; then
echo "Bowtie already installed"
else
echo "\n############################"
echo "Bowtie installation"
echo "############################\n"
sudo apt-get install bowtie
echo "\n############################"
echo "R installation finished"
echo "############################\n"
fi
#Bowtie2 installation
if [ $(test_install "bowtie2") = 0 ]; then
echo "Bowtie2 already installed"
else
echo "\n############################"
echo "Bowtie2 installation"
echo "############################\n"
sudo apt-get install bowtie2
echo "\n############################"
echo "Bowtie2 installation finished"
echo "############################\n"
fi
#Samtools
if [ $(test_install "samtools") = 0 ]; then
echo "Samtools already installed"
else
echo "\n############################"
echo "Samtools installation"
echo "############################\n"
sudo apt-get install samtools
echo "\n############################"
echo "Samtools installation finished"
echo "############################\n"
fi
#Trinity
cd $FULL_PATH
Trinity_PATH="trinity"
if [ ! -d $Trinity_PATH ]; then
mkdir -p "trinity"
fi
cd $Trinity_PATH
yes_no "trinity"
ret=$?
if [ $ret = 0 ]; then
url="https://github.com/trinityrnaseq/trinityrnaseq/archive/Trinity-v2.3.2.tar.gz"
base=$(basename ${url})
filename="trinity.tar.gz"
echo "\n############################"
echo "Trinity is downloading... (in $Trinity_PATH)"
echo "############################\n"
wget -P "$Trinity_PATH" -O "$filename" "$url"
tar xvfz "trinity.tar.gz";
cd "./trinityrnaseq-Trinity-v2.3.2/"
sudo make
sudo make plugins
fi
## RSEM
cd $FULL_PATH
RSEM_PATH="rsem"
if [ ! -d $RSEMm_PATH ]; then
mkdir -p "rsem"
fi
cd $RSEM_PATH
yes_no "RSEM"
ret=$?
if [ $ret = 0 ]; then
url="https://github.com/deweylab/RSEM/archive/master.zip"
base=$(basename ${url})
filename="rsem.zip"
echo "\n############################"
echo "RSEM is downloading... (in $RSEM_PATH)"
echo "############################\n"
wget -P "$RSEM_PATH" -O "$filename" "$url"
unzip $filename
cd "./RSEM-master/"
sudo make
fi
## QUAST
cd $FULL_PATH
QUAST_PATH="quast"
if [ ! -d $QUAST_PATH ]; then
mkdir -p "quast"
fi
cd $QUAST_PATH
yes_no "quast"
ret=$?
if [ $ret = 0 ]; then
url="https://downloads.sourceforge.net/project/quast/quast-4.5.tar.gz"
base=$(basename ${url})
filename="quast.tar.gz"
echo "\n############################"
echo "QUAST is downloading... (in $QUAST_PATH)"
echo "############################\n"
sudo apt-get install -y pkg-config libfreetype6-dev libpng-dev python-matplotlib
wget -P "$QUAST_PATH" -O "$filename" "$url"
tar xvfz $filename;
fi
## TRIMMOMATIC
cd $FULL_PATH
TRIM_PATH="trimmomatic"
if [ ! -d $TRIM_PATH ]; then
mkdir -p "trimmomatic"
fi
cd $TRIM_PATH
yes_no "trimmomatic"
ret=$?
if [ $ret = 0 ]; then
url="https://github.com/timflutre/trimmomatic/archive/master.zip"
base=$(basename ${url})
filename="trimmomatic.zip"
echo "\n############################"
echo "Trimmomatic is downloading... (in $TRIM_PATH)"
echo "############################\n"
wget -P "$TRIM_PATH" -O "$filename" "$url"
unzip $filename
cd "./trimmomatic-master/"
sudo make
fi
## Printing all of the installed tools
echo "\n\n\n\n\n"
echo $FULL_PATH/$Trinity_PATH"/trinityrnaseq-Trinity-v2.3.2/Trinity"
echo $FULL_PATH/$RSEM_PATH
echo $FULL_PATH/$TRIM_PATH"/classes/trimmomatic.jar"
echo $FULL_PATH/$QUAST_PATH"/quast-master/quast.py"