forked from galsang-git/maxbin2
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuildapp
More file actions
216 lines (201 loc) · 6.59 KB
/
Copy pathbuildapp
File metadata and controls
216 lines (201 loc) · 6.59 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
#!/usr/bin/perl -w
use strict;
use FindBin qw($Bin);
my $cmd;
my $i;
#my $URLBASE = "https://downloads.jbei.org/data/microbial_communities/MaxBin/getfile.php";
my $URLBASE = "http://downloads.sourceforge.net/project/maxbin-auxiliary";
my $TARGET = "$Bin/auxiliary";
my $setting_f = "$Bin/setting";
my $idba_f = "idba-1.1.1.tar.gz";
my $hmmer_f = "hmmer-3.1b1.tar.gz";
my $frag_f = "FragGeneScan1.30.tar.gz";
my $bowtie_f = "bowtie2-2.2.3-source.zip";
my $idba_dir = "idba-1.1.1";
my $hmmer_dir = "hmmer-3.1b1";
my $frag_dir = "FragGeneScan1.30";
my $bowtie_dir = "bowtie2-2.2.3";
if (-d $TARGET)
{
$cmd = "rm -rf $TARGET";
system($cmd);
}
mkdir($TARGET);
print "Downloading and building auxiliary software packages from mirror sites...\n";
=cut
chdir($TARGET);
print "Downloading and Building IDBA-UD...\n";
#$cmd = "wget $URLBASE/$idba_f -O $idba_f 1>/dev/null 2>/dev/null";
$cmd = "curl -L $URLBASE/$idba_f -k 1>$idba_f 2>/dev/null";
system($cmd);
if (!(-e $idba_f))
{
print "IDBA-UD was not downloaded successfully. Please make sure that wget works properly.\n";
exit;
}
$cmd = "tar -zxvf $idba_f 1>/dev/null 2>/dev/null";
system($cmd);
if (!(-d $idba_dir))
{
print "Cannot unzip IDBA-UD tar.gz file. Please make sure that [tar] works properly.\n";
exit;
}
chdir($idba_dir);
$cmd = "./configure 1>$Bin/autobuild.log.idba.configure.out 2>$Bin/autobuild.log.idba.configure.err";
system($cmd);
$cmd = "make 1>$Bin/autobuild.log.idba.make.out 2>$Bin/autobuild.log.idba.make.err";
system($cmd);
$cmd = "chmod 0755 bin/idba_ud";
system($cmd);
if (!(-e "bin/idba_ud"))
{
print "IDBA-UD was not built successfully.\n";
print "Error recorded in autobuild.log.idba.configure.out, autobuild.log.idba.configure.err,\n";
print " autobuild.idba.make.out, and autobuild.idba.make.err.\n";
print "Most likely error:\n==============\n";
$cmd = "head $Bin/autobuild.log.idba.configure.err -n 1";
system($cmd);
print "--- or ---\n";
$cmd = "head $Bin/autobuild.log.idba.make.err -n 1";
system($cmd);
print "==============\n";
printError();
exit;
}
$cmd = "rm -f $Bin/autobuild.log.idba.*";
system($cmd);
=cut
chdir($TARGET);
print "Downloading and Building HMMER3...\n";
#$cmd = "wget $URLBASE/$hmmer_f -O $hmmer_f 1>/dev/null 2>/dev/null";
$cmd = "curl -L $URLBASE/$hmmer_f -k 1>$hmmer_f 2>/dev/null";
system($cmd);
if (!(-e $hmmer_f))
{
print "HMMER3 was not downloaded successfully. Please make sure that wget works properly.\n";
exit;
}
$cmd = "tar -zxvf $hmmer_f 1>/dev/null 2>/dev/null";
system($cmd);
if (!(-d $hmmer_dir))
{
print "Cannot unzip HMMER3 tar.gz file. Please make sure that [tar] works properly.\n";
exit;
}
chdir($hmmer_dir);
$cmd = "./configure 1>$Bin/autobuild.log.hmmer.configure.out 2>autobuild.log.hmmer.configure.err";
system($cmd);
$cmd = "make 1>$Bin/autobuild.log.hmmer.make.out 2>$Bin/autobuild.log.hmmer.make.err";
system($cmd);
$cmd = "chmod 0755 src/hmmsearch";
system($cmd);
if (!(-e "src/hmmsearch"))
{
print "HMMER3 was not built successfully.\n";
print "Error recorded in autobuild.log.hmmer.configure.out, autobuild.log.hmmer.configure.err,\n";
print " autobuild.hmmer.make.out, and autobuild.hmmer.make.err.\n";
print "Most likely error:\n==============\n";
$cmd = "head $Bin/autobuild.log.hmmer.configure.err -n 1";
system($cmd);
print "--- or ---\n";
$cmd = "head $Bin/autobuild.log.hmmer.make.err -n 1";
system($cmd);
print "==============\n";
printError();
exit;
}
$cmd = "rm -f $Bin/autobuild.log.hmmer.*";
system($cmd);
chdir($TARGET);
print "Downloading and Building Bowtie2...\n";
#$cmd = "wget $URLBASE/$bowtie_f -O $bowtie_f 1>/dev/null 2>/dev/null";
$cmd = "curl -L $URLBASE/$bowtie_f -k 1>$bowtie_f 2>/dev/null";
system($cmd);
if (!(-e $bowtie_f))
{
print "Bowtie2 was not downloaded successfully. Please make sure that wget works properly.\n";
exit;
}
$cmd = "unzip $bowtie_f 1>/dev/null 2>/dev/null";
system($cmd);
if (!(-d $bowtie_dir))
{
print "Cannot unzip bowtie2 zip file. Please make sure that [unzip] works properly.\n";
exit;
}
chdir($bowtie_dir);
$cmd = "make 1>$Bin/autobuild.log.bowtie2.make.out 2>$Bin/autobuild.log.bowtie2.make.err";
system($cmd);
$cmd = "chmod 0755 bowtie2*";
system($cmd);
if (!(-e "bowtie2-align-s"))
{
print "Bowtie2 was not built successfully.\n";
print "Error recorded in autobuild.log.bowtie2.make.out and autobuild.log.bowtie2.make.err.\n";
print "Most likely error:\n==============\n";
$cmd = "head $Bin/autobuild.log.bowtie2.make.err -n 1";
system($cmd);
print "==============\n";
printError();
exit;
}
$cmd = "rm -f $Bin/autobuild.log.bowtie2.*";
system($cmd);
chdir($TARGET);
print "Downloading and Building FragGeneScan...\n";
#$cmd = "wget $URLBASE/$frag_f -O $frag_f 1>/dev/null 2>/dev/null";
$cmd = "curl -L $URLBASE/$frag_f -k 1>$frag_f 2>/dev/null";
system($cmd);
if (!(-e $frag_f))
{
print "FragGeneScan was not downloaded successfully. Please make sure that wget works properly.\n";
exit;
}
$cmd = "tar -zxvf $frag_f 1>/dev/null 2>/dev/null";
system($cmd);
if (!(-d $frag_dir))
{
print "Cannot unzip FragGeneScan tar.gz file. Please make sure that [tar] works properly.\n";
exit;
}
chdir($frag_dir);
$cmd = "make 1>$Bin/autobuild.log.fraggenescan.make.out 2>$Bin/autobuild.log.fraggenescan.make.err";
system($cmd);
$cmd = "make fgs 1>>$Bin/autobuild.log.fraggenescan.make.out 2>>$Bin/autobuild.log.fraggenescan.make.err";
system($cmd);
$cmd = "chmod 0755 run_FragGeneScan.pl";
system($cmd);
$cmd = "chmod 0755 FragGeneScan";
system($cmd);
$cmd = "chmod 0755 train";
system($cmd);
$cmd = "chmod 0755 train/*";
system($cmd);
if (!(-e "FragGeneScan"))
{
print "FragGeneScan was not built successfully. Out of disk space?\n";
print "Error recorded in autobuild.log.fraggenescan.make.out and autobuild.log.fraggenescan.make.err.\n";
print "Most likely error:\n==============\n";
$cmd = "head $Bin/autobuild.log.fraggenescan.make.err -n 1";
system($cmd);
print "==============\n";
printError();
exit;
}
$cmd = "rm -f $Bin/autobuild.log.fraggenescan.*";
system($cmd);
# Update setting file
open(FILE, ">$setting_f");
print FILE "[FragGeneScan] $TARGET/$frag_dir\n";
print FILE "[Bowtie2] $TARGET/$bowtie_dir\n";
print FILE "[HMMER3] $TARGET/$hmmer_dir\/src\n";
#print FILE "[IDBA_UD] $TARGET/$idba_dir\/bin\n";
close(FILE);
print "All required auxiliary software packages were downloaded and built successfully.\nYou can start using MaxBin now.\n";
sub printError
{
print "\n";
print "I am sorry. It looks like I cannot install the auxiliary software automatically for you.\n";
print "Please follow the instruction in README to install the auxiliary software packages and set paths in [setting] file.\n";
print "Feel free to contact me at ywwei\@lbl.gov if you have questions.\n";
}