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

Annotation of /FigKernelScripts/load_external_orgs.pl

Parent Directory Parent Directory | Revision Log Revision Log


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

1 : efrank 1.1 # -*- perl -*-
2 :    
3 :     ###########################################
4 :     use strict;
5 :     use FIG;
6 :     use DBrtns;
7 :    
8 :     my $fig = new FIG;
9 :     my $dbf = $fig->{_dbf};
10 :    
11 :     my($temp_dir,$prot,$org);
12 :    
13 :     # usage: load_extaernal_orgs
14 :    
15 :     $dbf->drop_table( tbl => "external_orgs" );
16 :     $dbf->create_table( tbl => "external_orgs",
17 :     flds => "prot varchar(32)," .
18 :     "org varchar(64)"
19 :     );
20 :    
21 :     $temp_dir = $FIG_Config::temp;
22 :     open(TAB,">$temp_dir/tmp$$") || die "could not open $temp_dir/tmp$$";
23 :     open(SPORG,"<$FIG_Config::global/ext_org.table") || die "could not open ext_org.table";
24 :     while (defined($_ = <SPORG>))
25 :     {
26 :     chop;
27 :     ($prot,$org) = split(/\t/,$_);
28 :     if (defined($prot) && defined($org) && (length($org) < 64))
29 :     {
30 :     print TAB "$prot\t$org\n";
31 :     }
32 :     }
33 :     close(TAB);
34 :     close(SPORG);
35 :    
36 :     $dbf->load_table( tbl => "external_orgs",
37 :     file => "$temp_dir/tmp$$" );
38 :     $dbf->create_index( idx => "external_orgs_ix",
39 :     tbl => "external_orgs",
40 :     type => "btree",
41 :     flds => "prot" );
42 :     $dbf->vacuum_it("external_orgs");
43 :     unlink("$temp_dir/tmp$$");

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3