forked from LANL-Bioinformatics/PhaME
-
Notifications
You must be signed in to change notification settings - Fork 1
/
INSTALL.sh
executable file
·982 lines (912 loc) · 36.2 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
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
#!/usr/bin/env bash
set -e # Exit as soon as any line in the bash script fails
ROOTDIR=$( cd $(dirname $0) ; pwd -P ) # path to main PhaME directory
echo
exec &> >(tee -a install.log)
exec 2>&1 # copies stderr onto stdout
# create a directory where all dependencies will be installed
cd $ROOTDIR
mkdir -p thirdParty
cd thirdParty
mkdir -p $ROOTDIR/bin
export PATH="$ROOTDIR/bin/":"$ROOTDIR/thirdParty/miniconda/bin/":$PATH
# Minimum Required versions of dependencies
# nucmer 3.1 is packaged in mummer 3.23
bowtie2_VER=2.3.0
bwa_VER=0.7.15
cmake_VER=3.0.1
cpanm_VER=1.7039
FastTree_VER=2.1.9
mafft_VER=7.305
miniconda_VER=4.4.11
mummer_VER=3.23
muscle_VER=3.8.31
paml_VER=4.9
R_VER=3.3.1
RAxML_VER=8.2.10
samtools_VER=1.3.1
perl5_VER=5.26.2
bcftools_VER=1.6
hyphy_VER=2.3.11
bbmap_VER=37.62
#minimum required version of Perl modules
perl_File_Basename_VER=2.85
perl_File_Path_VER=2.09
perl_Getopt_Long_VER=2.45
perl_IO_Handle_VER=1.28
perl_Parllel_ForkManager_VER=1.17
# perl_Time_BaseName=2.85
perl_Time_HiRes=1.9726
perl_Statistics_Distributions_VER=1.02
perl_Test_Exception_VER=0.43
perl_Time_HiRes_VER=1.9758
perl_File_Copy_VER=2.21
################################################################################
done_message () {
if [ $? == 0 ]; then
if [ "x$1" != "x" ]; then
echo $1;
else
echo "done.";
fi
else
echo "Installation failed." $2
exit 1;
fi
}
################################################################################
install_miniconda()
{
echo "--------------------------------------------------------------------------
downloading miniconda
--------------------------------------------------------------------------------
"
if [[ "$OSTYPE" == "darwin"* ]]
then
{
curl -o miniconda.sh https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh
chmod +x miniconda.sh
./miniconda.sh -b -p $ROOTDIR/thirdParty/miniconda -f
conda update --yes -n base conda
ln -sf $ROOTDIR/thirdParty/miniconda/bin/conda $ROOTDIR/bin/conda
ln -sf $ROOTDIR/thirdParty/miniconda/bin/pip $ROOTDIR/bin/pip
}
else
{
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh
chmod +x miniconda.sh
./miniconda.sh -b -p $ROOTDIR/thirdParty/miniconda -f
conda update --yes -n base conda
ln -sf $ROOTDIR/thirdParty/miniconda/bin/conda $ROOTDIR/bin/conda
ln -sf $ROOTDIR/thirdParty/miniconda/bin/pip $ROOTDIR/bin/pip
}
fi
}
################################################################################
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/thirdParty/miniconda/bin; do
if test -x "$d/$1"; then return 0; fi
done
return 1
}
checkHyPhyInstallation()
{
IFS=:
for d in $ROOTDIR/bin; do
if test -x "$d/$1"; then return 0; fi
done
return 1
}
checkPerlModule()
{
perl -e "use lib \"$ROOTDIR/lib\"; use $1;"
return $?
}
# ################################################################################
# install_cpan()
# {
# echo "--------------------------------------------------------------------------
# installing cpanm v2.00
# --------------------------------------------------------------------------------
# "
# conda install --yes c dan_blanchard perl-cpan=2.00 -p $ROOTDIR/thirdParty/miniconda
# ln -sf $ROOTDIR/thirdParty/miniconda/bin/cpan $ROOTDIR/bin/cpan
# echo "--------------------------------------------------------------------------
# installed cpanm v2.00
# --------------------------------------------------------------------------------
# "
# }
# ################################################################################
# install_cpanm()
# {
# echo "--------------------------------------------------------------------------
# installing cpanm v1.7039
# --------------------------------------------------------------------------------
# "
# conda install --yes -c bioconda perl-app-cpanminus=$cpanm_VER -p $ROOTDIR/thirdParty/miniconda
# ln -sf $ROOTDIR/thirdParty/miniconda/bin/cpanm $ROOTDIR/bin/cpanm
# echo "--------------------------------------------------------------------------
# cpanm v1.7039 installed
# --------------------------------------------------------------------------------
# "
# }
# install_mummer()
# {
# echo "--------------------------------------------------------------------------
# installing mummer v3.23 or nucmer 3.21
# --------------------------------------------------------------------------------
# "
# conda install --yes -c bioconda mummer=$mummer_VER -p $ROOTDIR/thirdParty/miniconda
# ln -sf $ROOTDIR/thirdParty/miniconda/opt/mummer-$mummer_VER/nucmer $ROOTDIR/bin/nucmer
# ln -sf $ROOTDIR/thirdParty/miniconda/bin/mummer $ROOTDIR/bin/mummer
# ln -sf $ROOTDIR/thirdParty/miniconda/bin/delta-filter $ROOTDIR/bin/delta-filter
# ln -sf $ROOTDIR/thirdParty/miniconda/bin/show-snps $ROOTDIR/bin/show-snps
# ln -sf $ROOTDIR/thirdParty/miniconda/bin/show-coords $ROOTDIR/bin/show-coords
# # conda install --yes -c bioconda mummer=$mummer_VER -p $ROOTDIR/thirdParty/miniconda
# echo "
# ------------------------------------------------------------------------------
# mummer v3.23 installed or nucmer 3.21
# ------------------------------------------------------------------------------
# "
# }
# install_bbmap()
# {
# echo "--------------------------------------------------------------------------
# installing bbmap v37.62
# --------------------------------------------------------------------------------
# "
# conda install --yes -c bioconda bbmap -p $ROOTDIR/thirdParty/miniconda
# ln -sf $ROOTDIR/thirdParty/miniconda/bin/bbmap.sh $ROOTDIR/bin/bbmap.sh
# ln -sf $ROOTDIR/thirdParty/miniconda/bin/sketch.sh $ROOTDIR/bin/sketch.sh
# ln -sf $ROOTDIR/thirdParty/miniconda/bin/comparesketch.sh $ROOTDIR/bin/comparesketch.sh
# echo "
# ------------------------------------------------------------------------------
# mummer v37.62
# ------------------------------------------------------------------------------
# "
# }
# install_cmake()
# {
# echo "--------------------------------------------------------------------------
# installing cmake v3.0.1
# --------------------------------------------------------------------------------
# "
# conda install --yes -c anaconda cmake=$cmake_VER -p $ROOTDIR/thirdParty/miniconda
# ln -sf $ROOTDIR/thirdParty/miniconda/bin/cmake $ROOTDIR/bin/cmake
# echo "
# ------------------------------------------------------------------------------
# cmake v3.0.1 installed
# ------------------------------------------------------------------------------
# "
# }
# install_bwa()
# {
# echo "------------------------------------------------------------------------------
# Downloading bwa v0.7.15
# ------------------------------------------------------------------------------
# "
# conda install --yes -c bioconda bwa=$bwa_VER -p $ROOTDIR/thirdParty/miniconda
# ln -sf $ROOTDIR/thirdParty/miniconda/bin/bwa $ROOTDIR/bin/bwa
# echo "
# ------------------------------------------------------------------------------
# bwa v0.7.15 installed
# ------------------------------------------------------------------------------
# "
# }
# install_bowtie2()
# {
# echo "--------------------------------------------------------------------------
# installing bowtie2 v2.3.0
# --------------------------------------------------------------------------------
# "
# conda install --yes -c bioconda bowtie2=$bowtie2_VER -p $ROOTDIR/thirdParty/miniconda
# ln -sf $ROOTDIR/thirdParty/miniconda/bin/bowtie2 $ROOTDIR/bin/bowtie2
# echo "
# ------------------------------------------------------------------------------
# bowtie2 v2.3.0 installed
# ------------------------------------------------------------------------------
# "
# }
# install_samtools()
# {
# echo "--------------------------------------------------------------------------
# Downloading samtools v1.3.1
# --------------------------------------------------------------------------------
# "
# conda install --yes -c bioconda samtools=$samtools_VER -p $ROOTDIR/thirdParty/miniconda
# ln -sf $ROOTDIR/thirdParty/miniconda/bin/samtools $ROOTDIR/bin/samtools
# echo "
# --------------------------------------------------------------------------------
# samtools v1.3.1 installed
# --------------------------------------------------------------------------------
# "
# }
# install_FastTree()
# {
# echo "--------------------------------------------------------------------------
# Downloading FastTree v2.1.9
# --------------------------------------------------------------------------------
# "
# conda install --yes -c bioconda FastTree=$FastTree_VER -p $ROOTDIR/thirdParty/miniconda
# ln -sf $ROOTDIR/thirdParty/miniconda/bin/FastTree $ROOTDIR/bin/FastTree
# ln -sf $ROOTDIR/thirdParty/miniconda/bin/FastTreeMP $ROOTDIR/bin/FastTreeMP
# echo "
# --------------------------------------------------------------------------------
# FastTree v2.1.9
# --------------------------------------------------------------------------------
# "
# }
# install_RAxML()
# {
# echo "--------------------------------------------------------------------------
# Downloading RAxML v$RAxML_VER
# --------------------------------------------------------------------------------
# "
# conda install --yes -c bioconda RAxML=$RAxML_VER -p $ROOTDIR/thirdParty/miniconda
# ln -sf $ROOTDIR/thirdParty/miniconda/bin/raxmlHPC $ROOTDIR/bin/raxmlHPC
# ln -sf $ROOTDIR/thirdParty/miniconda/bin/raxmlHPC $ROOTDIR/bin/raxmlHPC-PTHREADS
# echo "
# --------------------------------------------------------------------------------
# RAxML v$RAxML_VER
# --------------------------------------------------------------------------------
# "
# }
# install_muscle()
# {
# echo "--------------------------------------------------------------------------
# Downloading muscle v3.8.31
# --------------------------------------------------------------------------------
# "
# conda install --yes -c bioconda muscle=$muscle_VER -p $ROOTDIR/thirdParty/miniconda
# ln -sf $ROOTDIR/thirdParty/miniconda/bin/muscle $ROOTDIR/bin/muscle
# echo "
# --------------------------------------------------------------------------------
# muscle v3.8.31
# --------------------------------------------------------------------------------
# "
# }
# install_mafft()
# {
# echo "--------------------------------------------------------------------------
# Downloading mafft v7.305
# --------------------------------------------------------------------------------
# "
# conda install --yes -c bioconda mafft=$mafft_VER -p $ROOTDIR/thirdParty/miniconda
# ln -sf $ROOTDIR/thirdParty/miniconda/bin/mafft $ROOTDIR/bin/mafft
# echo "
# --------------------------------------------------------------------------------
# mafft v7.305
# --------------------------------------------------------------------------------
# "
# }
# install_paml()
# {
# echo "--------------------------------------------------------------------------
# Downloading paml v4.9
# --------------------------------------------------------------------------------
# "
# conda install --yes -c bioconda paml=$paml_VER -p $ROOTDIR/thirdParty/miniconda
# echo "
# --------------------------------------------------------------------------------
# paml v4.9
# --------------------------------------------------------------------------------
# "
# }
# install_bcftools()
# {
# echo "--------------------------------------------------------------------------
# installing bcftools v$bcftools_VER
# --------------------------------------------------------------------------------
# "
# conda install --yes -c bioconda bcftools=$bcftools_VER -p $ROOTDIR/thirdParty/miniconda
# ln -sf $ROOTDIR/thirdParty/miniconda/bin/bcftools $ROOTDIR/bin/bcftools
# echo "--------------------------------------------------------------------------
# installed bcftools v$bcftools_VER
# --------------------------------------------------------------------------------
# "
# }
install_hyphy()
{
echo "--------------------------------------------------------------------------
installing hyphy v$hyphy_VER
--------------------------------------------------------------------------------
"
#curl -o thirdParty/hyphy-2.3.11.zip https://github.com/veg/hyphy/archive/2.3.11.zip
cd $ROOTDIR
unzip thirdParty/hyphy-2.3.11.zip -d thirdParty/;
gcc -v;
which gcc;
cd $ROOTDIR/thirdParty/hyphy-2.3.11;
cmake -DINSTALL_PREFIX=$ROOTDIR/thirdParty/hyphy-2.3.11
make MP
make install
make GTEST
cd $ROOTDIR
ln -sf $ROOTDIR/thirdParty/hyphy-2.3.11/HYPHYMP $ROOTDIR/bin/HYPHYMP
echo "--------------------------------------------------------------------------
installed hyphy v$hyphy_VER
--------------------------------------------------------------------------------
"
}
# install_perl_Getopt_Long()
# {
# echo "--------------------------------------------------------------------------
# installing Perl Module Getopt::Long v2.45
# --------------------------------------------------------------------------------
# "
# cpanm Getopt::Long@$perl_Getopt_Long_VER
# echo "
# --------------------------------------------------------------------------------
# Getopt::Long v2.45 installed
# --------------------------------------------------------------------------------
# "
# }
# install_perl_Test_Exception()
# {
# echo "--------------------------------------------------------------------------
# installing Perl Module Test::Exception v0.46
# --------------------------------------------------------------------------------
# "
# cpanm Test::Exception@$perl_Test_Exception_VER
# echo "
# --------------------------------------------------------------------------------
# Test::Exception v0.46 installed
# --------------------------------------------------------------------------------
# "
# }
# install_perl_Statistics_Distributions()
# {
# echo "--------------------------------------------------------------------------
# installing Perl Module Statistics::Distributions v1.02
# --------------------------------------------------------------------------------
# "
# cpanm Statistics::Distributions@$perl_Statistics_Distributions_VER
# echo "
# --------------------------------------------------------------------------------
# Statistics::Distributions v1.02 installed
# --------------------------------------------------------------------------------
# "
# }
# install_perl_Time_HiRes()
# {
# echo "--------------------------------------------------------------------------
# installing Perl Module Time::HiRes v1.9726
# --------------------------------------------------------------------------------
# "
# cpanm Time::HiRes@$perl_Time_HiRes_VER
# echo "
# --------------------------------------------------------------------------------
# Time::HiRes v1.9726 installed
# --------------------------------------------------------------------------------
# "
# }
# install_perl_File_Path()
# {
# echo "--------------------------------------------------------------------------
# installing Perl Module File::Path v2.09
# --------------------------------------------------------------------------------
# "
# cpanm File::Path@$perl_File_Path_VER
# echo "
# --------------------------------------------------------------------------------
# File::Path v2.09 installed
# --------------------------------------------------------------------------------
# "
# }
# install_perl_File_Basename()
# {
# echo "--------------------------------------------------------------------------
# installing Perl Module File::Basename v2.85
# --------------------------------------------------------------------------------
# "
# cpanm File::Basename@$perl_File_Basename_VER
# echo "
# --------------------------------------------------------------------------------
# File::Basename Resinstalled v2.85
# --------------------------------------------------------------------------------
# "
# }
# install_perl_File_Copy()
# {
# echo "--------------------------------------------------------------------------
# installing Perl Module File::Copy v2.30
# --------------------------------------------------------------------------------
# "
# cpanm File::Copy@$perl_File_Copy_VER
# echo "
# --------------------------------------------------------------------------------
# File::Copy v2.30 installed
# --------------------------------------------------------------------------------
# "
# }
# install_perl_IO_Handle()
# {
# echo "--------------------------------------------------------------------------
# installing Perl Module IO::Handle v1.35
# --------------------------------------------------------------------------------
# "
# cpanm IO::Handle@$perl_IO_Handle_VER
# echo "
# --------------------------------------------------------------------------------
# IO::Handle v1.35 installed
# --------------------------------------------------------------------------------
# "
# }
# install_perl_Parallel_ForkManager()
# {
# echo "--------------------------------------------------------------------------
# installing Perl Module Parallel::ForkManager v1.17
# --------------------------------------------------------------------------------
# "
# cpanm Parallel::ForkManager@$perl_Parllel_ForkManager_VER -l $ROOTDIR/ext
# cpanm Bio::SeqIO -l $ROOTDIR/ext
# echo "
# --------------------------------------------------------------------------------
# Parallel::ForkManager v1.17 installed
# --------------------------------------------------------------------------------
# "
# }
################################################################################
if ( checkSystemInstallation conda )
then
conda_installed_VER=`conda --version 2>&1 | perl -nle 'print $& if m{conda \d+\.\d+\.\d+}'`;
if ( echo $conda_installed_VER $miniconda_VER | awk '{if($2>=$3) exit 0; else exit 1}' )
then
echo " - found conda $conda_installed_VER"
if [ -d "$ROOTDIR/thirdParty/miniconda" ]; then
echo "conda is pointed to right environment"
echo "creating phame environment"
conda create --name phame --yes
source activate phame
else
echo "Creating a separate conda enviroment ..."
conda create --name phame --yes
source activate phame
fi
else
echo "Required version of conda ($miniconda_VER) was not found"
install_miniconda
conda create --name phame --yes
source activate phame
fi
else
echo "conda was not found"
install_miniconda
conda create --name phame --yes
source activate phame
fi
################################################################################
conda install --yes -n phame -c anaconda perl=$perl5_VER
conda install --yes -n phame -c bioconda perl-app-cpanminus=$cpanm_VER
conda install --yes -n phame -c bioconda mummer=$mummer_VER
conda install --yes -n phame -c bioconda bbmap
conda install --yes -n phame -c anaconda cmake=$cmake_VER
conda install --yes -n phame -c bioconda bwa=$bwa_VER
conda install --yes -n phame -c bioconda bowtie2=$bowtie2_VER
conda install --yes -n phame -c bioconda samtools=$samtools_VER
conda install --yes -n phame -c bioconda FastTree=$FastTree_VER
conda install --yes -n phame -c bioconda RAxML=$RAxML_VER
conda install --yes -n phame -c bioconda muscle=$muscle_VER
conda install --yes -n phame -c bioconda mafft=$mafft_VER
conda install --yes -n phame -c bioconda paml=$paml_VER
conda install --yes -n phame -c bioconda bcftools=$bcftools_VER
cpanm Getopt::Long@$perl_Getopt_Long_VER
cpanm Test::Exception@$perl_Test_Exception_VER
cpanm Statistics::Distributions@$perl_Statistics_Distributions_VER
cpanm Time::HiRes@$perl_Time_HiRes_VER
cpanm File::Path@$perl_File_Path_VER
cpanm File::Basename@$perl_File_Basename_VER
cpanm File::Copy@$perl_File_Copy_VER
# cpanm IO::Handle@$perl_IO_Handle_VER
cpanm Parallel::ForkManager@$perl_Parllel_ForkManager_VER -l $ROOTDIR/ext
cpanm Bio::SeqIO --force
################################################################################
if ( checkHyPhyInstallation HYPHYMP )
then
hyphy_installed_VER=`thirdParty/hyphy-2.3.11/HYPHYMP -v 2>&1 | grep 'HYPHY' | perl -nle 'print $& if m{HYPHY \d+\.\d+.\d\d}'`;
if ( echo $hyphy_installed_VER $hyphy_VER | awk '{if($2>=$3) exit 0; else exit 1}' )
then
echo " - found HyPhy $hyphy_installed_VER"
else
echo "Required version of HyPhy $hyphy_VER was not found"
install_hyphy
fi
else
echo "HyPhy was not found"
install_hyphy
fi
# if ( checkSystemInstallation perl )
# then
# perl_installed_VER=`perl -v 2>&1| grep 'version' | perl -nle 'print $& if m{\d+\.\d+\.\d+}'`;
# if ( echo $perl_installed_VER $perl_VER | awk '{if($1>=$2) exit 0; else exit 1}' )
# then
# echo " - found perl $perl_installed_VER"
# else
# echo "Required version of perl $perl_VER was not found"
# install_perl
# fi
# else
# echo "perl was not found"
# install_perl
# fi
# ################################################################################
# if ( checkSystemInstallation cpan )
# then
# echo " - found cpan"
# else
# echo "cpan was found"
# install_cpan
# fi
# ################################################################################
# if ( checkSystemInstallation cpanm )
# then
# cpanm_installed_VER=`cpanm -V 2>&1| head -n 1 | grep 'version' | perl -nle 'print $& if m{version \d+\.\d+}'`;
# if ( echo $cpanm_installed_VER $cpanm_VER | awk '{if($2>=$3) exit 0; else exit 1}' )
# then
# echo " - found cpanm $cpanm_installed_VER"
# else
# echo "Required version of cpanm was not found"
# install_cpanm
# fi
# else
# echo "cpanm was not found"
# install_cpanm
# fi
# ################################################################################
# if ( checkSystemInstallation cmake )
# then
# cmake_installed_VER=`cmake -V 2>&1| head -n 1 | grep 'version' | perl -nle 'print $& if m{version \d+\.\d+}'`;
# if ( echo $cmake_installed_VER $cmake_VER | awk '{if($2>=$3) exit 0; else exit 1}' )
# then
# echo " - found cmake $cmake_installed_VER"
# else
# echo "Required version of cmake was not found"
# install_cmake
# fi
# else
# echo "cmake was not found"
# install_cmake
# fi
# ################################################################################
# if ( checkSystemInstallation bbmap.sh )
# then
# bbmap_installed_VER=`bbmap.sh -v 2>&1| grep 'version' | perl -nle 'print $& if m{version \d+\.\d+}'`;
# if ( echo $bbmap_installed_VER $bbmap_VER | awk '{if($2>=$3) exit 0; else exit 1}' )
# then
# echo " - found bbmap $bbmap_installed_VER"
# else
# echo "Required version of bbmap was not found"
# install_bbmap
# fi
# else
# echo "bbmap was not found"
# install_bbmap
# fi
# ################################################################################
# if ( checkSystemInstallation nucmer )
# then
# mummer_installed_VER=`nucmer -v 2>&1| grep 'version' | perl -nle 'print $& if m{version \d+\.\d+}'`;
# if ( echo $mummer_installed_VER $mummer_VER | awk '{if($2>=$3) exit 0; else exit 1}' )
# then
# echo " - found nucmer $mummer_installed_VER"
# else
# echo "Required version of nucmer was not found"
# install_mummer
# fi
# else
# echo "nucmer was not found"
# install_mummer
# fi
# ################################################################################
# if ( checkSystemInstallation bwa )
# then
# bwa_installed_VER=`bwa 2>&1| grep 'Version' | perl -nle 'print $& if m{Version: \d+\.\d+\.\d+}'`;
# if ( echo $bwa_installed_VER $bwa_VER | awk '{if($2>=$3) exit 0; else exit 1}' )
# then
# echo " - found BWA $bwa_installed_VER"
# else
# install_bwa
# fi
# else
# echo "bwa is not found"
# install_bwa
# fi
# ################################################################################
# if ( checkSystemInstallation bowtie2 )
# then
# bowtie2_installed_VER=`bowtie2 --version 2>&1 | grep -v 'Compiler' |grep 'version' | perl -nle 'print $& if m{version \d+\.\d+\.\d+}'`;
# if (echo $bowtie2_installed_VER $bowtie2_VER | awk '{if($2>=$3) exit 0; else exit 1}' )
# then
# echo " - found bowtie2 $bowtie2_installed_VER"
# else
# echo "Required version of bowtie2 $bowtie2_VER was not found"
# install_bowtie2
# fi
# else
# echo "bowtie2 is not found"
# install_bowtie2
# fi
# ################################################################################
# if ( checkSystemInstallation samtools )
# then
# samtools_installed_VER=`samtools 2>&1| grep 'Version'|perl -nle 'print $& if m{Version: \d+\.\d+.\d+}'`;
# if ( echo $samtools_installed_VER $samtools_VER| awk '{if($2>=$3) exit 0; else exit 1}' )
# then
# echo " - found samtools $samtools_installed_VER"
# else
# echo "Required version of samtools $samtools_VER was not found"
# install_samtools
# fi
# else
# install_samtools
# fi
# ################################################################################
# if ( checkSystemInstallation FastTree )
# then
# FastTree_installed_VER=`FastTree 2>&1| grep 'version'|perl -nle 'print $& if m{version \d+\.\d+.\d+}'`;
# if ( echo $FastTree_installed_VER $FastTree_VER | awk '{if($2>=$3) exit 0; else exit 1}' )
# then
# echo " - found FastTree $FastTree_VER"
# else
# echo "Required version of $FastTree_VER was not found"
# install_FastTree
# fi
# else
# echo "FastTree was not found"
# install_FastTree
# fi
# ################################################################################
# if ( checkSystemInstallation raxmlHPC )
# then
# RAxMLHPC_installed_VER=`raxmlHPC-PTHREADS -version 2>&1 | grep 'version' | perl -nle 'print $& if m{version \d+\.\d+\.\d+}'`
# if ( echo $RAxMLHPC_installed_VER $RAxML_VER | awk '{if($2>=$3) exit 0; else exit 1}' )
# then
# echo " - found RAxML $RAxMLHPC_installed_VER"
# else
# echo "Required version of $RAxML_VER was not found"
# install_RAxML
# fi
# else
# echo "RAxML was not found"
# install_RAxML
# fi
# ################################################################################
# if ( checkSystemInstallation muscle )
# then
# muscle_installed_VER=`muscle -version 2>&1 | grep 'v' | perl -nle 'print $& if m{v\d+\.\d+\.\d+}'`;
# if ( echo $muscle_installed_VER $muscle_VER | awk '{if($2>=$3) exit 0; else exit 1}' )
# then
# echo " - found muscle $muscle_installed_VER"
# else
# echo "Required version of $muscle_VER was not found"
# install_muscle
# fi
# else
# echo "muscle was not found"
# install_muscle
# fi
# ################################################################################
# if ( checkSystemInstallation mafft )
# then
# mafft_installed_VER=`mafft --version 2>&1 | grep 'v' | perl -nle 'print $& if m{v\d+\.\d+}'`;
# if ( echo $mafft_installed_VER $mafft_VER | awk '{if($2>=$3) exit 0; else exit 1}' )
# then
# echo " - found mafft $mafft_installed_VER"
# else
# echo "Required version of mafft $mafft_VER was not found"
# install_mafft
# fi
# else
# echo "mafft was not found"
# install_mafft
# fi
# ################################################################################
# if ( checkSystemInstallation bcftools )
# then
# bcftools_installed_VER=`bcftools -v 2>&1| grep 'bcftools' | perl -nle 'print $& if m{\d+\.\d+}'`;
# if ( echo $bcftools_installed_VER $bcftools_VER | awk '{if($2>=$3) exit 0; else exit 1}' )
# then
# echo " - found bcftools $bcftools_installed_VER"
# else
# echo "Required version of bcftools was not found"
# install_bcftools
# fi
# else
# echo "bcftools was not found"
# install_bcftools
# fi
# ################################################################################
# if ( checkSystemInstallation codeml )
# then
# paml_installed_VER=`evolver \0 2>&1 | grep 'version' | perl -nle 'print $& if m{version \d+\.\d+}'`;
# if ( echo $paml_installed_VER $paml_VER | awk '{if($2>=$3) exit 0; else exit 1}' )
# then
# echo " - found paml $paml_installed_VER"
# else
# echo "Required version of paml $paml_VER was not found"
# install_paml
# fi
# else
# echo "paml is not found"
# install_paml
# fi
# ################################################################################
# if ( checkHyPhyInstallation HYPHYMP )
# then
# hyphy_installed_VER=`thirdParty/hyphy-2.3.11/HYPHYMP -v 2>&1 | grep 'HYPHY' | perl -nle 'print $& if m{HYPHY \d+\.\d+.\d\d}'`;
# if ( echo $hyphy_installed_VER $hyphy_VER | awk '{if($2>=$3) exit 0; else exit 1}' )
# then
# echo " - found HyPhy $hyphy_installed_VER"
# else
# echo "Required version of HyPhy $hyphy_VER was not found"
# install_hyphy
# fi
# else
# echo "HyPhy was not found"
# install_hyphy
# fi
# ################################################################################
# # Perl modules
# ################################################################################
# if ( checkPerlModule Getopt::Long )
# then
# echo " - found Perl module Getopt::Long"
# perl_Getopt_Long_installed_VER=`perl -MGetopt::Long -e 'print $Getopt::Long::VERSION ."\n";'`
# if ( echo $perl_Getopt_Long_installed_VER $perl_Getopt_Long_VER | awk '{if($2>=$3) exit 0; else exit 1}')
# then
# echo " - found Perl module Getopt::Long $perl_Getopt_Long_installed_VER"
# else
# echo "Required version of Getopt::Long $perl_Getopt_Long_VER was not found"
# install_perl_Getopt_Long
# fi
# else
# echo "Perl Getopt::Long was not found"
# install_perl_Getopt_Long
# fi
# #------------------------------------------------------------------------------#
# if ( checkPerlModule Time::HiRes )
# then
# perl_Time_HiRes_installed_VER=`perl -MTime::HiRes -e 'print $Time::HiRes::VERSION ."\n";'`
# if ( echo $perl_Time_HiRes_installed_VER $perl_Time_HiReS_VER | awk '{if($2>=$3) exit 0; else exit 1}')
# then
# echo " - found Perl module Time::HiRes $perl_Time_HiRes_installed_VER"
# else
# echo "Required version of Time::HiRes $perl_Time_HiRes_VER was not found"
# install_perl_Time_HiRes
# fi
# else
# echo "Perl Time::HiRes was not found"
# install_perl_Time_HiRes
# fi
# #------------------------------------------------------------------------------#
# if ( checkPerlModule File::Path )
# then
# perl_File_Path_installed_VER=`perl -MFile::Path -e 'print $File::Path::VERSION ."\n";'`
# if ( echo $perl_File_Path_installed_VER $perl_File_Path_VER | awk '{if($2>=$3) exit 0; else exit 1}')
# then
# echo " - found Perl module File::Path $perl_File_Path_installed_VER"
# else
# echo "Required version of File::Path $perl_File_Path_VER was not found"
# install_perl_File_Path
# fi
# else
# echo "Perl File::Path is not found"
# install_perl_File_Path
# fi
# #------------------------------------------------------------------------------#
# if ( checkPerlModule File::Basename )
# then
# perl_File_BaseName_installed_VER=`perl -MFile::Basename -e 'print $File::Basename::VERSION ."\n";'`
# if ( echo $perl_File_BaseName_installed_VER $perl_File_BaseName_VER | awk '{if($2>=$3) exit 0; else exit 1}')
# then
# echo " - found Perl module File::BaseName $perl_File_BaseName_installed_VER"
# else
# echo "Required version of File::BaseName $perl_File_BaseName_VER was not found"
# install_perl_File_BaseName
# fi
# else
# echo "Perl File::Basename is not found"
# install_perl_File_Basename
# fi
# #------------------------------------------------------------------------------#
# if ( checkPerlModule File::Copy )
# then
# perl_File_Copy_installed_VER=`perl -MFile::Copy -e 'print $File::Copy::VERSION ."\n";'`
# if ( echo $perl_File_Copy_installed_VER $perl_File_Copy_VER | awk '{if($2>=$3) exit 0; else exit 1}')
# then
# echo " - found Perl module File::Copy $perl_File_Copy_installed_VER"
# else
# echo "Required version of File::Copy $perl_File_Copy_VER was not found"
# install_perl_File_Copy
# fi
# else
# echo "Perl File::Copy is not found"
# install_perl_File_Copy
# fi
# #------------------------------------------------------------------------------#
# # if ( checkPerlModule IO::Handle )
# # then
# # #perl -MIO::Handle -e 'print $IO::Handle::VERSION ."\n";'
# # perl_IO_Handle_installed_VER=`perl -MIO::Handle -e 'print $IO::Handle::VERSION ."\n";'`
# # if ( echo $perl_IO_Handle_installed_VER $perl_IO_Handle_VER | awk '{if($2>=$3) exit 0; else exit 1}')
# # then
# # echo " - found Perl module IO::Handle $perl_IO_Handle_installed_VER"
# # else
# # echo "Required version of IO::Handle $perl_IO_Handle_VER was not found"
# # install_perl_IO_Handle
# # fi
# # else
# # echo "Perl IO::Handle is not found"
# # install_perl_IO_Handle
# # fi
# #------------------------------------------------------------------------------#
# if ( checkPerlModule Test::Exception )
# then
# #perl -MTest::Exception -e 'print $Test::Exception::VERSION ."\n";'
# perl_Test_Exception_installed_VER=`perl -MTest::Exception -e 'print $Test::Exception::VERSION ."\n";'`
# if ( echo $perl_Test_Exception_installed_VER $perl_Test_Exception_VER | awk '{if($2>=$3) exit 0; else exit 1}')
# then
# echo " - found Perl module Test::Exception $perl_Test_Exception_installed_VER"
# else
# echo "Required version of Test::Exception $perl_Test_Exception_VER was not found"
# install_perl_Test_Exception
# fi
# else
# echo "Perl Test::Exception is not found"
# install_perl_Test_Exception
# fi
# #------------------------------------------------------------------------------#
# # if ( checkPerlModule Parallel::ForkManager )
# # then
# # perl_Parallel_ForkManager_installed_VER=`perl -MParallel::ForkManager -e 'print $Parallel::ForkManager::VERSION ."\n";'`
# # if ( echo $perl_Parallel_ForkManager_installed_VER $perl_Parallel_ForkManager_VER | awk '{if($1>=$2) exit 0; else exit 1}')
# # then
# # echo " - found Perl module Parallel::ForkManager $perl_Parallel_ForkManager_installed_VER"
# # else
# # echo "Required version of Parallel::ForkManager $perl_Parallel_ForkManager_VER was not found"
# # install_perl_Parallel_ForkManager
# # fi
# # else
# # echo "Perl Parallel::ForkManager is not found"
# # install_perl_Parallel_ForkManager
# # fi
# #------------------------------------------------------------------------------#
# if ( checkPerlModule Statistics::Distributions )
# then
# perl_Statistics_Distributions_installed_VER=`cpan -D Statistics::Distributions 2>&1 | grep 'Installed' | perl -nle 'print $& if m{Installed: \d+\.\d+}'`
# if ( echo $perl_Statistics_Distributions_installed_VER $perl_Statistics_Distributions_VER | awk '{if($2>=$3) exit 0; else exit 1}')
# then
# echo " - found Perl module Statistics::Distributions $perl_Statistics_Distributions_installed_VER"
# else
# echo "Required version of Statistics::Distributions $perl_Statistics_Distributions_VER was not found"
# install_perl_Statistics_Distributions
# fi
# else
# echo "Perl Statistics::Distributions is not found"
# install_perl_Statistics_Distributions
# fi
################################################################################
################################################################################
echo "
================================================================================
PhaME installed successfully.
================================================================================
Check phame.ctl for the control file
Quick test:
cd PhaME-1
sh test/TestAll.sh
Please use the full path to specify the location of fasta file.
Read README.md for detail
Check our github site for update:
https://github.com/mshakya/PhaME-1
";