这个程序是我在VirusFinder里面发现的,大家可以自行搜索它!
非常好用,建议大家写程序都可以加上这个!
print "\nChecking Java version...\n\n";
my $ret = `java -version 2>&1`;
print "$ret\n";
if (index($ret, '1.6') == -1) {
printf "Warning: The tool Trinity of the Broad Institute may require Java 1.6.\n\n";
}
print "\nChecking SAMtools...\n\n";
$ret = `which samtools 2>&1`;
if (index($ret, 'no samtools') == -1) {
printf "%-30s\tOK\n\n", 'SAMtools';
}else{
printf "%-30s\tnot found\n\n", 'SAMtools';
}
my @required_modules = ("Bio::DB::Sam",
"Bio::DB::Sam::Constants",
"Bio::SeqIO",
"Bio::SearchIO",
"Carp",
"Config::General",
"Cwd",
"Data::Dumper",
"English",
"File::Basename",
"File::Copy",
"File::Path",
"File::Spec",
"File::Temp",
"FindBin",
"Getopt::Std",
"Getopt::Long",
"IO::Handle",
"List::MoreUtils",
"Pod::Usage",
"threads");
print "\nChecking CPAN modules required by VirusFinder...\n\n";
my $count = 0;
for my $module (@required_modules){
eval("use $module");
if ($@) {
printf "%-30s\tFailed\n", $module;
$count++;
}
else {
printf "%-30s\tOK\n", $module;
}
}
if ($count==1){
print "\n\nOne module may not be installed properly.\n\n";
}elsif ($count > 1){
print "\n\n$count modules may not be installed properly.\n\n";
}else{
print "\n\nAll CPAN modules checked!\n\n";
}