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

Diff of /FigKernelPackages/HTML.pm

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

revision 1.76, Wed Dec 28 03:28:05 2005 UTC revision 1.99, Tue Sep 19 21:19:14 2006 UTC
# Line 28  Line 28 
28  use HTTP::Request::Common;  use HTTP::Request::Common;
29  use POSIX;  use POSIX;
30    
31    use raelib; # now used for the excel function, that should eventually end up in here. Way too experimental!
32    my $raelib=new raelib;
33    
34    
35  my $top_link_cache;  my $top_link_cache;
36    
# Line 78  Line 81 
81      shift if UNIVERSAL::isa($_[0],__PACKAGE__);      shift if UNIVERSAL::isa($_[0],__PACKAGE__);
82      my($additional_insert, $user, %options ) = @_;      my($additional_insert, $user, %options ) = @_;
83    
84        local $/ = "\n";
85    
86      my $header_name = $options{header_name} ? $options{header_name} : "html.hdr";      my $header_name = $options{header_name} ? $options{header_name} : "html.hdr";
87      my $tail_name = $options{tail_name} ? $options{tail_name} : "html.tail";      my $tail_name = $options{tail_name} ? $options{tail_name} : "html.tail";
88    
# Line 156  Line 161 
161  sub show_page {  sub show_page {
162      #warn "SHOWPAGE: cgi=", Dumper(@_);      #warn "SHOWPAGE: cgi=", Dumper(@_);
163      shift if UNIVERSAL::isa($_[0],__PACKAGE__);      shift if UNIVERSAL::isa($_[0],__PACKAGE__);
164      my($cgi,$html,$no_home, $alt_header, $css, $javasrc, $cookie) = @_;      my($cgi,$html,$no_home, $alt_header, $css, $javasrc, $cookie, $options) = @_;
165      my $i;      my $i;
166    
167      my $top = top_link();      my $top = top_link();
# Line 169  Line 174 
174      #     $css is a reference to a hash. The key is the name of the CSS sheet and the value is the URL of that sheet. Note the usual rules about relative css urls      #     $css is a reference to a hash. The key is the name of the CSS sheet and the value is the URL of that sheet. Note the usual rules about relative css urls
175      #               the sheet named "Default" is considered to be the default style sheet, and if this is not set it points at $FIG_Config::HTML/css/default.css      #               the sheet named "Default" is considered to be the default style sheet, and if this is not set it points at $FIG_Config::HTML/css/default.css
176      #               the sheet named "Sans Serif" is considered to the the first alternate, and if this is not set it points at $FIG_Config::HTML/css/sanserif.css      #               the sheet named "Sans Serif" is considered to the the first alternate, and if this is not set it points at $FIG_Config::HTML/css/sanserif.css
177      #     $javasrc is a reference to an array of URLs to javascripts to be included (e.g. "/FIG/Html/css/styleswitcher.js")      #     $javasrc is a reference to an array of URLs to javascripts to be included (e.g. "FIG/Html/css/styleswitcher.js")
178      #     $cookie is the name and value of the cookie to set. Note that you should probably use raelib->cookie to get/set your cookies      #     $cookie is the name and value of the cookie to set. Note that you should probably use raelib->cookie to get/set your cookies
179        #     $options is a reference to a hash of options that you can pass around the pages
180      #      #
181      # Find the HTML header      # Find the HTML header
182      #      #
# Line 189  Line 195 
195      }      }
196      else      else
197      {      {
198          @html_hdr = compute_html_header(undef,$user);          @html_hdr = compute_html_header(undef,$user,%$options);
199      }      }
200    
201      # RAE: I am offloading the handling of cookies to CGI.pm since I don't know how they are set up.      # RAE: I am offloading the handling of cookies to CGI.pm since I don't know how they are set up.
# Line 359  Line 365 
365    
366      if (!$css || !$css->{'Default'})      if (!$css || !$css->{'Default'})
367      {      {
368         $css->{'Default'} = "$top/Html/css/default.css";         $css->{'Default'} = "Html/css/default.css";
369      }      }
370      if (!$css->{"Sans Serif"})      if (!$css->{"Sans Serif"})
371      {      {
372         $css->{'Sans Serif'} = "$top/Html/css/sanserif.css";         $css->{'Sans Serif'} = "Html/css/sanserif.css";
373      }      }
374    
375      my $csstext = "<link rel='stylesheet' title='default' href='".$css->{'Default'}."' type='text/css'>\n";      my $csstext = "<link rel='stylesheet' title='default' href='".$css->{'Default'}."' type='text/css'>\n";
# Line 375  Line 381 
381         $csstext .= "<link rel='alternate stylesheet' title='$k' href='".$css->{$k}."' type='text/css'>\n";         $csstext .= "<link rel='alternate stylesheet' title='$k' href='".$css->{$k}."' type='text/css'>\n";
382      }      }
383    
384      $csstext   .= "<link rel='alternate'  title='SEED RSS feeds' href='$top/Html/rss/SEED.rss' type='application/rss+xml'>\n";      $csstext   .= "<link rel='alternate'  title='SEED RSS feeds' href='Html/rss/SEED.rss' type='application/rss+xml'>\n";
385    
386      # RAE: also added support for external javascripts here.      # RAE: also added support for external javascripts here.
387      # we are cluttering the HTML code with all the javascripts when they could easily be in external files      # we are cluttering the HTML code with all the javascripts when they could easily be in external files
# Line 385  Line 391 
391      # it will reduce our overhead.      # it will reduce our overhead.
392    
393      # $javasrc must be a ref to an array with urls (absolute or relative) to the javascripts      # $javasrc must be a ref to an array with urls (absolute or relative) to the javascripts
394      push @$javasrc, "$top/Html/css/FIG.js";      push @$javasrc, "Html/css/FIG.js";
395      foreach my $script (@$javasrc) {      foreach my $script (@$javasrc) {
396          $csstext .= "<script src=\"$script\" type=\"text/javascript\"></script>\n";          $csstext .= "<script src=\"$script\" type=\"text/javascript\"></script>\n";
397      }      }
# Line 515  Line 521 
521    
522  }  }
523    
524    
525    =head1 make_table
526    
527    The main method to convert an array into a table.
528    
529    The col_hdrs are set to the <th> headers, the $tab is an array of arrays. The first is the rows, and the second is the columns. The title is the title of the table.
530    
531    The options define the settings for the table such as border, width, and class for css formatting. If the option "excelfile" is set to a filename that will be created in FIG_Config::temp, and the link included that allows the user to download the file as an excel file.
532    
533    =cut
534    
535  sub make_table {  sub make_table {
536      my($col_hdrs,$tab,$title, %options ) = @_;      my($col_hdrs,$tab,$title, %options ) = @_;
537      my(@tab);      my(@tab);
# Line 539  Line 556 
556              );              );
557      }      }
558      push(@tab,"</table>\n");      push(@tab,"</table>\n");
559    
560        # excelfile should be appropriate for a filename (no spaces/special characters)
561        if (defined $options{"excelfile"}) {push @tab, $raelib->tab2excel($col_hdrs,$tab,$title,\%options,$options{"excelfile"})}
562    
563      return join("",@tab);      return join("",@tab);
564  }  }
565    
566  sub abstract_coupling_table {  sub abstract_coupling_table {
567      my($cgi,$prot,$coupling) = @_;      my($cgi,$prot,$coupling) = @_;
568        my %fc;
569    
570      my $col_hdrs = ["coupled to","Score","Type of Coupling", "Type-specific Data"];      my $col_hdrs = ["coupled to","Score","Type of Coupling", "Type-specific Data"];
571      my $tab = [];      my $tab = [];
# Line 551  Line 573 
573      foreach my $x (@$coupling)      foreach my $x (@$coupling)
574      {      {
575          my($peg2,$psc,$type,$extra) = @$x;          my($peg2,$psc,$type,$extra) = @$x;
576            if (($type !~ /^[ID]FC$/) || (! $fc{$peg2}))
577            {
578                if ($type =~  /^[ID]FC$/)
579                {
580                    $fc{$peg2} = 1;
581                }
582    
583          $by_peg{$peg2} += $psc;          $by_peg{$peg2} += $psc;
584      }      }
585        }
586    
587      foreach my $x (sort { ($by_peg{$b->[0]} <=> $by_peg{$a->[0]})      foreach my $x (sort { ($by_peg{$b->[0]} <=> $by_peg{$a->[0]})
588                            or ($a->[0] cmp $b->[0])                            or ($a->[0] cmp $b->[0])
# Line 801  Line 831 
831          }          }
832    
833          my $link;          my $link;
834            my $new_framework = $cgi->param('new_framework') ? 1 : 0;
835          #added to format prophage and path island links to feature.cgi          #added to format prophage and path island links to feature.cgi
836          if ($1 ne "peg")          my $sprout = $cgi->param('SPROUT') ? "&SPROUT=1" : "";
837            if ($1 ne "peg" && ! $sprout)
838          {          {
839             my $user = $cgi->param('user');             my $user = $cgi->param('user');
840             if (! $user) { $user = "" }             if (! $user) { $user = "" }
841             my $sprout = $cgi->param('SPROUT') ? "&SPROUT=1" : "";             $link = "$top/feature.cgi?feature=$fid&user=$user$sprout";
            $link = "$top/feature.cgi?feature=$fid&user=$user$trans$sprout";  
842             $link =~ s/[a-z_A-Z0-9]+\.cgi\?/feature.cgi?/;             $link =~ s/[a-z_A-Z0-9]+\.cgi\?/feature.cgi?/;
843          }          }
844          else          else
# Line 827  Line 858 
858    
859              #if (! $cgi_url) { $cgi_url = &FIG::cgi_url }              #if (! $cgi_url) { $cgi_url = &FIG::cgi_url }
860              #$link = $cgi_url . "/protein.cgi?prot=$fid&user=$user$trans$sprout";              #$link = $cgi_url . "/protein.cgi?prot=$fid&user=$user$trans$sprout";
861              $link = "$top/protein.cgi?prot=$fid&user=$user$trans$sprout";              $link = "$top/protein.cgi?prot=$fid&user=$user$trans$sprout\&new_framework=$new_framework";
862              $link =~ s/[a-z_A-Z0-9]+\.cgi\?/protein.cgi?/;              $link =~ s/[a-z_A-Z0-9]+\.cgi\?/protein.cgi?/;
863          }          }
864          if ($just_url)          if ($just_url)
# Line 836  Line 867 
867          }          }
868          else          else
869          {          {
870              return "<a href=$link>$n</a>";              return "<a href='$link'>$n</a>";
871          }          }
872      }      }
873      return $fid;      return $fid;
# Line 868  Line 899 
899          my $response = $ua->request($request);          my $response = $ua->request($request);
900          $out = $response->content;          $out = $response->content;
901      }      }
902      else  
903        if ($type =~/get/i)
904      {      {
905          @args = ();          @args = ();
906          foreach $x (@$kv_pairs)          foreach $x (@$kv_pairs)
# Line 979  Line 1011 
1011          $after = $3;          $after = $3;
1012          return &set_prot_links($cgi,$before) . &HTML::gi_link($cgi,$match) . &set_prot_links($cgi,$after);          return &set_prot_links($cgi,$before) . &HTML::gi_link($cgi,$match) . &set_prot_links($cgi,$after);
1013      }      }
1014      elsif ($x =~ /^(.*)(tigr\|[0-9a-zA-Z]+)(.*)/s)      elsif ($x =~ /^(.*)(tigr\|\w+)(.*)/s)
1015      {      {
1016          $before = $1;          $before = $1;
1017          $match = $2;          $match = $2;
1018          $after = $3;          $after = $3;
1019          return &set_prot_links($cgi,$before) . &HTML::tigr_link($cgi,$match) . &set_prot_links($cgi,$after);          return &set_prot_links($cgi,$before) . &HTML::tigr_link($cgi,$match) . &set_prot_links($cgi,$after);
1020      }      }
1021        elsif ($x =~ /^(.*)\b(eric\|\S+)\b(.*)/s)
1022        {
1023            $before = $1;
1024            $match = $2;
1025            $after = $3;
1026            return &set_prot_links($cgi,$before) . &HTML::eric_link($cgi,$match) . &set_prot_links($cgi,$after);
1027        }
1028    
1029        elsif ($x =~ /^(.*)\b(bhb\|.*?)\b(.*)/s)
1030        {
1031            $before = $1;
1032            $match = $2;
1033            $after = $3;
1034            return &set_prot_links($cgi,$before) . &HTML::bhb_link($cgi,$match) . &set_prot_links($cgi,$after);
1035        }
1036    
1037        elsif ($x =~ /^(.*)\b(apidb\|[0-9\.a-z_]+)\b(.*)/s)
1038        {
1039            $before = $1;
1040            $match = $2;
1041            $after = $3;
1042            return &set_prot_links($cgi,$before) . &HTML::apidb_link($cgi,$match) . &set_prot_links($cgi,$after);
1043        }
1044    
1045        elsif ($x =~ /^(.*)\b(patric\|.*?)\b(.*)/s)
1046        {
1047            $before = $1;
1048            $match = $2;
1049            $after = $3;
1050            return &set_prot_links($cgi,$before) . &HTML::patric_link($cgi,$match) . &set_prot_links($cgi,$after);
1051        }
1052    
1053        elsif ($x =~ /^(.*)\b(vbrc\|.*?)\b(.*)/s)
1054        {
1055            $before = $1;
1056            $match = $2;
1057            $after = $3;
1058            return &set_prot_links($cgi,$before) . &HTML::vbrc_link($cgi,$match) . &set_prot_links($cgi,$after);
1059        }
1060    
1061        elsif ($x =~ /^(.*)\b(vectorbase\|.*?)\b(.*)/s)
1062        {
1063            $before = $1;
1064            $match = $2;
1065            $after = $3;
1066            return &set_prot_links($cgi,$before) . &HTML::vectorbase_link($cgi,$match) . &set_prot_links($cgi,$after);
1067        }
1068      elsif ($x =~  /^(.*)(uni\|[A-Z0-9]{6})(.*)/s)      elsif ($x =~  /^(.*)(uni\|[A-Z0-9]{6})(.*)/s)
1069      {      {
1070          $before = $1;          $before = $1;
# Line 1035  Line 1114 
1114          $after = $3;          $after = $3;
1115          return &set_prot_links($cgi,$before) . &HTML::mim_link($cgi,$match) . &set_prot_links($cgi,$after);          return &set_prot_links($cgi,$before) . &HTML::mim_link($cgi,$match) . &set_prot_links($cgi,$after);
1116      }      }
1117      elsif ($x =~ /^(.*)(UniGene:[a-zA-Z_0-9\.]+)(.*)/s)      elsif ($x =~ /^(.*)(HGNC:[a-zA-Z_0-9\.]+)(.*)/s)
1118      {      {
1119          $before = $1;          $before = $1;
1120          $match = $2;          $match = $2;
1121          $after = $3;          $after = $3;
1122          return &set_prot_links($cgi,$before) . &HTML::unigene_link($cgi,$match) . &set_prot_links($cgi,$after);          return &set_prot_links($cgi,$before) . &HTML::hgnc_link($cgi,$match) . &set_prot_links($cgi,$after);
1123      }      }
1124      elsif ($x =~ /^(.*)(IPI:[a-zA-Z_0-9\.]+)(.*)/s)      elsif ($x =~ /^(.*)(UniGene:[a-zA-Z_0-9\.]+)(.*)/s)
1125      {      {
1126          $before = $1;          $before = $1;
1127          $match = $2;          $match = $2;
1128          $after = $3;          $after = $3;
1129          return &set_prot_links($cgi,$before) . &HTML::ipi_link($cgi,$match) . &set_prot_links($cgi,$after);          return &set_prot_links($cgi,$before) . &HTML::unigene_link($cgi,$match) . &set_prot_links($cgi,$after);
1130      }      }
1131    # IPI stopped working. turn off for now.
1132    #    elsif ($x =~ /^(.*)(IPI:[a-zA-Z_0-9\.]+)(.*)/s)
1133    #    {
1134    #        $before = $1;
1135    #        $match = $2;
1136    #        $after = $3;
1137    #        return &set_prot_links($cgi,$before) . &HTML::ipi_link($cgi,$match) . &set_prot_links($cgi,$after);
1138    #    }
1139      elsif ($x =~ /^(.*)(WP:[a-zA-Z_0-9\.]+)(.*)/s)      elsif ($x =~ /^(.*)(WP:[a-zA-Z_0-9\.]+)(.*)/s)
1140      {      {
1141          #wormbase          #wormbase
# Line 1085  Line 1172 
1172          $after = $3;          $after = $3;
1173          return &set_prot_links($cgi,$before) . &HTML::sgd_link($cgi,$match) . &set_prot_links($cgi,$after);          return &set_prot_links($cgi,$before) . &HTML::sgd_link($cgi,$match) . &set_prot_links($cgi,$after);
1174      }      }
1175        elsif ($x =~ /^(.*)(tr\|[a-zA-Z0-9]+)(.*)/s)
1176        {
1177    
1178          $before = $1;
1179          $match = $2;
1180          $after = $3;
1181    
1182          return &set_prot_links($cgi,$before) .  &HTML::trembl_link($cgi,$match) . &set_prot_links($cgi,$after);
1183        }
1184      return $x;      return $x;
1185  }  }
1186    
1187    sub trembl_link {
1188        shift if UNIVERSAL::isa($_[0],__PACKAGE__);
1189        my($cgi,$id) = @_;
1190    
1191        if ($id =~ /^tr\|(.*)/) {
1192          return "<a href='http://ca.expasy.org/uniprot/$1' target=_blank>$id</a>";
1193        } else {
1194          return "invalid call to trembl link";
1195        }
1196    }
1197    
1198  sub refseq_link {  sub refseq_link {
1199      shift if UNIVERSAL::isa($_[0],__PACKAGE__);      shift if UNIVERSAL::isa($_[0],__PACKAGE__);
1200      my($cgi,$id) = @_;      my($cgi,$id) = @_;
1201    
1202      if ($id =~ /^[NXYZA]P_/)      if ($id =~ /^[NXYZA]P_/)
1203      {      {
1204          return "<a href=http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?db=protein&cmd=search&term=$id>$id</a>";          return "<a href='http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?db=protein&cmd=search&term=$id' target=_blank>$id</a>";
1205      }      }
1206      elsif ($id =~ /^[NXYZA]M_/)      elsif ($id =~ /^[NXYZA]M_/)
1207      {      {
1208          return "<a href=http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?db=nuccore&cmd=search&term=$id>$id</a>";          return "<a href='http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?db=nuccore&cmd=search&term=$id' target=_blank>$id</a>";
1209      }      }
1210  }  }
1211    
# Line 1108  Line 1215 
1215    
1216      if ($gi =~ /^gi\|(\d+)$/)      if ($gi =~ /^gi\|(\d+)$/)
1217      {      {
1218          return "<a href=http://www.ncbi.nlm.nih.gov:80/entrez/query.fcgi?cmd=Retrieve&db=Protein&list_uids=$1&dopt=GenPept>$gi</a>";          return "<a href='http://www.ncbi.nlm.nih.gov:80/entrez/query.fcgi?cmd=Retrieve&db=Protein&list_uids=$1&dopt=GenPept' target=_blank>$gi</a>";
1219      }      }
1220      return $gi;      return $gi;
1221  }  }
# Line 1117  Line 1224 
1224      shift if UNIVERSAL::isa($_[0],__PACKAGE__);      shift if UNIVERSAL::isa($_[0],__PACKAGE__);
1225      my($cgi,$tigr) = @_;      my($cgi,$tigr) = @_;
1226    
1227      if ($tigr =~ /^tigr\|([0-9a-zA-Z]+)$/)      if ($tigr =~ /^tigr\|(NT|ntbp|ntbpA|BA|BMAA|BXB|GBA)(\w+)$/)
1228      {      {
1229          return "<a href=\"http://pathema.tigr.org/tigr-scripts/CMR/GenePage.cgi?locus=$1\">$tigr</a>";          my $id=$1.$2;
1230            return "<a href=\"http://pathema.tigr.org/tigr-scripts/pathema/shared/GenePage.cgi?locus=$id\" target=_blank>$tigr</a> (Pathema)";
1231        }
1232        elsif ($tigr =~ /^tigr\|(\S+)$/)
1233        {
1234            return "<a href=\"http://www.tigr.org/tigr-scripts/CMR2/GenePage.spl?locus=$1\" target=_blank>$tigr</a>";
1235      }      }
1236      return $tigr;      return $tigr;
1237  }  }
1238    
1239    sub eric_link {
1240        shift if UNIVERSAL::isa($_[0],__PACKAGE__);
1241        my($cgi,$eric) = @_;
1242    
1243        if ($eric =~ /^eric\|(\S+)/)
1244        {
1245            return "<a href=\"https://asap.ahabs.wisc.edu/asap/feature_info.php?FeatureID=$1\" target=_blank>$eric</a>";
1246        }
1247        return $eric;
1248    }
1249    
1250    sub bhb_link {
1251        shift if UNIVERSAL::isa($_[0],__PACKAGE__);
1252        my($cgi,$bhb) = @_;
1253    
1254        return "<a href=\"http://www.biohealthbase.org\" target=_blank>$bhb</a>";
1255    }
1256    
1257    sub apidb_link {
1258        shift if UNIVERSAL::isa($_[0],__PACKAGE__);
1259        my($cgi,$api) = @_;
1260    
1261        if ($api =~ /apidb\|(.*?)\.(.*)$/)
1262        {
1263            return "<a href=\"http://www.apidb.org/cgi-bin/redirect.cgi?taxon_id=$1&source_id=$2\" target=_blank>$api</a>";
1264        }
1265        return $api;
1266    }
1267    
1268    sub patric_link {
1269        shift if UNIVERSAL::isa($_[0],__PACKAGE__);
1270        my($cgi,$patric) = @_;
1271    
1272        if ($patric =~ /patric\|(.*)/)
1273        {
1274            return "<a href=\"https://patric.vbi.vt.edu/software/curationTool/gep/pgiCuration.php?locus_name=$1\" target=_blank>$patric</a>";
1275        }
1276        return $patric;
1277    }
1278    
1279    sub vbrc_link {
1280        shift if UNIVERSAL::isa($_[0],__PACKAGE__);
1281        my($cgi,$vbrc) = @_;
1282    
1283        if ($vbrc =~ /vbrc\|(.*)/)
1284        {
1285            return "<a href=\"http://www.biovirus.org/gene_detail.asp?name=$1\" target=_blank>$vbrc</a>";
1286        }
1287        return $vbrc;
1288    }
1289    
1290    sub vectorbase_link {
1291        shift if UNIVERSAL::isa($_[0],__PACKAGE__);
1292        my($cgi,$vec) = @_;
1293        return "<a href=\"http://www.vectorbase.org\" target=_blank>$vec</a>";
1294    }
1295    
1296    
1297  sub uni_link {  sub uni_link {
1298      shift if UNIVERSAL::isa($_[0],__PACKAGE__);      shift if UNIVERSAL::isa($_[0],__PACKAGE__);
1299      my($cgi,$uni) = @_;      my($cgi,$uni) = @_;
1300    
1301      if ($uni =~ /^uni\|(\S+)$/)      if ($uni =~ /^uni\|(\S+)$/)
1302      {      {
1303          return "<a href=http://www.pir.uniprot.org/cgi-bin/upEntry?id=$1>$uni</a>";          #return "<a href=http://www.pir.uniprot.org/cgi-bin/upEntry?id=$1>$uni</a>";
1304            return "<a href='http://www.ebi.uniprot.org/uniprot-srv/uniProtView.do?proteinAc=$1' target=_blank>$uni</a>";
1305      }      }
1306      return $uni;      return $uni;
1307  }  }
# Line 1141  Line 1312 
1312    
1313      if ($sp =~ /^sp\|(\S+)$/)      if ($sp =~ /^sp\|(\S+)$/)
1314      {      {
1315          return "<a href=http://us.expasy.org/cgi-bin/get-sprot-entry?$1>$sp</a>";          return "<a href='http://us.expasy.org/cgi-bin/get-sprot-entry?$1' target=_blank>$sp</a>";
1316      }      }
1317      return $sp;      return $sp;
1318  }  }
# Line 1152  Line 1323 
1323    
1324      if ($pir =~ /^pirnr\|(NF\d+)$/)      if ($pir =~ /^pirnr\|(NF\d+)$/)
1325      {      {
1326          return "<a href=http://pir.georgetown.edu/cgi-bin/nfEntry.pl?id=$1>$pir</a>";          return "<a href='http://pir.georgetown.edu/cgi-bin/nfEntry.pl?id=$1' target=_blank>$pir</a>";
1327      }      }
1328      return $pir;      return $pir;
1329  }  }
# Line 1163  Line 1334 
1334    
1335      if ($kegg =~ /^kegg\|([^:]+):(\S+)$/)      if ($kegg =~ /^kegg\|([^:]+):(\S+)$/)
1336      {      {
1337          return "<a href=http://www.genome.ad.jp/dbget-bin/www_bget?$1+$2>$kegg</a>";          return "<a href='http://www.genome.ad.jp/dbget-bin/www_bget?$1+$2' target=_blank>$kegg</a>";
1338      }      }
1339      return $kegg;      return $kegg;
1340  }  }
# Line 1176  Line 1347 
1347      {      {
1348          my $what=$1;          my $what=$1;
1349          my $key=$2;          my $key=$2;
1350          my $idx="all";          my $idx="All";
1351          if ($what eq "EnsemblGene") { $idx = "Gene" }          if ($what eq "EnsemblGene") { $idx = "Gene" }
1352          if ($what eq "EnsemblTranscript") { $idx = "all" }          if ($what eq "EnsemblTranscript") { $idx = "All" }
1353          if ($what eq "EnsemblProtein") { $idx = "all" }          if ($what eq "EnsemblProtein") { $idx = "All" }
1354    
1355          #I really want to get right to the transcript and peptide pages, but          #I really want to get right to the transcript and peptide pages, but
1356          #can't see how to do that without knowing the org name too, which          #can't see how to do that without knowing the org name too, which
1357          #I don't know at this point. (ensembl org name, not real org name)          #I don't know at this point. (ensembl org name, not real org name)
1358    
1359          return "<a href=http://www.ensembl.org/Homo_sapiens/textview?species=all&idx=$idx&q=$key>$ensembl</a>";          return "<a href='http://www.ensembl.org/Homo_sapiens/searchview?species=all&idx=$idx&q=$key' target=_blank>$ensembl</a>";
1360      }      }
1361      return $ensembl;      return $ensembl;
1362  }  }
# Line 1196  Line 1367 
1367    
1368      if ($entrezgene =~ /^EntrezGene:(\S+)$/)      if ($entrezgene =~ /^EntrezGene:(\S+)$/)
1369      {      {
1370          return "<a href=http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?db=gene&cmd=Retrieve&dopt=full_report&list_uids=$1>$entrezgene</a>";          return "<a href='http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?db=gene&cmd=Retrieve&dopt=full_report&list_uids=$1' target=_blank>$entrezgene</a>";
1371      }      }
1372      return $entrezgene;      return $entrezgene;
1373  }  }
# Line 1207  Line 1378 
1378    
1379      if ($mim =~ /^MIM:(\S+)$/)      if ($mim =~ /^MIM:(\S+)$/)
1380      {      {
1381          return "<a href=http://www3.ncbi.nlm.nih.gov/entrez/dispomim.cgi?id=$1>$mim</a>";          return "<a href='http://www3.ncbi.nlm.nih.gov/entrez/dispomim.cgi?id=$1' target=_blank>$mim</a>";
1382        }
1383        return $mim;
1384    }
1385    
1386    sub hgnc_link {
1387        shift if UNIVERSAL::isa($_[0],__PACKAGE__);
1388        my($cgi,$hgnc) = @_;
1389    
1390        if ($hgnc =~ /^HGNC:(\S+)$/)
1391        {
1392            return "<a href='http://www.gene.ucl.ac.uk/cgi-bin/nomenclature/searchgenes.pl?field=symbol&anchor=equals&match=$1&symbol_search=Search&number=50&format=html&sortby=symbol' target=_blank>$hgnc</a>";
1393      }      }
1394      return $mim;      return $mim;
1395  }  }
# Line 1218  Line 1400 
1400    
1401      if ($unigene =~ /^UniGene:(\S+)$/)      if ($unigene =~ /^UniGene:(\S+)$/)
1402      {      {
1403          return "<a href=http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?db=unigene&cmd=search&term=$1>$unigene</a>";          return "<a href='http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?db=unigene&cmd=search&term=$1' target=_blank>$unigene</a>";
1404      }      }
1405      return $unigene;      return $unigene;
1406  }  }
# Line 1229  Line 1411 
1411    
1412      if ($ipi =~ /^IPI:(\S+)$/)      if ($ipi =~ /^IPI:(\S+)$/)
1413      {      {
1414          return "<a href=http://srs.ebi.ac.uk/srsbin/cgi-bin/wgetz?-id+AEoS1R8Jnn+-e+[IPI:\'$1\']+-qnum+1+-enum+1>$ipi</a>";          return "<a href='http://srs.ebi.ac.uk/srsbin/cgi-bin/wgetz?-id+AEoS1R8Jnn+-e+[IPI:\'$1\']+-qnum+1+-enum+1' target=_blank>$ipi</a>";
1415      }      }
1416      return $ipi;      return $ipi;
1417  }  }
# Line 1242  Line 1424 
1424    
1425      if ($wp =~ /^WP:(\S+)$/)      if ($wp =~ /^WP:(\S+)$/)
1426      {      {
1427          return "<a href=http://www.wormbase.org/db/searches/basic?class=Any&query=$1&Search=Search>$wp</a>";          return "<a href='http://www.wormbase.org/db/searches/basic?class=Any&query=$1&Search=Search' target=_blank>$wp</a>";
1428      }      }
1429      return $wp;      return $wp;
1430  }  }
# Line 1255  Line 1437 
1437    
1438      if ($fb =~ /^FB:(\S+)$/)      if ($fb =~ /^FB:(\S+)$/)
1439      {      {
1440          return "<a href=http://flybase.bio.indiana.edu/.bin/fbidq.html?$1>$fb</a>";          return "<a href='http://flybase.bio.indiana.edu/.bin/fbidq.html?$1' target=_blank>$fb</a>";
1441      }      }
1442      return $fb;      return $fb;
1443  }  }
# Line 1268  Line 1450 
1450    
1451      if ($fb =~ /^FlyBaseORFNames:(\S+)$/)      if ($fb =~ /^FlyBaseORFNames:(\S+)$/)
1452      {      {
1453          return "<a href=http://flybase.bio.indiana.edu/.bin/fbidq.html?$1>$fb</a>";          return "<a href='http://flybase.bio.indiana.edu/.bin/fbidq.html?$1' target=_blank>$fb</a>";
1454      }      }
1455      return $fb;      return $fb;
1456  }  }
# Line 1281  Line 1463 
1463    
1464      if ($sgd =~ /^SGD_LOCUS:(\S+)$/)      if ($sgd =~ /^SGD_LOCUS:(\S+)$/)
1465      {      {
1466          return "<a href=http://db.yeastgenome.org/cgi-bin/locus.pl?locus=$1>$sgd</a>";          return "<a href='http://db.yeastgenome.org/cgi-bin/locus.pl?locus=$1' target=_blank>$sgd</a>";
1467      }      }
1468      return $sgd;      return $sgd;
1469  }  }
# Line 1344  Line 1526 
1526      my($sub_link);      my($sub_link);
1527    
1528      my $user = $cgi->param('user');      my $user = $cgi->param('user');
1529        my $esc_sub = uri_escape( $sub );
1530        $sub =~ s/\_/ /g;
1531      if ($user)      if ($user)
1532      {      {
         my $esc_sub = uri_escape( $sub );  
1533          $sub_link = "<a href=./subsys.cgi?ssa_name=$esc_sub&request=show_ssa&user=$user>$sub</a>";          $sub_link = "<a href=./subsys.cgi?ssa_name=$esc_sub&request=show_ssa&user=$user>$sub</a>";
1534      }      }
1535      else      else
1536      {      {
1537          $sub_link = $sub;          $sub_link = "<a href=\"display_subsys.cgi?ssa_name=$esc_sub&request=show_ssa&sort=by_phylo\">$sub</a>";
1538      }      }
1539      return $sub_link;      return $sub_link;
1540  }  }
1541    
1542  sub reaction_link {  sub reaction_link {
1543      my($reaction) = @_;      my($reaction) = @_;
1544        if ($reaction =~ /^(\*)?(R\d+)/)
     if ($reaction =~ /^R\d+/)  
1545      {      {
1546          return "<a href=\"http://www.genome.ad.jp/dbget-bin/www_bget?rn+$reaction\" target=reaction$$>$reaction</a>";          return "<a href=\"http://www.genome.ad.jp/dbget-bin/www_bget?rn+$2\" target=reaction$$>$reaction</a>";
1547      }      }
1548      return $reaction;      return $reaction;
1549  }  }
1550    
1551    
1552  sub html_for_assignments {  sub html_for_assignments {
1553      my($fig,$user,$peg_sets) = @_;      my($fig,$user,$peg_sets) = @_;
1554      my $i;      my $i;

Legend:
Removed from v.1.76  
changed lines
  Added in v.1.99

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3