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

Annotation of /FigKernelScripts/load_sims.pl

Parent Directory Parent Directory | Revision Log Revision Log


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

1 : overbeek 1.1
2 :    
3 :     # -*- perl -*-
4 :    
5 :     use FIG;
6 :     my $fig = new FIG;
7 :    
8 :     use DBrtns;
9 :    
10 : overbeek 1.2 $usage = "usage: load_sims SimsDir";
11 :     ($dir = shift @ARGV)
12 :     || die $usage;
13 : overbeek 1.1
14 :     my $dbf = $fig->{_dbf};
15 :    
16 :     $dbf->drop_table( tbl => "condensed_sims" );
17 :     $dbf->create_table( tbl => 'condensed_sims',
18 :     flds => "peg1 varchar(32), peg2 varchar(32), iden varchar(6), psc varchar(10), paraN INTEGER"
19 :     );
20 : overbeek 1.2 opendir(SIMS,$dir) || die "$dir does not exist";
21 : overbeek 1.1 @files = grep { $_ !~ /^\./ } readdir(SIMS);
22 :     closedir(SIMS);
23 :     foreach $file (@files)
24 :     {
25 : overbeek 1.3 if (-s "$dir/$file")
26 :     {
27 :     $dbf->load_table( tbl => "condensed_sims",
28 :     file => "$dir/$file" );
29 :     }
30 : overbeek 1.1 }
31 :     $dbf->create_index( idx => "condensed_sims_ix",
32 :     tbl => "condensed_sims",
33 :     type => "btree",
34 :     flds => "peg1" );
35 :    
36 :     $dbf->vacuum_it("condensed_sims");
37 :    

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3