-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathcheck_install.pl
executable file
·220 lines (176 loc) · 4.9 KB
/
check_install.pl
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
#!/usr/bin/env perl
# -----------------
# Alex Lomsadze
# 2023
#
# check GeneMark-ETP instalation
# ----------------
use strict;
use warnings;
print "### Checking ETP installation\n";
CheckPerlModules();
CheckGeneMark_hmm();
Check_p_GeneMark_hmm();
CheckExe();
CheckPython3();
CheckThirdParty();
RunHmm();
RunWithProtHint();
print "### Checking ETP installation ... done\n\n";
# ----------------
sub RunWithProtHint
{
print "# Checking prediction with ProtHint\n";
my $path = "bin/gmes/GeneMark-E-tests/EP";
if ( -d $path )
{
mkdir "$path/test";
chdir "$path/test";
if ( -e "genemark.gtf" )
{
unlink "genemark.gtf";
}
system("../../../gmes_petap.pl --seq ../input/genome.fasta --EP --dbep ../input/proteins.fasta --cores=8 --max_intergenic 10000 --mask_penalty 0 > loginfo 2>&1 ");
if ( ! -e "genemark.gtf" )
{ die "error, EP run test failed\n"; }
system("../../../compare_intervals_exact.pl --f1 genemark.gtf --f2 ../output/genemark.gtf --v" );
}
else
{ print "warning, EP test folder is missing: $path\n"; }
print "# Checking prediction with ProtHint ... done\n";
}
# ----------------
sub RunHmm
{
print "# Checking prediction by hmm\n";
my $path = "bin/gmes/GeneMark-E-tests/GeneMark.hmm";
if ( -d $path )
{
mkdir "$path/test";
if ( -e "$path/test/genemark.gtf" )
{
unlink "$path/test/genemark.gtf";
}
system( "bin/gmes/gmhmme3 -o $path/test/genemark.gtf -m $path/input/athaliana.mod -f gtf $path/input/sequence.fasta" );
if ( ! -e "$path/test/genemark.gtf" )
{ die "error, GeneMark.hmm run test failed\n"; }
system( "bin/compare_intervals_exact.pl --f1 $path/output/genemark.gff3 --f2 $path/test/genemark.gtf --v" );
}
else
{ print "warning, GeneMark.hmm test folder is missing: $path\n"; }
print "# Checking prediction by hmm ... done\n";
}
# ----------------
sub CheckThirdParty
{
print "# Checking third party tools\n";
if ( ! -d "tools" )
{ die "error, folder 'tools' not found\n"; }
chdir "tools";
system("./check_ETP_tools.pl");
chdir "../";
print "# Checking third party tools ... done\n";
}
# ----------------
sub CheckPython3
{
print "# Checking Python3\n";
my $message = `/usr/bin/env python3 --version`;
if ( $message !~ /^Python 3/ )
{ die "error, check for python3\n $message"; }
print "# Checking Python3 ... done\n";
}
# ----------------
sub CheckExe
{
print "# Checking exec\n";
my $message = `"bin/probuild"`;
if ( $message !~ /Version: 2/ )
{ die "error, check bin/probuild\n $message"; }
$message = `bin/bam2hints -h`;
if ( $message !~ /Usage:/ )
{ die "error, check bin/bam2hints\n $message"; }
$message = `bin/gmes/ProtHint/dependencies/diamond version`;
if ( $message !~ /version/ )
{ die "error, check bin/gmes/ProtHint/dependencies/diamond\n $message"; }
$message = `bin/gmes/ProtHint/dependencies/spaln 2>&1 | grep version`;
if ( $message !~ /version/ )
{ die "error, check bin/gmes/ProtHint/dependencies/spaln\n $message"; }
$message = `bin/gmes/ProtHint/dependencies/spaln_boundary_scorer 2>&1`;
if ( $message !~ /Usage:/ )
{ die "error, check bin/gmes/ProtHint/dependencies/spaln_boundary_scorer\n $message"; }
$message = `bin/gmes/Gibbs3`;
if ( $message !~ /Gibbs 3/ )
{ die "error, check bin/gmes/Gibbs3\n $message"; }
print "# Checking exec ... done\n";
}
# ----------------
sub Check_p_GeneMark_hmm
{
print "# Checking P GeneMark.hmm\n";
if (( ! -e "bin/gmst/gmhmmp" )or( ! -x "bin/gmst/gmhmmp"))
{
die "error, file gmhmmp is not an executable or does not exist\n";
}
my $message = `bin/gmst/gmhmmp`;
if ( $message =~ /License key/ )
{
die "error, installation key is missing or expired\n";
}
if ( $message =~ /cannot execute/ )
{
die "error, mismatch between the binary and OS was detected\n";
}
print "# Checking P GeneMark.hmm ... done\n";
}
# ----------------
sub CheckGeneMark_hmm
{
print "# Checking GeneMark.hmm\n";
if (( ! -e "bin/gmes/gmhmme3" )or( ! -x "bin/gmes/gmhmme3"))
{
die "error, file gmhmme3 is not an executable or does not exist\n";
}
my $message = `"bin/gmes/gmhmme3"`;
if ( $message =~ /License key/ )
{
die "error, installation key is missing or expired\n";
}
if ( $message =~ /cannot execute/ )
{
die "error, mismatch between the binary and OS was detected\n";
}
print "# Checking GeneMark.hmm ... done\n";
}
# ----------------
sub CheckPerlModules
{
print "# Checking for Perl modules\n";
my @modules = (
"Cwd",
"Data::Dumper",
"File::Path",
"File::Spec",
"File::Temp",
"FindBin",
"Getopt::Long",
"Hash::Merge",
"List::Util",
"MCE::Mutex",
"Math::Utils",
"Parallel::ForkManager",
"Statistics::LineFit",
"Storable",
"Thread::Queue",
"YAML",
"YAML::XS",
"threads",
);
foreach my $module (@modules)
{
my $respond = `perl -M$module -e 1`;
print "$respond\n" if ( $respond =~ /\S/ );
}
print "# Checking for Perl modules ... done\n";
}
# ----------------