1#!/usr/bin/perl -w
2
3use Cwd;
4
5%dbformats = ("embl" => "embl",
6	      "genbank" => "genbank",
7	      "swiss" => "swissprot",
8	      "wormpep" => "fasta");
9
10%dbfiles = ("embl" => "*.dat",
11	    "genbank" => "*.seq",
12	    "swiss" => "*.dat",
13	    "wormpep" => "wormpep");
14
15$distribtop = "/home/pmr/devemboss";
16
17#open (VERS, "embossversion -full -auto|") || die "Cannot run embossversion";
18#while (<VERS>) {
19#    if(/InstallDirectory: +(\S+)/) {
20#	$installtop = $1;
21#	$installtop =~ s/\/$//;
22#    }
23#    if(/BaseDirectory: +(\S+)/) {
24#	$distribtop = $1;
25#	$distribtop =~ s/\/$//;
26#    }
27#}
28#close VERS;
29
30foreach $db (sort(keys(%dbformats))) {
31    chdir ("$distribtop/test/$db");
32    printf "$db: %s\n", cwd(); ;
33    $location = "$db";
34    if($db eq "wormpep") {$location = "worm"}
35    elsif($db eq "swiss") {$location = "swissprot"}
36    $format = $dbformats{$db};
37    $dbfiles = $dbfiles{$db};
38    system "mv $location/CVS ./savecvs";
39    print STDERR "~/devemboss/scripts/bioflat_index_obda.pl --create --indextype flat --dbname $location --location . --format $format $dbfiles\n";
40    system "~/devemboss/scripts/bioflat_index_obda.pl --create --indextype flat --dbname $location --location . --format $format $dbfiles";
41    system "mv ./savecvs $location/CVS";
42}
43