[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.33, Sat Aug 7 17:55:16 2004 UTC revision 1.34, Sun Aug 8 05:25:31 2004 UTC
# Line 32  Line 32 
32      &HTML::show_page($cgi,$html);      &HTML::show_page($cgi,$html);
33      exit;      exit;
34  }  }
35  elsif ($prot !~ /^fig\|/)  
36    if ($prot !~ /^fig\|/)
37  {  {
38      if ($_ = $fig->by_alias($prot))      if ($_ = $fig->by_alias($prot))
39      {      {
# Line 47  Line 48 
48      }      }
49  }  }
50    
51  my $request = $cgi->param("request");  #
52  $request = defined($request) ? $request : "";  #  Allow previous and next actions in calls to the script -- GJO
53    #
54    
55  if    ($request eq "use_protein_tool")       { &use_protein_tool($fig,$cgi,$prot); }  my $adjust = $cgi->param('previous PEG') ? -1 : $cgi->param('next PEG') ? 1 : 0;
56    if ( $adjust ) {
57        my ( $prefix, $protnum ) = $prot =~ /^(.*\.)(\d+)$/;
58        if ( $prefix && $protnum ) {
59            my $prot2 = $prefix . ($protnum + $adjust);
60            if ( $fig->translatable( $prot2 ) ) {
61                $prot = $prot2;
62                $cgi->delete('prot');
63                $cgi->param(-name => 'prot', -value => $prot);
64            }
65        }
66        ( $adjust < 0 ) && $cgi->delete('previous PEG');
67        ( $adjust > 0 ) && $cgi->delete('next PEG');
68    }
69    
70    my $request = $cgi->param("request") || "";
71    
72    if    ($request eq "use_protein_tool")       { &use_protein_tool($fig,$cgi,$html,$prot); }
73  elsif ($request eq "view_annotations")       { &view_annotations($fig,$cgi,$html,$prot); }  elsif ($request eq "view_annotations")       { &view_annotations($fig,$cgi,$html,$prot); }
74  elsif ($request eq "view_all_annotations")   { &view_all_annotations($fig,$cgi,$html,$prot); }  elsif ($request eq "view_all_annotations")   { &view_all_annotations($fig,$cgi,$html,$prot); }
75  elsif ($request eq "aa_sequence")            { &aa_sequence($fig,$cgi,$html,$prot); }  elsif ($request eq "aa_sequence")            { &aa_sequence($fig,$cgi,$html,$prot); }
# Line 70  Line 89 
89  #==============================================================================  #==============================================================================
90    
91  sub use_protein_tool {  sub use_protein_tool {
92      my($fig,$cgi,$prot) = @_;      my($fig,$cgi,$html,$prot) = @_;
93      my($url,$method,@args,$line,$name,$val);      my($url,$method,@args,$line,$name,$val);
94    
95      my $seq = $fig->get_translation($prot);      my $seq = $fig->get_translation($prot);
# Line 353  Line 372 
372          my $show_env   = $cgi->param('show_env')   ||  0;          my $show_env   = $cgi->param('show_env')   ||  0;
373          my $hide_alias = $cgi->param('hide_alias') ||  0;          my $hide_alias = $cgi->param('hide_alias') ||  0;
374    
375          push( @$html, $cgi->start_form(-action => "protein.cgi"));          push( @$html, $cgi->start_form(-action => "protein.cgi#Similarities"));
376          if ($cgi->param('translate'))          if ($cgi->param('translate'))
377          {          {
378              push(@$html,$cgi->hidden(-name => 'translate', -value => 1));              push(@$html,$cgi->hidden(-name => 'translate', -value => 1));
# Line 592  Line 611 
611      my $show_env   = $cgi->param('show_env')   || 0;      my $show_env   = $cgi->param('show_env')   || 0;
612      my $hide_alias = $cgi->param('hide_alias') || 0;      my $hide_alias = $cgi->param('hide_alias') || 0;
613    
614      push(@$html,"<hr>\n");      push( @$html, $cgi->hr,
615                      "<a name=Similarities>",
616                      $cgi->h1('Similarities'),
617                      "</a>\n"
618            );
619    
620      push(@$html, $cgi->h1('Similarities'),      #
621                   $cgi->start_form(-action => "protein.cgi"),      #  Instead of automatically doubling maxN, use the value of
622        #  $cgi->param("more similarities") to drive increase in maxN and
623        #  max_expand
624        #
625        if ( $cgi->param('more similarities') ) {
626            $maxN       *= 2;
627            $max_expand *= 2;
628            $cgi->delete('more similarities');
629        }
630    
631        my ( $prev, $next ) = ( 0, 0 );
632        my ( $prefix, $protnum ) = $peg =~ /^(.*\.)(\d+)$/;
633        if ( $prefix && $protnum ) {
634            $prev = ( $protnum > 1 ) && $fig->translatable( $prefix . ($protnum-1) );
635            $next =                     $fig->translatable( $prefix . ($protnum+1) );
636        }
637    
638        push(@$html, $cgi->start_form(-action => "protein.cgi#Similarities"),
639                   $cgi->hidden(-name => 'prot', -value => $peg),                   $cgi->hidden(-name => 'prot', -value => $peg),
640                   $cgi->hidden(-name => 'sims', -value => 1),                   $cgi->hidden(-name => 'sims', -value => 1),
641                   $cgi->hidden(-name => 'fid', -value => $peg),                   $cgi->hidden(-name => 'fid', -value => $peg),
642                   $cgi->hidden(-name => 'user', -value => $user),                   $cgi->hidden(-name => 'user', -value => $user),
643                   $cgi->submit('more similarities'),                   " MaxN: ", $cgi->textfield(-name => 'maxN', -size => 5, -value => $maxN, -override => 1),
                  #  
                  # Do we want to stop automatically doubling the maxN value?  
                  # It changes the parameters out from under the user if they just  
                  # want to resubmit with new value of, for example, just_fig. -- GJO  
                  #  
                  " MaxN: ", $cgi->textfield(-name => 'maxN', -size => 5, -value => 2 * $maxN, -override => 1),  
644                   " Max expand: ", $cgi->textfield(-name => 'max_expand', -size => 5, -value => $max_expand, -override => 1),                   " Max expand: ", $cgi->textfield(-name => 'max_expand', -size => 5, -value => $max_expand, -override => 1),
645                   " MaxP: ", $cgi->textfield(-name => 'maxP', -size => 10, -value => $maxP),                   " MaxP: ", $cgi->textfield(-name => 'maxP', -size => 10, -value => $maxP),
646                   " Just FIG Ids: ", $cgi->checkbox(-name => 'just_fig', -value => 1, -checked => $just_fig, -override => 1, -label => ""),                   " Just FIG Ids: ", $cgi->checkbox(-name => 'just_fig', -value => 1, -checked => $just_fig, -override => 1, -label => ""),
647                   " Show Env. samples: ", $cgi->checkbox(-name => 'show_env', -value => 1, -checked => $show_env, -override => 1, -label => ""),                   " Show Env. samples: ", $cgi->checkbox(-name => 'show_env', -value => 1, -checked => $show_env, -override => 1, -label => ""),
648                   " Hide aliases: ", $cgi->checkbox(-name => 'hide_alias', -value => 1, -checked => $hide_alias, -override => 1, -label => ""),                   " Hide aliases: ", $cgi->checkbox(-name => 'hide_alias', -value => 1, -checked => $hide_alias, -override => 1, -label => ""),
649                   $cgi->end_form,                   $cgi->br,
650                     $prev ? $cgi->submit('previous PEG') : (),
651                   $cgi->hr                   $cgi->submit('resubmit'),
652                     $cgi->submit('more similarities'),
653                     $next ? $cgi->submit('next PEG') : (),
654                     $cgi->end_form
655           );           );
656    
657        push( @$html, $cgi->hr );
658    
659      my $select = $just_fig ? "fig" : "all";      my $select = $just_fig ? "fig" : "all";
660      my @sims = $fig->sims( $peg, $maxN, $maxP, $select, $max_expand );      my @sims = $fig->sims( $peg, $maxN, $maxP, $select, $max_expand );
661    

Legend:
Removed from v.1.33  
changed lines
  Added in v.1.34

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3