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

View of /FigKernelScripts/load_coupling.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (download) (as text) (annotate)
Mon Jun 20 20:09:58 2005 UTC (14 years, 5 months ago) by olson
Branch: MAIN
Changes since 1.3: +3 -3 lines
Load from FIG/Data/CouplingData instead of FIG/CouplingData

# -*- perl -*-

use FIG;
my $fig = new FIG;

# usage: load_coupling

$pchD   = "$FIG_Config::data/CouplingData/PCHs";
$scores = "$FIG_Config::data/CouplingData/scores";

use DBrtns;

if (! ((-d $pchD) && (-s $scores))) { die "Cannot find data at $pchD or $scores"; }

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

$dbf->drop_table( tbl => "fc_pegs" );
$dbf->create_table( tbl => 'fc_pegs',
		    flds => "peg1 varchar(32), peg2 varchar(32), score integer"
		  );
$dbf->load_table( tbl => "fc_pegs",
                  file => $scores );
$dbf->create_index( idx  => "fc_pegs_ix",
		    tbl  => "fc_pegs",
		    type => "btree",
		    flds => "peg1,peg2" );

$dbf->vacuum_it("fc_pegs");

$dbf->drop_table( tbl => "pchs" );
$dbf->create_table( tbl => 'pchs',
		    flds => "peg1 varchar(32), peg2 varchar(32), peg3 varchar(32), peg4 varchar(32),
                             inden13 varchar(6), inden24 varchar(6), para3  integer, para4 integer, rep char(1)"
		  );

opendir(PCHD,$pchD) || die "could not open $pchD";
@files = grep { ($_ !~ /^\./) && (-s "$pchD/$_") } readdir(PCHD);
foreach $file (@files)
{
    $dbf->load_table( tbl => "pchs",
                  file => "$pchD/$file" );
}
$dbf->create_index( idx  => "pchs_ix",
		    tbl  => "pchs",
		    type => "btree",
		    flds => "peg1,peg2" );

$dbf->vacuum_it("pchs");


MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3