| 116 |
|
|
| 117 |
Perform only the unpacking/indexing, but do not retrieve/update the databases. This option may be beneficial when the site administator is aware of current analyses that should not be disturbed by the indexing process but the downloading from the net can already be started. |
Perform only the unpacking/indexing, but do not retrieve/update the databases. This option may be beneficial when the site administator is aware of current analyses that should not be disturbed by the indexing process but the downloading from the net can already be started. |
| 118 |
|
|
| 119 |
|
=item --config <system> |
| 120 |
|
|
| 121 |
|
Preparation of the configuration file that would be reuired for a particular system that deals with the database. The configuration is printed to stdout and is expected to be copied manually to the proper file or folder. One could imagine this process to be automated, though this is not yet implemented. Currently implemented systems are: emboss and dre. "dre" stands for "dynamic runtime environment", which is a concept of the ARC grid middleware of which more can be learned on http://www.nordugrid.org. |
| 122 |
|
|
| 123 |
=back |
=back |
| 124 |
|
|
| 125 |
=head1 EXAMPLES |
=head1 EXAMPLES |
| 227 |
source => "wget --mirror ftp://ftp.ebi.ac.uk/pub/databases/swissprot/release_compressed/uniprot_trembl.dat.gz", |
source => "wget --mirror ftp://ftp.ebi.ac.uk/pub/databases/swissprot/release_compressed/uniprot_trembl.dat.gz", |
| 228 |
"post-download" => "d=uncompressed; if [ ! -d \$d ]; then mkdir \$d; fi; " |
"post-download" => "d=uncompressed; if [ ! -d \$d ]; then mkdir \$d; fi; " |
| 229 |
."rm -rf \$d/trembl.dat; " |
."rm -rf \$d/trembl.dat; " |
| 230 |
."(find ftp.ebi.ac.uk -name '*.dat.gz' | xargs -r zcat ) > \$d/swissprot.dat; " |
."(find ftp.ebi.ac.uk -name '*.dat.gz' | xargs -r zcat ) > \$d/trembl.dat; " |
| 231 |
."[ -x /usr/bin/dbxflat ] && dbxflat -dbname swisslocal -fields acc,des" |
."[ -x /usr/bin/dbxflat ] && cd \$d && dbxflat -dbresource embl -dbname trembllocal -fields acc,des -auto" |
| 232 |
}, |
}, |
| 233 |
|
|
| 234 |
"swiss.dat" => { |
"swiss.dat" => { |
| 237 |
"post-download" => "d=uncompressed; if [ ! -d \$d ]; then mkdir \$d; fi; " |
"post-download" => "d=uncompressed; if [ ! -d \$d ]; then mkdir \$d; fi; " |
| 238 |
."rm -rf \$d/swissprot.dat; " |
."rm -rf \$d/swissprot.dat; " |
| 239 |
."(tfind ftp.ebi.ac.uk -name '*.dat.gz` | xargs -r zcat ) > \$d/swissprot.dat; " |
."(tfind ftp.ebi.ac.uk -name '*.dat.gz` | xargs -r zcat ) > \$d/swissprot.dat; " |
| 240 |
."[ -x /usr/bin/dbiflat ] && dbiflat -dbname swisslocal -fields acc,des" |
."[ -x /usr/bin/dbiflat ] && cd \$d && dbiflat -dbresource embl -dbname swisslocal -fields acc,des -auto" |
| 241 |
# source => "wget --mirror ftp://ftp.ebi.ac.uk/pub/databases/swissprot/release_compressed/uniprot_sprot.dat.gz" |
# source => "wget --mirror ftp://ftp.ebi.ac.uk/pub/databases/swissprot/release_compressed/uniprot_sprot.dat.gz" |
| 242 |
}, |
}, |
| 243 |
|
|
| 262 |
# } |
# } |
| 263 |
); |
); |
| 264 |
|
|
| 265 |
my ($post,$source,$list,$help,$man,$verbose)=(undef,undef,0,0,0,0); |
my ($post,$source,$config,$list,$help,$man,$verbose)=(undef,undef,undef,0,0,0,0); |
| 266 |
|
|
| 267 |
my %options=("mirrordir:s" => \$mirrordir, |
my %options=("mirrordir:s" => \$mirrordir, |
| 268 |
"list" => \$list, |
"list" => \$list, |
| 269 |
"help"=>\$help, "man"=>\$man, |
"help"=>\$help, "man"=>\$man, |
| 270 |
"verbose"=>\$verbose, |
"verbose"=>\$verbose, |
| 271 |
"post"=>\$post, |
"post"=>\$post, |
| 272 |
|
"config:s@"=>\$config, |
| 273 |
"source"=>\$source); |
"source"=>\$source); |
| 274 |
|
|
| 275 |
|
|
| 276 |
my ($do_source,$do_post)=(1,1); |
my ($do_source,$do_post,$do_config)=(1,1,0); |
| 277 |
|
|
| 278 |
|
|
| 279 |
sub myhelp () { |
sub myhelp () { |
| 298 |
print "disabling retrieval of database updates.\n"; |
print "disabling retrieval of database updates.\n"; |
| 299 |
$do_source=0; |
$do_source=0; |
| 300 |
$do_post=1; |
$do_post=1; |
| 301 |
|
$do_config=0; |
| 302 |
} |
} |
| 303 |
if ($source) { |
if ($source) { |
| 304 |
print "disabling unpacking and indexing.\n"; |
print "disabling unpacking and indexing.\n"; |
| 305 |
$do_post=0; |
$do_post=0; |
| 306 |
$do_source=1; |
$do_source=1; |
| 307 |
|
$do_config=0; |
| 308 |
|
} |
| 309 |
|
if ($config) { |
| 310 |
|
print "disabling retrieval of updates and their unpacking/indexing.\n"; |
| 311 |
|
$do_post=0; |
| 312 |
|
$do_source=0; |
| 313 |
|
$do_config=1; |
| 314 |
} |
} |
| 315 |
|
|
| 316 |
if ($verbose) { |
if ($verbose) { |
| 329 |
exit 0; |
exit 0; |
| 330 |
} |
} |
| 331 |
|
|
| 332 |
die "Cannot write to root destination directory at '$mirrordir'.\n" unless ( -w "$mirrordir" ); |
die "Cannot write to root destination directory at '$mirrordir'.\n" unless ( -w "$mirrordir" or $do_config); |
| 333 |
|
|
| 334 |
#print join(", ",@ARGV)."\n"; |
#print join(", ",@ARGV)."\n"; |
| 335 |
|
|
| 336 |
my $d=getcwd(); |
my $d=getcwd(); |
| 337 |
|
|
| 338 |
foreach my $db (@ARGV) { |
foreach my $db (@ARGV) { |
| 339 |
|
|
| 340 |
unless(exists($toBeMirrored{$db})) { |
unless(exists($toBeMirrored{$db})) { |
| 341 |
print STDERR "Unknown database: '$db'\n"; |
print STDERR "Unknown database: '$db'\n"; |
| 342 |
next; |
next; |
| 343 |
} |
} |
| 344 |
|
|
| 345 |
|
if ($do_config) { |
| 346 |
|
foreach my $system (@$config) { |
| 347 |
|
if ("emboss" eq "$system") { |
| 348 |
|
if ($db =~ /(swiss|trembl).dat/ ) { |
| 349 |
|
print "\n"; |
| 350 |
|
print "########### " . $db . " ##############\n"; |
| 351 |
|
print "\n"; |
| 352 |
|
print "DB "; |
| 353 |
|
my $n=$db; |
| 354 |
|
$n =~ s/\.dat$//; |
| 355 |
|
print $n; |
| 356 |
|
print "local [\n"; |
| 357 |
|
print " type: P\n"; |
| 358 |
|
print " format: swiss\n"; |
| 359 |
|
if ($db eq "swiss.dat") { |
| 360 |
|
print " method: emblcd\n"; |
| 361 |
|
} |
| 362 |
|
elsif ($db eq "trembl.dat") { |
| 363 |
|
print " method: emboss\n"; |
| 364 |
|
} |
| 365 |
|
else { |
| 366 |
|
print " # method: unknown\n"; |
| 367 |
|
} |
| 368 |
|
print " directory: $mirrordir/$db/uncompressed/$db\n"; |
| 369 |
|
print "]\n"; |
| 370 |
|
print "\n"; |
| 371 |
|
print "####################################\n"; |
| 372 |
|
} |
| 373 |
|
} |
| 374 |
|
elsif ("dre" eq "$system") { |
| 375 |
|
if ( -d "$mirrordir/$db" ) { |
| 376 |
|
print "MIRRORDIR=\"$mirrordir\"\n"; |
| 377 |
|
} |
| 378 |
|
else { |
| 379 |
|
print STDERR "$db: not installed, configuration not printed. |
| 380 |
|
} |
| 381 |
|
} |
| 382 |
|
else { |
| 383 |
|
print "Unknown system $system\n"; |
| 384 |
|
} |
| 385 |
|
} |
| 386 |
|
} |
| 387 |
|
|
| 388 |
print STDERR "\"$db\" -> \"$mirrordir\"\n"; |
print STDERR "\"$db\" -> \"$mirrordir\"\n"; |
| 389 |
print "Mirroring ".$toBeMirrored{$db}{"name"}." ($db)\n"; |
print "Mirroring ".$toBeMirrored{$db}{"name"}." ($db)\n"; |
| 390 |
|
|