-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.pl
More file actions
executable file
·200 lines (152 loc) · 4.62 KB
/
setup.pl
File metadata and controls
executable file
·200 lines (152 loc) · 4.62 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
#!/usr/bin/perl -w
use strict;
use warnings;
my $current_dir = `pwd`;
chomp($current_dir);
my $cho = $current_dir."/bin/uclust3.0.617";
my $us_version = "3.0.617";
################### check if pandaseq is installed
#my $panda = `which pandaseq` ;
#if ($panda eq "") {die "\n\tPandaseq is not found .... Installing PANAM interrupted\n\n"}
################## setting panam.pl
my $fast= $current_dir."/bin/./FastTree";
my $align = $current_dir."/bin/./hmmer-2.3.2/src/hmmalign";
my $build = $current_dir."/bin/./hmmer-2.3.2/src/hmmbuild";
my $modules = $current_dir."/modules";
my $rscripts = $current_dir."/R";
open (F, "$current_dir/.panam.txt") ;
my $text1;
while (<F>) {
$text1 .=$_
}
close F;
$text1 =~ s/USEARCH_PATH/$cho/g;
$text1 =~ s/US_VERSION/$us_version/g;
$text1 =~ s/FASTTREE_PATH/$fast/g;
$text1 =~ s/HMMALIGN_PATH/$align/g;
$text1 =~ s/HMMBUILD_PATH/$build/g;
open (FILE, ">$current_dir/panam.pl");
print FILE $text1;
close FILE;
###################" setting preprocess.pl
open (P, "$current_dir/.preprocess.txt") ;
my $text2;
while (<P>) {
$text2 .= $_
}
close P;
$text2 =~ s/USEARCH_PATH/$cho/g;
$text2 =~ s/MODULES_PATH/$modules/g ;
open (F2, ">$current_dir/preprocess.pl");
print F2 $text2;
close F2;
###################" setting check_chimeras.pm
open (M, "$modules/.check_chimeras.txt") ;
my $text3;
while (<M>) {
$text3 .= $_
}
close M;
$text3 =~ s/USEARCH_PATH/$cho/g;
open (F3, ">$modules/check_chimeras.pm") ;
print F3 $text3;
close F3;
###################" setting quality.pl
my $fuzz = $current_dir."/bin/EMBOSS-6.5.7/emboss/./fuzznuc";
open (Q, "$current_dir/.quality.txt") ;
my $text4;
while (<Q>) {
$text4 .= $_
}
close Q;
$text4 =~ s/MODULES_PATH/$modules/g ;
$text4 =~ s/FUZZNUC_PATH/$fuzz/g ;
open (F4, ">$current_dir/quality.pl");
print F4 $text4;
close F4;
###################" setting postprocess.pl
open (PP, "$current_dir/.postprocess.txt") ;
my $text5;
while (<PP>) {
$text5 .= $_
}
close PP;
$text5 =~ s/RSCRIPTS/$rscripts/g ;
open (F5, ">$current_dir/postprocess.pl");
print F5 $text5;
close F5;
###################" setting phylodiv.pl
open (PH, "$current_dir/.phylodiv.txt") ;
my $text6;
while (<PH>) {
$text6 .= $_
}
close PH;
$text6 =~ s/RSCRIPTS/$rscripts/g ;
$text6 =~ s/MODULES_PATH/$modules/g ;
$text6 =~ s/TEXT-CSV_PATH/$current_dir\/bin\/Text-CSV_XS-1.04/g ;
open (F6, ">$current_dir/phylodiv.pl");
print F6 $text6;
close F6;
#######################################################""
print "\n\n\tCompiling Bioperl...\n\t******* For non experimented users, we recommand to use the default setting while installing bioperl *******\n";
print "\t******* If the archive Bioperl-1.5.2_102.zip already exists, you may chose to replace it or not [A/N] *******\n";
print "\t******* After just press enter when a choice is to be made *******\n\tContinue? [y/n]\n" ;
my $rep = <STDIN>; chomp ($rep);
if (($rep ne "y") and ($rep ne "n")) {
print "\n\n\tWrong answer\n\tPlease enter y or n\n\t";
$rep = <STDIN>;
chomp ($rep)
}
if ($rep eq "n") {die "\n\tInstalling PANAM interrupted\n\n"}
else {
compile_bioperl();
}
compile_fasttree();
unless (-x "FastTree") {die "\tFastTree has not been compiled $!\n" ; }
compile_hmmer();
unless ((-x "hmmer-2.3.2/src/hmmalign") and (-x "hmmer-2.3.2/src/hmmbuild")) {die "\tHMMER has not been compiled $!\n" ; }
unless (-e "bioperl-1.5.2_102/Bio/TreeIO.pm") { die "\tModule TreeIO does not exist $!\n"; }
install_text() ;
compile_emboss() ;
unless (-x "EMBOSS-6.5.7/emboss/./fuzznuc") {die "\tFuzznuc has not been found $!\n" ; }
sub compile_bioperl {
chdir "bin";
system ("unzip bioperl-1.5.2_102.zip");
chdir "bioperl-1.5.2_102" ;
system ("perl Build.PL --install_base ../");
system ("./Build test");
system ("./Build install");
chdir ("../");
}
sub compile_fasttree {
print "\nCompiling FastTree ...\n";
system ("gcc FastTree.c -DNO_SSE -lm -O3 -finline-functions -funroll-loops -Wall -o FastTree");
}
sub compile_hmmer {
print "\nCompiling hmmer ...\n";
system ("tar -xvzf hmmer-2.3.2.tar.gz");
chdir ("hmmer-2.3.2");
system ("./configure");
system ("make");
chdir ("../");
}
sub install_text {
print "\nInstalling text-csv module ...\n";
system ("tar -xvzf Text-CSV_XS-1.04.tgz");
chdir ("Text-CSV_XS-1.04");
system ("perl Makefile.PL PREFIX=$current_dir/bin/Text-CSV_XS-1.04");
system ("make test");
system ("make install");
chdir ("../");
}
sub compile_emboss {
print "\nInstalling fuzznuc ...\n";
system ("tar -xvzf EMBOSS-6.5.7.tar.gz");
chdir ("EMBOSS-6.5.7");
system ("./configure --prefix=$current_dir/bin/EMBOSS-6.5.7 --without-x");
system ("make");
chdir ("../");
}
###############################""
print "\n\n\tPANAM had been successfully installed.\n\n";