[Bio] / FigKernelScripts / load_sims.pl Repository:
ViewVC logotype

View of /FigKernelScripts/load_sims.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (download) (as text) (annotate)
Sat May 7 21:35:12 2005 UTC (15 years ago) by overbeek
Branch: MAIN
Changes since 1.2: +5 -2 lines
minor fix


# -*- perl -*-

use FIG;
my $fig = new FIG;

use DBrtns;

$usage = "usage: load_sims SimsDir";
($dir = shift @ARGV)
    || die $usage;

my $dbf = $fig->{_dbf};

$dbf->drop_table( tbl => "condensed_sims" );
$dbf->create_table( tbl => 'condensed_sims',
		    flds => "peg1 varchar(32), peg2 varchar(32), iden varchar(6), psc varchar(10), paraN INTEGER"
		  );
opendir(SIMS,$dir) || die "$dir does not exist";
@files = grep { $_ !~ /^\./ } readdir(SIMS);
closedir(SIMS);
foreach $file (@files)
{
    if (-s "$dir/$file")
    {
	$dbf->load_table( tbl => "condensed_sims",
			  file => "$dir/$file" );
    }
}
$dbf->create_index( idx  => "condensed_sims_ix",
		    tbl  => "condensed_sims",
		    type => "btree",
		    flds => "peg1" );

$dbf->vacuum_it("condensed_sims");


MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3