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

Diff of /FigKernelScripts/load_features.pl

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

revision 1.9, Wed Apr 28 00:06:34 2004 UTC revision 1.10, Thu May 20 12:26:47 2004 UTC
# Line 15  Line 15 
15  # usage: load_features [G1 G2 G3 ... ]  # usage: load_features [G1 G2 G3 ... ]
16    
17  open(REL,">$temp_dir/tmpfeat$$") || die "could not open $temp_dir/tmpfeat$$";  open(REL,">$temp_dir/tmpfeat$$") || die "could not open $temp_dir/tmpfeat$$";
18  open(ALIAS,">$temp_dir/tmpalias$$") || die "could not open $temp_dir/tmpalias$$";  open(ALIAS,"| sort -u > $temp_dir/tmpalias$$") || die "could not open $temp_dir/tmpalias$$";
19    
20  my $dbf = $fig->{_dbf};  my $dbf = $fig->{_dbf};
21    
# Line 51  Line 51 
51      }      }
52    
53      @genomes = $fig->genomes;      @genomes = $fig->genomes;
54    
55        # Here we extract external aliases from the peg.synonyms table, when they can be inferred
56        # accurately.
57        open(SYN,"<$FIG_Config::global/peg.synonyms") || die "could not open $FIG_Config::global/peg.synonyms";
58        while (defined($_ = <SYN>))
59        {
60            chop;
61            my($x,$y) = split(/\t/,$_);
62            my @ids = map { $_ =~ /^([^,]+)/ } ($x,split(/;/,$y));
63            my @fig = ();
64            my(@nonfig) = ();
65            foreach $_ (@ids)
66            {
67                if ($_ =~ /^fig\|/)
68                {
69                    push(@fig,$_);
70                }
71                else
72                {
73                    push(@nonfig,$_);
74                }
75            }
76    
77            if (@fig == 1)
78            {
79                my $genome = &FIG::genome_of($fig[0]);
80                foreach $_ (@nonfig)
81                {
82                    print ALIAS "$fig[0]\t$_\t$genome\n";
83                }
84            }
85        }
86        close(SYN);
87  }  }
88  else  else
89  {  {
# Line 147  Line 180 
180                          type => "btree",                          type => "btree",
181                          flds => "genome" );                          flds => "genome" );
182    
183        $dbf->create_index( idx  => "ext_alias_id_ix",
184                            tbl  => "ext_alias",
185                            type => "btree",
186                            flds => "id" );
187    
188      $dbf->create_index( idx  => "features_id_ix",      $dbf->create_index( idx  => "features_id_ix",
189                          tbl  => "features",                          tbl  => "features",
190                          type => "btree",                          type => "btree",

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.10

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3