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

Annotation of /FigKernelScripts/load_sims.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (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 : olson 1.4 flds => "g1 smallint, p1 mediumint, g2 smallint, p2 mediumint, iden real, psc real, paraN INTEGER",
19 :     type => 'InnoDB'
20 : overbeek 1.1 );
21 : overbeek 1.2 opendir(SIMS,$dir) || die "$dir does not exist";
22 : overbeek 1.1 @files = grep { $_ !~ /^\./ } readdir(SIMS);
23 :     closedir(SIMS);
24 :     foreach $file (@files)
25 :     {
26 : overbeek 1.3 if (-s "$dir/$file")
27 :     {
28 : olson 1.4 print "Loading $dir/$file\n";
29 : overbeek 1.3 $dbf->load_table( tbl => "condensed_sims",
30 :     file => "$dir/$file" );
31 :     }
32 : overbeek 1.1 }
33 : olson 1.4 print "Creating index\n";
34 : overbeek 1.1 $dbf->create_index( idx => "condensed_sims_ix",
35 :     tbl => "condensed_sims",
36 :     type => "btree",
37 : olson 1.4 flds => "g1, p1" );
38 : overbeek 1.1
39 :     $dbf->vacuum_it("condensed_sims");
40 :    

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3