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

Diff of /FigKernelScripts/load_peg_mapping.pl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1, Mon Dec 1 20:46:40 2003 UTC revision 1.2, Mon Dec 29 02:22:37 2003 UTC
# Line 14  Line 14 
14    
15  # usage: load_peg_mapping  # usage: load_peg_mapping
16    
17  open(REL,">$temp_dir/tmpfeat$$") || die "could not open $temp_dir/tmpfeat$$";  open(REL,"| sort > $temp_dir/tmpfeat$$") || die "could not open $temp_dir/tmpfeat$$";
18  open(SYN,"<$FIG_Config::global/peg.synonyms")  open(SYN,"<$FIG_Config::global/peg.synonyms")
19      || die "could not open $FIG_Config::global/peg.synonyms";      || die "could not open $FIG_Config::global/peg.synonyms";
20  while (defined($_ = <SYN>))  while (defined($_ = <SYN>))
# Line 26  Line 26 
26      foreach $syn (@syns)      foreach $syn (@syns)
27      {      {
28          ($syn_id,$syn_ln) = @$syn;          ($syn_id,$syn_ln) = @$syn;
29          print REL join("\t",($syn_id,$syn_ln,$peg_id,$peg_ln)),"\n";          print REL join("\t",($peg_id,$peg_ln,$syn_id,$syn_ln)),"\n";
30      }      }
31  }  }
32  close(REL);  close(REL);
# Line 35  Line 35 
35    
36  $dbf->drop_table( tbl => "peg_synonyms" );  $dbf->drop_table( tbl => "peg_synonyms" );
37  $dbf->create_table( tbl  => "peg_synonyms",  $dbf->create_table( tbl  => "peg_synonyms",
38                      flds => "syn_id varchar(32) UNIQUE NOT NULL, syn_ln INTEGER,"  .                      flds => "maps_to varchar(32), maps_to_ln INTEGER," .
39                              "maps_to varchar(32), maps_to_ln INTEGER,"  .                              "syn_id varchar(32), syn_ln INTEGER"
                             "PRIMARY KEY ( syn_id )"  
40                    );                    );
41  $dbf->load_table( tbl => "peg_synonyms",  $dbf->load_table( tbl => "peg_synonyms",
42                    file => "$temp_dir/tmpfeat$$" );                    file => "$temp_dir/tmpfeat$$" );
# Line 45  Line 44 
44  $dbf->create_index( idx  => "peg_ids_ix",  $dbf->create_index( idx  => "peg_ids_ix",
45                      type => "btree",                      type => "btree",
46                      tbl  => "peg_synonyms",                      tbl  => "peg_synonyms",
47                        flds => "syn_id" );
48    
49    $dbf->create_index( idx  => "peg_maps_to_ix",
50                        type => "btree",
51                        tbl  => "peg_synonyms",
52                      flds => "maps_to" );                      flds => "maps_to" );
53    
54  $dbf->vacuum_it("peg_synonyms");  $dbf->vacuum_it("peg_synonyms");

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3