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

Annotation of /FigKernelScripts/load_coupling.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (view) (download) (as text)

1 : overbeek 1.1
2 :     # -*- perl -*-
3 :    
4 :     use FIG;
5 :     my $fig = new FIG;
6 :    
7 : overbeek 1.3 # usage: load_coupling
8 : overbeek 1.1
9 : overbeek 1.3 $pchD = "$FIG_Config::fig/CouplingData/PCHs";
10 :     $scores = "$FIG_Config::fig/CouplingData/scores";
11 : overbeek 1.1
12 :     use DBrtns;
13 :    
14 : overbeek 1.3 if (! ((-d $pchD) && (-s $scores))) { exit }
15 : overbeek 1.1
16 :     my $dbf = $fig->{_dbf};
17 :    
18 :     $dbf->drop_table( tbl => "fc_pegs" );
19 :     $dbf->create_table( tbl => 'fc_pegs',
20 :     flds => "peg1 varchar(32), peg2 varchar(32), score integer"
21 :     );
22 :     $dbf->load_table( tbl => "fc_pegs",
23 :     file => $scores );
24 :     $dbf->create_index( idx => "fc_pegs_ix",
25 :     tbl => "fc_pegs",
26 :     type => "btree",
27 :     flds => "peg1,peg2" );
28 :    
29 :     $dbf->vacuum_it("fc_pegs");
30 :    
31 :     $dbf->drop_table( tbl => "pchs" );
32 :     $dbf->create_table( tbl => 'pchs',
33 :     flds => "peg1 varchar(32), peg2 varchar(32), peg3 varchar(32), peg4 varchar(32),
34 : overbeek 1.2 inden13 varchar(6), inden24 varchar(6), para3 integer, para4 integer, rep char(1)"
35 : overbeek 1.1 );
36 :    
37 :     opendir(PCHD,$pchD) || die "could not open $pchD";
38 :     @files = grep { ($_ !~ /^\./) && (-s "$pchD/$_") } readdir(PCHD);
39 :     foreach $file (@files)
40 :     {
41 :     $dbf->load_table( tbl => "pchs",
42 :     file => "$pchD/$file" );
43 :     }
44 :     $dbf->create_index( idx => "pchs_ix",
45 :     tbl => "pchs",
46 :     type => "btree",
47 :     flds => "peg1,peg2" );
48 :    
49 :     $dbf->vacuum_it("pchs");
50 :    

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3