[Bio] / FigKernelPackages / FIG.pm Repository:
ViewVC logotype

Diff of /FigKernelPackages/FIG.pm

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

revision 1.170, Sat Oct 16 20:42:28 2004 UTC revision 1.171, Sun Oct 17 00:02:34 2004 UTC
# Line 2820  Line 2820 
2820      $peg = "";      $peg = "";
2821      $rdbH = $self->db_handle;      $rdbH = $self->db_handle;
2822      if (($relational_db_response = $rdbH->SQL("SELECT id FROM ext_alias WHERE ( alias = \'$alias\' )")) &&      if (($relational_db_response = $rdbH->SQL("SELECT id FROM ext_alias WHERE ( alias = \'$alias\' )")) &&
2823              (@$relational_db_response == 1))          (@$relational_db_response > 0))
2824        {
2825    
2826            if (@$relational_db_response == 1)
2827      {      {
2828          $peg = $relational_db_response->[0]->[0];          $peg = $relational_db_response->[0]->[0];
2829      }      }
2830            elsif (wantarray())
2831            {
2832                return map { $_->[0] } @$relational_db_response;
2833            }
2834        }
2835      else      else
2836      {      {
2837          my @poss = grep { $_ =~ /^fig\|/ } map { $_->[0] } $self->mapped_prot_ids($alias);          my @poss = grep { $_ =~ /^fig\|/ } map { $_->[0] } $self->mapped_prot_ids($alias);
# Line 2832  Line 2840 
2840              @poss = grep { $_ =~ /^fig\|$genomeQ/ } @poss;              @poss = grep { $_ =~ /^fig\|$genomeQ/ } @poss;
2841          }          }
2842    
2843          if (@poss > 0)          if (@poss == 1)
2844          {          {
2845              $peg = $poss[0];              $peg = $poss[0];
2846          }          }
2847            elsif (wantarray())
2848            {
2849                return @poss;
2850            }
2851      }      }
2852      return $peg;      return wantarray() ? ($peg) : $peg;
2853  }  }
2854    
2855  sub to_alias {  sub to_alias {
# Line 2850  Line 2862 
2862          @aliases = grep { $_ =~ /^$type\|/ } map { $_->[0] } $self->mapped_prot_ids($fid);          @aliases = grep { $_ =~ /^$type\|/ } map { $_->[0] } $self->mapped_prot_ids($fid);
2863      }      }
2864    
2865      if (@aliases > 0)      if (wantarray())
2866        {
2867            return @aliases;
2868        }
2869        elsif (@aliases > 0)
2870      {      {
2871          return $aliases[0];          return $aliases[0];
2872      }      }
# Line 2858  Line 2874 
2874      {      {
2875          return "";          return "";
2876      }      }
     return $peg;  
2877  }  }
2878    
2879  =pod  =pod

Legend:
Removed from v.1.170  
changed lines
  Added in v.1.171

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3