[Bio] / FigWebServices / protein.cgi Repository:
ViewVC logotype

Diff of /FigWebServices/protein.cgi

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

revision 1.160, Tue Oct 11 01:09:31 2005 UTC revision 1.161, Wed Oct 12 21:03:16 2005 UTC
# Line 414  Line 414 
414      my($fig_or_sprout,$cgi,$html,$peg) = @_;      my($fig_or_sprout,$cgi,$html,$peg) = @_;
415    
416      # generate the link to turn tools on or off      # generate the link to turn tools on or off
417      my $toollink=$cgi->self_url;      my $toollink = $cgi->url(-relative => 1, -query => 1, -path_info => 1);
418    
419      $toollink =~ s/[\&\;]fulltools.*[^\;\&]/\&/;      $toollink =~ s/[\&\;]fulltools.*[^\;\&]/\&/;
420      my $fulltoolbutton  = $cgi->a({href=> $toollink . "&fulltools='1'"}, "> Show tool descriptions"); # define this here before we mess with ourself!      my $fulltoolbutton  = $cgi->a({href=> $toollink . "&fulltools='1'"}, "> Show tool descriptions"); # define this here before we mess with ourself!
421      my $brieftoolbutton = $cgi->a({href=> $toollink}, "< Hide tool descriptions");      my $brieftoolbutton = $cgi->a({href=> $toollink}, "< Hide tool descriptions");
422    
423      $cgi->param(-name => "request",      $cgi->param(-name => "request",
424                  -value => "use_protein_tool");                  -value => "use_protein_tool");
425      my $url = $cgi->self_url();      my $url = $cgi->url(-relative => 1, -query => 1, -path_info => 1);
426    
427      if (open(TMP,"<$FIG_Config::global/LinksToTools")) {      if (open(TMP,"<$FIG_Config::global/LinksToTools")) {
428          my $col_hdrs = ["Tool","Description"];          my $col_hdrs = ["Tool","Description"];
# Line 475  Line 476 
476    
477      my $prot = $cgi->param('prot');      my $prot = $cgi->param('prot');
478      my $sprout = $cgi->param('SPROUT');      my $sprout = $cgi->param('SPROUT');
479      my $link = $cgi->url() . "?request=show_coupling_evidence&prot=$prot&to=$neigh&SPROUT=$sprout";      my $link = $cgi->url(-relative => 1) . "?request=show_coupling_evidence&prot=$prot&to=$neigh&SPROUT=$sprout";
480      return "<a href=$link>$sc</a>";      return "<a href=$link>$sc</a>";
481  }  }
482    
# Line 525  Line 526 
526  sub print_services {  sub print_services {
527      my($fig_or_sprout,$cgi,$html,$peg,$has_translation,$fc_data) = @_;      my($fig_or_sprout,$cgi,$html,$peg,$has_translation,$fc_data) = @_;
528    
529      my $baseurl=$FIG_Config::cgi_base;  #    my $baseurl=$FIG_Config::cgi_base;
530      my $link1 = $cgi->self_url() . "&request=view_annotations";  # Old base    my $base = $cgi->self_url();
531      my $link2 = $cgi->self_url() . "&request=view_all_annotations";  
532        my $baseurl = ".";
533    
534        my $base = $cgi->url(-relative => 1, -query => 1, -path_info => 1);
535        my $link1 = "$base&request=view_annotations";
536        my $link2 = "$base&request=view_all_annotations";
537    
538      #      #
539      # Since one cannot annotate in SPROUT, don't show this help.      # Since one cannot annotate in SPROUT, don't show this help.
# Line 546  Line 552 
552          push(@$html, "<br/>".&FIGGenDB::importOrganismGenDB($peg));          push(@$html, "<br/>".&FIGGenDB::importOrganismGenDB($peg));
553      }      }
554    
555      my $link = $cgi->self_url() . "&request=aa_sequence";      my $link = $cgi->url(-relative => 1, -query => 1, -path_info => 1) . "&request=aa_sequence";
556      push(@$html,"<br><a href=$link>Protein Sequence</a>\n");      push(@$html,"<br><a href=$link>Protein Sequence</a>\n");
557    
558      $link = $cgi->self_url() . "&request=dna_sequence";      $link = $cgi->url(-relative => 1, -query => 1, -path_info => 1) . "&request=dna_sequence";
559      push(@$html,"<br><a href=$link>DNA Sequence</a><br>\n");      push(@$html,"<br><a href=$link>DNA Sequence</a><br>\n");
560    
561      $link = $cgi->url();      $link = $cgi->url(-relative => 1);
562      $link =~ s/protein.cgi/fid_checked.cgi/;      $link =~ s/protein.cgi/fid_checked.cgi/;
563      my $sprout = $cgi->param('SPROUT') ? 1 : "";      my $sprout = $cgi->param('SPROUT') ? 1 : "";
564      my $user = $cgi->param('user');      my $user = $cgi->param('user');
# Line 568  Line 574 
574          my($cid,@fams);          my($cid,@fams);
575          if (($cid = $fig_or_sprout->prot_to_cid($prot)) && (@fams = $fig_or_sprout->in_family($cid)) && (@fams > 0))          if (($cid = $fig_or_sprout->prot_to_cid($prot)) && (@fams = $fig_or_sprout->in_family($cid)) && (@fams > 0))
576          {          {
577              $link = $cgi->url();              $link = $cgi->url(-relative => 1);
578              $link =~ s/protein.cgi/proteinfamilies.cgi/;              $link =~ s/protein.cgi/proteinfamilies.cgi/;
579              $link = $link . "?prot=$prot";              $link = $link . "?prot=$prot";
580              push(@$html,"<a href=$link target=protein_families$$>To Compare Protein Families Containing this PEG</a>\n");              push(@$html,"<a href=$link target=protein_families$$>To Compare Protein Families Containing this PEG</a>\n");
# Line 576  Line 582 
582    
583          my $fc = $cgi->param('fc');          my $fc = $cgi->param('fc');
584          if ((! $fc) && (&feature_locationS($fig_or_sprout,$peg))) {          if ((! $fc) && (&feature_locationS($fig_or_sprout,$peg))) {
585              my $link = $cgi->self_url() . "&fc=1";              my $link = $cgi->url(-relative => 1, -query => 1, -path_info => 1) . "&fc=1";
586              push(@$html,"<br><a href=$link>To Get Detailed Functional Coupling Data</a>\n");              push(@$html,"<br><a href=$link>To Get Detailed Functional Coupling Data</a>\n");
587          } elsif ($fc) {          } elsif ($fc) {
588              &print_fc($fig_or_sprout,$cgi,$html,$peg,$fc_data);              &print_fc($fig_or_sprout,$cgi,$html,$peg,$fc_data);
589          }          }
590    
591          my $link = $cgi->self_url() . "&request=fusions";          my $link = $cgi->url(-relative => 1, -query => 1, -path_info => 1) . "&request=fusions";
592          push(@$html,"<br><a href=$link>To Get Fusion Data</a>\n");          push(@$html,"<br><a href=$link>To Get Fusion Data</a>\n");
593    
594          my $link = &cgi_url . "/homologs_in_clusters.cgi?prot=$peg&user=$user\n";          my $link = &cgi_url . "/homologs_in_clusters.cgi?prot=$peg&user=$user\n";
# Line 590  Line 596 
596      }      }
597    
598      if ((! $cgi->param('compare_region')) && $has_translation) {      if ((! $cgi->param('compare_region')) && $has_translation) {
599          my $link = $cgi->self_url() . "&compare_region=1";          my $link = $cgi->url(-relative => 1, -query => 1, -path_info => 1) . "&compare_region=1";
600          push(@$html,"<br><a href=$link>To Compare Region</a> &nbsp;");          push(@$html,"<br><a href=$link>To Compare Region</a> &nbsp;");
601          push(@$html,"<A href=\"Html/compare_regions.html\" target=\"SEED_or_SPROUT_help\">[Help]</A><br />\n");          push(@$html,"<A href=\"Html/compare_regions.html\" target=\"SEED_or_SPROUT_help\">[Help]</A><br />\n");
602      } elsif ($cgi->param('compare_region')) {      } elsif ($cgi->param('compare_region')) {
# Line 645  Line 651 
651  sub print_kv_pairs {  sub print_kv_pairs {
652      my($is_sprout, $fig_or_sprout,$cgi,$html,$peg) = @_;      my($is_sprout, $fig_or_sprout,$cgi,$html,$peg) = @_;
653      my $baseurl=$FIG_Config::cgi_base;      my $baseurl=$FIG_Config::cgi_base;
654        $baseurl = "./";            # Relative url fix
655    
656      # we don't want to do this for SPROUT      # we don't want to do this for SPROUT
657      if ($is_sprout)      if ($is_sprout)
# Line 745  Line 752 
752      }      }
753      #RAE we need to check that this is a scalar      #RAE we need to check that this is a scalar
754      elsif (ref($attr[0]) eq "ARRAY") {      elsif (ref($attr[0]) eq "ARRAY") {
755         my $link=$cgi->self_url;         my $link=$cgi->url(-relative => 1, -query => 1, -path_info => 1);
756         foreach $_ (sort {$a->[0] cmp $b->[0]} @attr) {         foreach $_ (sort {$a->[0] cmp $b->[0]} @attr) {
757             my($peg,$tag,$val,$url) = @$_;             my($peg,$tag,$val,$url) = @$_;
758             #next unless ($url =~ /^http/); #RAE Turned of hiding of attributes that don't have a URL per Ross' instructions             #next unless ($url =~ /^http/); #RAE Turned of hiding of attributes that don't have a URL per Ross' instructions
# Line 832  Line 839 
839      }      }
840    
841      my $baseurl=$FIG_Config::cgi_base;      my $baseurl=$FIG_Config::cgi_base;
842        $baseurl = "./";            # relative url fix
843    
844      push @$html, "<a href=\"javascript:toggleLayer('proteinfamilies');\" title=\"Show Protein Families\">Show/Hide Protein Families</a><br>";      push @$html, "<a href=\"javascript:toggleLayer('proteinfamilies');\" title=\"Show Protein Families\">Show/Hide Protein Families</a><br>";
845      foreach my $fam (@families)      foreach my $fam (@families)
846      {      {
# Line 860  Line 869 
869      return if ($is_sprout);      return if ($is_sprout);
870    
871      # generate the link to turn protein fams on or off      # generate the link to turn protein fams on or off
872      my $link=$cgi->self_url;      my $link=$cgi->url(-relative => 1, -query => 1, -path_info => 1);
873      if ($link =~ /showproteinfams/) {      if ($link =~ /showproteinfams/) {
874       $link =~ s/[\&\;]showproteinfams.*[^\;\&]/\&/;       $link =~ s/[\&\;]showproteinfams.*[^\;\&]/\&/;
875       push @$html, "< &nbsp; " . $cgi->a({href=> $link}, "Hide Protein Families");       push @$html, "< &nbsp; " . $cgi->a({href=> $link}, "Hide Protein Families");
# Line 872  Line 881 
881       foreach my $fam (@families)       foreach my $fam (@families)
882       {       {
883        my $baseurl=$FIG_Config::cgi_base;        my $baseurl=$FIG_Config::cgi_base;
884          $baseurl = './';          # Relative url fix
885        my $link="<a href='$baseurl/proteinfamilies.cgi?user=$user&family=$fam'>$fam</a>";        my $link="<a href='$baseurl/proteinfamilies.cgi?user=$user&family=$fam'>$fam</a>";
886        push @$tab, [$link, &family_function($fig_or_sprout, $fam), &sz_family($fig_or_sprout, $fam)];        push @$tab, [$link, &family_function($fig_or_sprout, $fam), &sz_family($fig_or_sprout, $fam)];
887       }       }
# Line 2007  Line 2017 
2017              $n = $1;              $n = $1;
2018              my $sprout = $cgi->param('SPROUT');              my $sprout = $cgi->param('SPROUT');
2019              $sprout = $sprout ? $sprout : "";              $sprout = $sprout ? $sprout : "";
2020              $link = $cgi->url() . "?prot=$fid1&user=$user&SPROUT=$sprout";              $link = $cgi->url(-relative => 1) . "?prot=$fid1&user=$user&SPROUT=$sprout";
2021          } elsif ($fid1 =~ /\.([a-z]+)\.\d+$/) {          } elsif ($fid1 =~ /\.([a-z]+)\.\d+$/) {
2022              $n = uc $1;              $n = uc $1;
2023              $link = "";              $link = "";
# Line 2129  Line 2139 
2139    
2140      if ($func && ((! $existing_func) || ($existing_func ne $func))) {      if ($func && ((! $existing_func) || ($existing_func ne $func))) {
2141          $cgi->delete('request');          $cgi->delete('request');
2142          $assign_url  = $cgi->self_url() . "&request=fast_assign&func=$func";  ## must encode          $assign_url  = $cgi->url(-relative => 1, -query => 1, -path_info => 1) . "&request=fast_assign&func=$func";  ## must encode
2143          $assign_link = "<a href=\"$assign_url\">&nbsp;<=&nbsp;</a>";          $assign_link = "<a href=\"$assign_url\">&nbsp;<=&nbsp;</a>";
2144      } else {      } else {
2145          $assign_link = "";          $assign_link = "";
# Line 2185  Line 2195 
2195      my @maps = &ec_to_maps($fig_or_sprout,$ec);      my @maps = &ec_to_maps($fig_or_sprout,$ec);
2196      if (@maps > 0) {      if (@maps > 0) {
2197          $cgi->delete('request');          $cgi->delete('request');
2198          my $url  = $cgi->self_url() . "&request=ec_to_maps&ec=$ec&org=$org";          my $url  = $cgi->url(-relative => 1, -query => 1, -path_info => 1) . "&request=ec_to_maps&ec=$ec&org=$org";
2199          my $link = "<a href=\"$url\">$ec</a>";          my $link = "<a href=\"$url\">$ec</a>";
2200          return $link;          return $link;
2201      }      }
# Line 2214  Line 2224 
2224      my($cgi,$map) = @_;      my($cgi,$map) = @_;
2225    
2226      $cgi->delete('request');      $cgi->delete('request');
2227      my $url  = $cgi->self_url() . "&request=link_to_map&map=$map";      my $url  = $cgi->url(-relative => 1, -query => 1, -path_info => 1) . "&request=link_to_map&map=$map";
2228      my $link = "<a href=\"$url\">$map</a>";      my $link = "<a href=\"$url\">$map</a>";
2229      return $link;      return $link;
2230  }  }
# Line 2687  Line 2697 
2697    
2698      my $prot = $cgi->param('prot');      my $prot = $cgi->param('prot');
2699      $cgi->delete('prot');      $cgi->delete('prot');
2700      my $url  = $cgi->self_url() . "&prot=$peg&compare_region=1";      my $url  = $cgi->url(-relative => 1, -query => 1, -path_info => 1) . "&prot=$peg&compare_region=1";
2701      $cgi->delete('prot');      $cgi->delete('prot');
2702      $cgi->param(-name => 'prot', -value => $prot);      $cgi->param(-name => 'prot', -value => $prot);
2703    
# Line 2778  Line 2788 
2788                   assign_for_equiv_prots => [],                   assign_for_equiv_prots => [],
2789                   javascript            => [],                   javascript            => [],
2790                   compare_region        => [],                   compare_region        => [],
2791                   location_tag => [uri_escape($cgi->self_url())],                   location_tag => [uri_escape($cgi->url(-absolute => 1, -full => 1, -query => 1, -path_info => 1))],
2792                 );                 );
2793    
2794      push(@{$html{general}},@$html);      push(@{$html{general}},@$html);
# Line 2791  Line 2801 
2801      my($fig_or_sprout,$cgi,$html) = @_;      my($fig_or_sprout,$cgi,$html) = @_;
2802    
2803      my $msg;      my $msg;
2804      my $url = $cgi->self_url();      my $url = $cgi->url(-relative => 1, -query => 1, -path_info => 1);
2805      if ($cgi->param('translate')) {      if ($cgi->param('translate')) {
2806          $url =~ s/[;&]translate(=[^;&])?//i or $url =~ s/translate(=[^;&])?[;&]//i;          $url =~ s/[;&]translate(=[^;&])?//i or $url =~ s/translate(=[^;&])?[;&]//i;
2807          $msg = "Turn Off Function Translation";          $msg = "Turn Off Function Translation";

Legend:
Removed from v.1.160  
changed lines
  Added in v.1.161

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3