-
Notifications
You must be signed in to change notification settings - Fork 1
/
INSTALL.sh
executable file
·916 lines (844 loc) · 31.6 KB
/
INSTALL.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
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
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
#!/usr/bin/env bash
set -e
rootdir=$( cd $(dirname $0) ; pwd -P )
os=$( awk -F= '$1=="ID" { print $2 ;}' /etc/os-release )
exec > >(tee install.log)
exec 2>&1
cd $rootdir
mkdir -p bin
mkdir -p thirdParty
cd thirdParty
export PATH=$PATH:$rootdir/bin:$rootdir/thirdParty/Anaconda2/bin
alignments_tools=( clustalo snippy mafft kma muscle mummer )
analysis_tools=( roary )
annotation_tools=( BLAST+ blastall phage_finder aragorn prodigal prokka tRNAscan )
classification_tools=( centrifuge )
phylogeny_tools=( phylip )
utility_tools=( Anaconda2 JBrowse circos )
all_tools=( "${alignments_tools[@]}" "${analysis_tools[@]}" "${annotation_tools[@]}" "${classification_tools[@]}" "${phylogeny_tools[@]}" "${utility_tools[@]}" )
install_Anaconda2() {
echo "------------------------------------------------------------------------------
Installing Anaconda2
------------------------------------------------------------------------------
"
if [ ! -f $rootdir/thirdParty/Anaconda2/bin/python ]; then
wget -c https://repo.anaconda.com/archive/Anaconda2-2019.10-Linux-x86_64.sh
bash Anaconda2-2019.10-Linux-x86_64.sh -b -p $rootdir/thirdParty/Anaconda2/
fi
anacondabin=$rootdir/thirdParty/Anaconda2/bin/
ln -fs $anacondabin/python $rootdir/bin
ln -fs $anacondabin/pip $rootdir/bin
ln -fs $anacondabin/conda $rootdir/bin
$anacondabin/conda install -y biopython
$anacondabin/pip install regex htmldom PyPDF2 mysqlclient
#sed -i -E 's%/tmp/build/[a-zA-Z0-9]+/perl_[0-9]+/_build_env%/home/hpdb/base/thirdParty/Anaconda2%g' /home/hpdb/base/thirdParty/Anaconda2/lib/5.26.2/x86_64-linux-thread-multi/Config_heavy.pl
#sed -i -E 's%/tmp/build/[a-zA-Z0-9]+/perl_[0-9]+/_build_env%/home/hpdb/base/thirdParty/Anaconda2%g' /home/hpdb/base/thirdParty/Anaconda2/lib/5.26.2/x86_64-linux-thread-multi/CORE/config.h
#sed -i -E 's%/tmp/build/[a-zA-Z0-9]+/perl_[0-9]+/_build_env%/home/hpdb/base/thirdParty/Anaconda2%g' /home/hpdb/base/thirdParty/Anaconda2/lib/5.26.2/x86_64-linux-thread-multi/Config.pm
echo "
------------------------------------------------------------------------------
Anaconda2 Installed
------------------------------------------------------------------------------
"
}
install_BLAST+() {
echo "------------------------------------------------------------------------------
Installing ncbi-blast-2.9.0+-x64
------------------------------------------------------------------------------
"
wget -c ftp://ftp.ncbi.nlm.nih.gov/blast/executables/blast+/2.9.0/ncbi-blast-2.9.0+-x64-linux.tar.gz
tar -xzf ncbi-blast-2.9.0+-x64-linux.tar.gz
cd ncbi-blast-2.9.0+
cp -fR bin/* $rootdir/bin/.
cd $rootdir/thirdParty
echo "
------------------------------------------------------------------------------
ncbi-blast-2.9.0+-x64 installed
------------------------------------------------------------------------------
"
}
install_blastall()
{
echo "------------------------------------------------------------------------------
Install blast-2.2.26-x64-linux
------------------------------------------------------------------------------
"
wget -c ftp://ftp.ncbi.nlm.nih.gov/blast/executables/legacy.NOTSUPPORTED/2.2.26/blast-2.2.26-x64-linux.tar.gz
tar -xzf blast-2.2.26-x64-linux.tar.gz
cd blast-2.2.26
cp -fR bin/* $rootdir/bin/.
cd $rootdir/thirdParty
echo "
------------------------------------------------------------------------------
blast-2.2.26-x64 installed
------------------------------------------------------------------------------
"
}
install_aragorn()
{
echo "------------------------------------------------------------------------------
Compiling aragorn1.2.38
------------------------------------------------------------------------------
"
wget -c http://130.235.244.92/ARAGORN/Downloads/aragorn1.2.38.tgz
tar -xzf aragorn1.2.38.tgz
cd aragorn1.2.38
gcc -O3 -ffast-math -finline-functions -o aragorn aragorn1.2.38.c
cp -fR aragorn $rootdir/bin/.
cd $rootdir/thirdParty
echo "
------------------------------------------------------------------------------
aragorn1.2.38 compiled
------------------------------------------------------------------------------
"
}
install_prodigal() {
echo "------------------------------------------------------------------------------
Installing prodigal v2.6.3
------------------------------------------------------------------------------
"
wget -c https://github.com/hyattpd/Prodigal/releases/download/v2.6.3/prodigal.linux -O prodigal-v2.6.3
cp prodigal-v2.6.3 $rootdir/bin/prodigal
chmod +x $rootdir/bin/prodigal
cd $rootdir/thirdParty
echo "
------------------------------------------------------------------------------
prodigal v2.6.0 installed
------------------------------------------------------------------------------
"
}
install_prokka()
{
echo "------------------------------------------------------------------------------
Installing prokka
------------------------------------------------------------------------------
"
#$rootdir/thirdParty/Anaconda2/bin/conda install -y -c bioconda prokka
git clone https://github.com/tseemann/prokka.git prokka
ln -fs `pwd`/prokka/bin/prokka $rootdir/bin
echo "
------------------------------------------------------------------------------
prokka installed
------------------------------------------------------------------------------
"
}
install_tRNAscan()
{
echo "------------------------------------------------------------------------------
Installing tRNAscan-SE 2.0.4
------------------------------------------------------------------------------
"
wget -c http://trna.ucsc.edu/software/trnascan-se-2.0.4.tar.gz
tar -xzf trnascan-se-2.0.4.tar.gz
cd tRNAscan-SE-2.0
./configure --prefix=$rootdir && make && make install
cd $rootdir/thirdParty
echo "
------------------------------------------------------------------------------
tRNAscan-SE 2.0.4 installed
------------------------------------------------------------------------------
"
}
install_clustalo() {
echo "------------------------------------------------------------------------------
Installing Clustal Omega
------------------------------------------------------------------------------
"
wget -c http://www.clustal.org/omega/clustal-omega-1.2.4.tar.gz
tar -xzf clustal-omega-1.2.4.tar.gz
cd clustal-omega-1.2.4
./configure --prefix=$rootdir && make && make install
cd $rootdir/thirdParty
echo "------------------------------------------------------------------------------
Clustal Omega installed
------------------------------------------------------------------------------
"
}
install_bcftools() {
echo "------------------------------------------------------------------------------
Installing bcftools
------------------------------------------------------------------------------
"
wget -c https://github.com/samtools/bcftools/releases/download/1.9/bcftools-1.9.tar.bz2
tar -xjf bcftools-1.9.tar.bz2
cd bcftools-1.9
./configure --prefix=$rootdir && make && make install
cd $rootdir/thirdParty
echo "------------------------------------------------------------------------------
bcftools installed
------------------------------------------------------------------------------
"
}
install_htslib() {
echo "------------------------------------------------------------------------------
Installing htslib
------------------------------------------------------------------------------
"
wget -c https://github.com/samtools/htslib/releases/download/1.10.2/htslib-1.10.2.tar.bz2
tar -xjf htslib-1.10.2.tar.bz2
cd htslib-1.10.2
./configure --prefix=$rootdir && make && make install
cd $rootdir/thirdParty
echo "------------------------------------------------------------------------------
htslib installed
------------------------------------------------------------------------------
"
}
install_samtools() {
echo "------------------------------------------------------------------------------
Installing samtools
------------------------------------------------------------------------------
"
wget -c https://github.com/samtools/samtools/releases/download/1.10/samtools-1.10.tar.bz2
tar -xjf samtools-1.10.tar.bz2
cd samtools-1.10
./configure --prefix=$rootdir && make && make install
cd $rootdir/thirdParty
echo "------------------------------------------------------------------------------
samtools installed
------------------------------------------------------------------------------
"
}
install_minimap2() {
echo "------------------------------------------------------------------------------
Installing minimap2
------------------------------------------------------------------------------
"
wget -c https://github.com/lh3/minimap2/releases/download/v2.17/minimap2-2.17_x64-linux.tar.bz2
tar -xjf minimap2-2.17_x64-linux.tar.bz2
cp minimap2-2.17_x64-linux/minimap2 $rootdir/bin
echo "------------------------------------------------------------------------------
minimap2 installed
------------------------------------------------------------------------------
"
}
install_snpsites() {
echo "------------------------------------------------------------------------------
Installing snp-sites
------------------------------------------------------------------------------
"
wget -c https://github.com/sanger-pathogens/snp-sites/archive/v2.5.1.tar.gz -O snp-sites-v2.5.1.tar.gz
tar -xzf snp-sites-v2.5.1.tar.gz
cd snp-sites-2.5.1
autoreconf -i -f
./configure --prefix=$rootdir && make && make install
cd $rootdir/thirdParty
echo "------------------------------------------------------------------------------
snp-sites installed
------------------------------------------------------------------------------
"
}
install_seqtk() {
echo "------------------------------------------------------------------------------
Installing seqtk
------------------------------------------------------------------------------
"
git clone https://github.com/lh3/seqtk.git;
cd seqtk; make
cp seqtk $rootdir/bin
cd $rootdir/thirdParty
echo "------------------------------------------------------------------------------
seqtk installed
------------------------------------------------------------------------------
"
}
install_vt() {
echo "------------------------------------------------------------------------------
Installing vt
------------------------------------------------------------------------------
"
git clone https://github.com/atks/vt
cd vt; make
cp vt $rootdir/bin
cd $rootdir/thirdParty
echo "------------------------------------------------------------------------------
vt installed
------------------------------------------------------------------------------
"
}
install_freebayes() {
echo "------------------------------------------------------------------------------
Installing freebayes
------------------------------------------------------------------------------
"
wget -c https://github.com/ekg/freebayes/releases/download/v1.3.1/freebayes-v1.3.1
cp freebayes-v1.3.1 $rootdir/bin/freebayes
chmod +x $rootdir/bin/freebayes
echo "------------------------------------------------------------------------------
freebayes installed
------------------------------------------------------------------------------
"
}
install_snippy() {
echo "------------------------------------------------------------------------------
Installing snippy
------------------------------------------------------------------------------
"
install_htslib
if ( ! checkLocalInstallation bcftools )
then
install_bcftools
fi
if ( ! checkLocalInstallation samtools )
then
install_samtools
fi
if ( ! checkLocalInstallation minimap2 )
then
install_minimap2
fi
if ( ! checkLocalInstallation seqtk )
then
install_seqtk
fi
if ( ! checkLocalInstallation vt )
then
install_vt
fi
if ( ! checkLocalInstallation freebayes )
then
install_freebayes
fi
wget -c https://github.com/tseemann/snippy/archive/v4.6.0.tar.gz -O snippy-4.6.0.tar.gz
tar -xzf snippy-4.6.0.tar.gz
cd snippy-4.6.0/bin
sed -i.bak 's,vt normalize -r,vt normalize -n -r,' snippy # patch snippy to skip inconsistent reference bases
find . -type f -executable -exec ln -fs `pwd`/{} $rootdir/bin \;
cd $rootdir/thirdParty
echo "------------------------------------------------------------------------------
snippy installed
------------------------------------------------------------------------------
"
}
install_kma() {
echo "------------------------------------------------------------------------------
Installing kma
------------------------------------------------------------------------------
"
wget -c https://bitbucket.org/genomicepidemiology/kma/get/1.2.19.tar.gz -O kma-1.2.19.tar.gz
tar -xzf kma-1.2.19.tar.gz
cd genomicepidemiology-kma-*
make
cp kma $rootdir/bin/
cp kma_index $rootdir/bin/
cp kma_shm $rootdir/bin/
cp kma_update $rootdir/bin/
cd $rootdir/thirdParty
echo "------------------------------------------------------------------------------
kma installed
------------------------------------------------------------------------------
"
}
install_muscle() {
echo "------------------------------------------------------------------------------
Installing muscle
------------------------------------------------------------------------------
"
wget -c https://www.drive5.com/muscle/downloads3.8.31/muscle3.8.31_i86linux64.tar.gz
tar -xzf muscle3.8.31_i86linux64.tar.gz
mv muscle3.8.31_i86linux64 muscle
chmod +x muscle
cp muscle $rootdir/bin/
cd $rootdir/thirdParty
echo "
------------------------------------------------------------------------------
muscle installed
------------------------------------------------------------------------------
"
}
install_mummer() {
echo "------------------------------------------------------------------------------
Compiling MUMmer3.23 64bit
------------------------------------------------------------------------------
"
wget -c https://nchc.dl.sourceforge.net/project/mummer/mummer/3.23/MUMmer3.23.tar.gz
tar -xzf MUMmer3.23.tar.gz
cd MUMmer3.23
#for 64bit MUMmer complie
make CPPFLAGS="-O3 -DSIXTYFOURBITS"
find . -type f -perm /a+x -exec cp {} $rootdir/bin/ \;
cd $rootdir/thirdParty
echo "
------------------------------------------------------------------------------
MUMmer3.23 compiled
------------------------------------------------------------------------------
"
}
install_bedtools() {
echo "------------------------------------------------------------------------------
Installing bedtools
------------------------------------------------------------------------------
"
wget -c https://github.com/arq5x/bedtools2/releases/download/v2.29.2/bedtools.static.binary -O bedtools
cp bedtools $rootdir/bin
chmod +x $rootdir/bin/bedtools
echo "------------------------------------------------------------------------------
bedtools installed
------------------------------------------------------------------------------
"
}
install_cdhit() {
echo "------------------------------------------------------------------------------
Installing cdhit
------------------------------------------------------------------------------
"
wget -c https://github.com/weizhongli/cdhit/releases/download/V4.8.1/cd-hit-v4.8.1-2019-0228.tar.gz
tar -xzf cd-hit-v4.8.1-2019-0228.tar.gz
cd cd-hit-v4.8.1-2019-0228
sed -i.bak 's,PREFIX ?= /usr/local,PREFIX ?= '"$rootdir"',' Makefile
make && make install
cd $rootdir/thirdParty
echo "------------------------------------------------------------------------------
cdhit installed
------------------------------------------------------------------------------
"
}
install_mcl() {
echo "------------------------------------------------------------------------------
Installing mcl
------------------------------------------------------------------------------
"
wget -c https://micans.org/mcl/src/mcl-14-137.tar.gz
tar -xzf mcl-14-137.tar.gz
cd mcl-14-137
./configure --enable-blast --prefix=$rootdir && make && make install
cd $rootdir/thirdParty
echo "------------------------------------------------------------------------------
mcl installed
------------------------------------------------------------------------------
"
}
install_prank() {
echo "------------------------------------------------------------------------------
Installing prank
------------------------------------------------------------------------------
"
wget -c http://wasabiapp.org/download/prank/prank.source.170427.tgz
tar -xzf prank.source.170427.tgz
cd prank-msa/src && make
cp prank $rootdir/bin/
cd $rootdir/thirdParty
echo "------------------------------------------------------------------------------
prank installed
------------------------------------------------------------------------------
"
}
install_mafft() {
echo "------------------------------------------------------------------------------
Installing mafft
------------------------------------------------------------------------------
"
wget -c https://mafft.cbrc.jp/alignment/software/mafft-7.453-with-extensions-src.tgz
tar -xzf mafft-7.453-with-extensions-src.tgz
cd mafft-7.453-with-extensions/core
sed -i.bak 's,PREFIX = /usr/local,PREFIX = '"$rootdir"',' Makefile
make && make install
cd $rootdir/thirdParty
echo "------------------------------------------------------------------------------
mafft installed
------------------------------------------------------------------------------
"
}
install_fasttree() {
echo "------------------------------------------------------------------------------
Installing fasttree
------------------------------------------------------------------------------
"
wget -c http://www.microbesonline.org/fasttree/FastTree.c
gcc -DUSE_DOUBLE -O3 -finline-functions -funroll-loops -Wall -o FastTree FastTree.c -lm
gcc -DOPENMP -DUSE_DOUBLE -fopenmp -O3 -finline-functions -funroll-loops -Wall -o FastTreeMP FastTree.c -lm
cp FastTree $rootdir/bin/
cp FastTreeMP $rootdir/bin/
echo "------------------------------------------------------------------------------
fasttree installed
------------------------------------------------------------------------------
"
}
install_roary() {
echo "------------------------------------------------------------------------------
Installing roary
------------------------------------------------------------------------------
"
if ( ! checkLocalInstallation bedtools )
then
install_bedtools
fi
if ( ! checkLocalInstallation cd-hit )
then
install_cdhit
fi
if ( ! checkLocalInstallation mcl )
then
install_mcl
fi
if ( ! checkLocalInstallation prank )
then
install_prank
fi
if ( ! checkLocalInstallation mafft )
then
install_mafft
fi
if ( ! checkLocalInstallation FastTree )
then
install_fasttree
fi
if ( ! checkLocalInstallation blastn )
then
install_BLAST+
fi
wget -c https://github.com/sanger-pathogens/Roary/archive/v3.13.0.tar.gz -O roary-v3.13.0.tar.gz
tar -xzf roary-v3.13.0.tar.gz
cd Roary-3.13.0/bin
find . -type f -executable -exec ln -fs `pwd`/{} $rootdir/bin \;
cd $rootdir/thirdParty
echo "------------------------------------------------------------------------------
roary installed
------------------------------------------------------------------------------
"
}
install_centrifuge() {
echo "------------------------------------------------------------------------------
Installing centrifuge
------------------------------------------------------------------------------
"
wget -c https://github.com/DaehwanKimLab/centrifuge/archive/v1.0.4-beta.tar.gz -O centrifuge-v1.0.4-beta.tar.gz
tar -xzf centrifuge-v1.0.4-beta.tar.gz
cd centrifuge-1.0.4-beta
sed -i.bak 's,prefix=/usr/local,prefix='"$rootdir"',' Makefile
make && make install
cd $rootdir/thirdParty
echo "------------------------------------------------------------------------------
centrifuge installed
------------------------------------------------------------------------------
"
}
install_phage_finder() {
echo "------------------------------------------------------------------------------
Installing phage_finder
------------------------------------------------------------------------------
"
wget -c https://liquidtelecom.dl.sourceforge.net/project/phage-finder/phage_finder_v2.1/phage_finder_v2.1.tar.gz
tar -xzf phage_finder_v2.1.tar.gz
cd $rootdir/thirdParty
chmod -R +x phage_finder_v2.1
chmod -R +r phage_finder_v2.1
echo "------------------------------------------------------------------------------
phage_finder installed
------------------------------------------------------------------------------
"
}
install_phylip() {
echo "------------------------------------------------------------------------------
Installing phylip
------------------------------------------------------------------------------
"
wget -c http://evolution.gs.washington.edu/phylip/download/phylip-3.697.tar.gz
tar -xzf phylip-3.697.tar.gz
cd phylip-3.697/src
make -f Makefile.unx install
cp ../exe/* $rootdir/bin
cd $rootdir/thirdParty
echo "------------------------------------------------------------------------------
phylip installed
------------------------------------------------------------------------------
"
}
install_JBrowse() {
echo "------------------------------------------------------------------------------
Installing JBrowse-1.16.6
------------------------------------------------------------------------------
"
wget -c https://github.com/GMOD/jbrowse/releases/download/1.16.6-release/JBrowse-1.16.6.zip
unzip -q JBrowse-1.16.6.zip
if [ -e $rootdir/www/JBrowse/data ]
then
mv $rootdir/www/JBrowse/data $rootdir/www/JBrowse_olddata
fi
if [ -e $rootdir/www/JBrowse ]
then
rm -rf $rootdir/www/JBrowse
fi
mv JBrowse-1.16.6 $rootdir/www/JBrowse
cd $rootdir/www/JBrowse
./setup.sh
if [ -e $rootdir/www/JBrowse_olddata ]
then
mv $rootdir/www/JBrowse_olddata $rootdir/www/JBrowse/data
else
mkdir -p -m 775 data
fi
ln -s $rootdir/data userdata
cd $rootdir/thirdParty
#ln -sf $rootdir/thirdParty/JBrowse-1.16.6 $rootdir/www/JBrowse
echo "
------------------------------------------------------------------------------
JBrowse-1.16.6 installed
------------------------------------------------------------------------------
"
}
install_circos() {
echo "------------------------------------------------------------------------------
Installing circos-0.69-9
------------------------------------------------------------------------------
"
wget -c http://circos.ca/distribution/circos-0.69-9.tgz
tar -xzf circos-0.69-9.tgz
circosbin=$rootdir/thirdParty/circos-0.69-9/bin/
ln -fs $circosbin/circos $rootdir/bin
cd $rootdir/thirdParty
echo "
------------------------------------------------------------------------------
circos-0.69-9 installed
------------------------------------------------------------------------------
"
}
checkSystemInstallation() {
IFS=:
for d in $PATH; do
if test -x "$d/$1"; then return 0; fi
done
return 1
}
checkLocalInstallation() {
IFS=:
for d in $rootdir/bin; do
if test -x "$d/$1"; then return 0; fi
done
return 1
}
containsElement () {
local e
for e in "${@:2}"; do [[ "$e" == "$1" ]] && return 0; done
return 1
}
print_usage() {
cat << EOF
usage: $0 options
If no options, it will check existing installation and run tools installation for those uninstalled.
options:
help show this help
list show available tools for updates
tools_name install/update individual tool
force force to install all list tools locally
ex: To update clustalo only
$0 clustalo
ex: To update clustalo and prodigal
$0 clustalo prodigal
ex: RE-install Alignment tools
$0 Alignment
EOF
}
print_tools_list() {
echo "Available tools for updates/re-install"
echo -e "\nAlignment"
for i in "${alignments_tools[@]}"
do
echo "* $i"
done
echo -e "\nAnalysis"
for i in "${analysis_tools[@]}"
do
echo "* $i"
done
echo -e "\nAnnotation"
for i in "${annotation_tools[@]}"
do
echo "* $i"
done
echo -e "\nClassification"
for i in "${classification_tools[@]}"
do
echo "* $i"
done
echo -e "\nPhylogeny"
for i in "${phylogeny_tools[@]}"
do
echo "* $i"
done
echo -e "\nUtility"
for i in "${utility_tools[@]}"
do
echo "* $i"
done
}
### Main ####
if [ "$#" -ge 1 ]
then
for f in $@
do
case $f in
help)
print_usage
exit 0;;
list)
print_tools_list
exit 0;;
Alignment)
for tool in "${alignments_tools[@]}"
do
install_$tool
done
echo -e "Alignment tools installed.\n"
exit 0;;
Analysis)
for tool in "${analysis_tools[@]}"
do
install_$tool
done
echo -e "Analysis tools installed.\n"
exit 0;;
Annotation)
for tool in "${annotation_tools[@]}"
do
install_$tool
done
echo -e "Annotation tools installed.\n"
exit 0;;
Classification)
for tool in "${classification_tools[@]}"
do
install_$tool
done
echo -e "Classification tools installed.\n"
exit 0;;
Phylogeny)
for tool in "${phylogeny_tools[@]}"
do
install_$tool
done
echo -e "Phylogeny tools installed.\n"
exit 0;;
Utility)
for tool in "${utility_tools[@]}"
do
install_$tool
done
echo -e "Utility tools installed.\n"
exit 0;;
force)
for tool in "${all_tools[@]}"
do
install_$tool
done
;;
*)
#if ( containsElement "$f" "${annotation_tools[@]}" || containsElement "$f" "${analysis_tools[@]}" || containsElement "$f" "${alignments_tools[@]}" || containsElement "$f" "${classification_tools[@]}" || containsElement "$f" "${phylogeny_tools[@]}" || containsElement "$f" "${utility_tools[@]}" )
#then
# install_$f
#else
# echo "$f: invalid tool"
# print_tools_list
#fi
install_$f
exit;;
esac
done
fi
if $rootdir/bin/python -c 'import Bio; print Bio.__version__' >/dev/null 2>&1
then
$rootdir/bin/python -c 'import Bio; print "BioPython Version", Bio.__version__, "is found"'
else
echo "Anaconda2 is not found"
install_Anaconda2
fi
if ( checkLocalInstallation snippy )
then
echo "snippy is found"
else
echo "snippy is not found"
install_snippy
fi
if ( checkLocalInstallation clustalo )
then
echo "clustalo is found"
else
echo "clustalo is not found"
install_clustalo
fi
if ( checkLocalInstallation roary )
then
echo "roary is found"
else
echo "roary is not found"
install_roary
fi
if ( checkLocalInstallation blastn )
then
echo "BLAST+ is found"
else
echo "BLAST+ is not found"
install_BLAST+
fi
if ( checkLocalInstallation blastall )
then
echo "blastall is found"
else
echo "blastall is not found"
install_blastall
fi
if ( checkLocalInstallation prodigal )
then
echo "prodigal is found"
else
echo "prodigal is not found"
install_prodigal
fi
if [ -x $rootdir/www/JBrowse/bin/prepare-refseqs.pl ]
then
echo "JBrowse is found"
else
echo "JBrowse is not found"
install_JBrowse
fi
cd $rootdir
if [ -f $HOME/.bashrc ]; then {
if ( ! grep -Fxq "# Added by HPDB pipeline installation - Do not remove this line" $HOME/.bashrc )
then
echo "# Added by HPDB pipeline installation - Do not remove this line" >> $HOME/.bashrc
echo "export HPDB_BASE=$rootdir" >> $HOME/.bashrc
echo "export PATH=$rootdir/bin:$rootdir/thirdParty/Anaconda2/bin:\$PATH:" >> $HOME/.bashrc
echo "export PYTHONPATH=$rootdir/scripts:\$PYTHONPATH:" >> $HOME/.bashrc
if [[ $os == "ubuntu" ]]; then {
echo "alias httperr='sudo cat /var/log/apache2/error.log'" >> $HOME/.bashrc
echo "alias httperrclear='sudo sh -c "'"'"echo '' > /var/log/apache2/error.log"'"'"'" >> $HOME/.bashrc
} else {
echo "alias httperr='sudo cat /etc/httpd/logs/error_log'" >> $HOME/.bashrc
echo "alias httperrclear='sudo sh -c "'"'"echo '' > /etc/httpd/logs/error_log"'"'"'" >> $HOME/.bashrc
}
fi
fi
} else {
if ( ! grep -Fxq "# Added by HPDB pipeline installation - Do not remove this line" $HOME/.bash_profile )
then
echo "# Added by HPDB pipeline installation - Do not remove this line" >> $HOME/.bash_profile
echo "export HPDB_BASE=$rootdir" >> $HOME/.bash_profile
echo "export PATH=$rootdir/bin:$rootdir/thirdParty/Anaconda2/bin:\$PATH:" >> $HOME/.bash_profile
echo "export PYTHONPATH=$rootdir/scripts:\$PYTHONPATH:" >> $HOME/.bash_profile
if [[ $os == "ubuntu" ]]; then {
echo "alias httperr='sudo cat /var/log/apache2/error.log'" >> $HOME/.bash_profile
echo "alias httperrclear='sudo sh -c "'"'"echo '' > /var/log/apache2/error.log"'"'"'" >> $HOME/.bash_profile
} else {
echo "alias httperr='sudo cat /etc/httpd/logs/error_log'" >> $HOME/.bash_profile
echo "alias httperrclear='sudo sh -c "'"'"echo '' > /etc/httpd/logs/error_log"'"'"'" >> $HOME/.bash_profile
}
fi
fi
}
fi
if [ -f $HOME/.hpdb ]; then {
if ( ! grep -Fxq "# Added by HPDB pipeline installation - Do not remove this file" $HOME/.hpdb )
then
echo "# Added by HPDB pipeline installation - Do not remove this file" >> $HOME/.hpdb
echo "export HPDB_BASE=$rootdir" >> $HOME/.hpdb
echo "export PATH=$rootdir/bin:$rootdir/thirdParty/Anaconda2/bin:\$PATH:" >> $HOME/.hpdb
echo "export PYTHONPATH=$rootdir/scripts:\$PYTHONPATH:" >> $HOME/.hpdb
fi
} else {
echo "# Added by HPDB pipeline installation - Do not remove this file" >> $HOME/.hpdb
echo "export HPDB_BASE=$rootdir" >> $HOME/.hpdb
echo "export PATH=$rootdir/bin:$rootdir/thirdParty/Anaconda2/bin:\$PATH:" >> $HOME/.hpdb
echo "export PYTHONPATH=$rootdir/scripts:\$PYTHONPATH:" >> $HOME/.hpdb
}
fi
(crontab -l ; echo "* * * * * bash $rootdir/make-run.sh") | crontab -
echo "All done! Run 'exec bash' to restart your terminal session."