[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.150, Thu Sep 8 15:38:23 2005 UTC revision 1.151, Sat Sep 10 15:10:24 2005 UTC
# Line 2283  Line 2283 
2283          my $color_sets = &cluster_genes($fig_or_sprout,$cgi,\@all_pegs,$peg);          my $color_sets = &cluster_genes($fig_or_sprout,$cgi,\@all_pegs,$peg);
2284          &set_colors_text_and_links($gg,\@all_pegs,$color_sets);          &set_colors_text_and_links($gg,\@all_pegs,$color_sets);
2285          ################################### add commentary capability          ################################### add commentary capability
   
         my @parm_reset_form = ($cgi->hr);  
         push(@parm_reset_form,$cgi->start_form(-action => &cgi_url . "/protein.cgi" ));  
         my $param;  
         foreach $param ($cgi->param()) {  
             next if (($param eq "sz_region") || ($param eq "num_close"));  
             push(@parm_reset_form,$cgi->hidden(-name => $param, -value => $cgi->param($param)));  
         }  
         push(@parm_reset_form,  
                        "size region: ",  
                    $cgi->textfield(-name => 'sz_region', -size =>  10, -value => $sz_region, -override => 1),  
                    "          ",  
                    "Number close genomes: ",  
                    $cgi->textfield(-name => 'num_close', -size => 4, -value => $num_close, -override => 1),  
                    $cgi->br,  
                    $cgi->submit('Resubmit')  
              );  
         push(@parm_reset_form,$cgi->end_form);  
         push(@$html,@parm_reset_form);  
     ####  
         my @commentary_form = ();  
         my $ctarget = "window$$";  
2286          my $user = $cgi->param('user');          my $user = $cgi->param('user');
2287          my $sprout = $cgi->param('SPROUT') ? 1 : "";          my $sprout = $cgi->param('SPROUT') ? 1 : "";
2288    
         push(@commentary_form,$cgi->start_form(-target => $ctarget,  
                                -action => &cgi_url . "/chromosomal_clusters.cgi"  
                                ));  
   
         push(@commentary_form,$cgi->hidden(-name => 'SPROUT', -value => $sprout),  
                                   $cgi->hidden(-name => "request", -value => "show_commentary"));  
         push(@commentary_form,$cgi->hidden(-name => "prot", -value => $peg));  
         push(@commentary_form,$cgi->hidden(-name => "uni", -value => 1));  
         push(@commentary_form,$cgi->hidden(-name => "user", -value => $user));  
   
2289          my($gene,$n,%how_many,$val,@vals,$x);          my($gene,$n,%how_many,$val,@vals,$x);
2290          my($i,$map);          my($i,$map);
2291          @vals = ();          @vals = ();
# Line 2346  Line 2314 
2314              }              }
2315          }          }
2316    
2317          if (@$gg == 0) {          if (@$gg < 2) {
2318              push(@$html,$cgi->h1("Sorry, no pins worked out"));              push(@$html,$cgi->h3("No alignable regions in close genomes"));
2319          } else {          } else {
2320    
2321                my @parm_reset_form = ($cgi->hr);
2322                push(@parm_reset_form,$cgi->start_form(-action => &cgi_url . "/protein.cgi" ));
2323                my $param;
2324                foreach $param ($cgi->param()) {
2325                    next if (($param eq "sz_region") || ($param eq "num_close"));
2326                    push(@parm_reset_form,$cgi->hidden(-name => $param, -value => $cgi->param($param)));
2327                }
2328                push(@parm_reset_form,
2329                                      "size region: ",
2330                                      $cgi->textfield(-name => 'sz_region', -size =>  10, -value => $sz_region, -override => 1),
2331                                      "&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ",
2332                                      "Number genomes: ",
2333                                      $cgi->textfield(-name => 'num_close', -size => 4, -value => $num_close, -override => 1),
2334                                      $cgi->br,
2335                                      $cgi->submit('Resubmit')
2336                    );
2337                push(@parm_reset_form,$cgi->end_form);
2338                push(@$html,@parm_reset_form);
2339                ####
2340                my @commentary_form = ();
2341                my $ctarget = "window$$";
2342                push(@commentary_form,$cgi->start_form(-target => $ctarget,
2343                                                       -action => &cgi_url . "/chromosomal_clusters.cgi"
2344                                                       ));
2345    
2346                push(@commentary_form,$cgi->hidden(-name => 'SPROUT', -value => $sprout),
2347                                      $cgi->hidden(-name => "request", -value => "show_commentary"));
2348                push(@commentary_form,$cgi->hidden(-name => "prot", -value => $peg));
2349                push(@commentary_form,$cgi->hidden(-name => "uni", -value => 1));
2350                push(@commentary_form,$cgi->hidden(-name => "user", -value => $user));
2351              push(@commentary_form,$cgi->hidden(-name => "show", -value => [@vals]));              push(@commentary_form,$cgi->hidden(-name => "show", -value => [@vals]));
2352              push(@commentary_form,$cgi->submit('commentary'));              push(@commentary_form,$cgi->submit('commentary'));
2353              push(@commentary_form,$cgi->end_form());              push(@commentary_form,$cgi->end_form());
2354              push(@$html,@commentary_form);              push(@$html,@commentary_form);
         }  
         ################################################################end commentary  
2355          push(@$html,@{ &GenoGraphics::render($gg,700,4,0,2) });          push(@$html,@{ &GenoGraphics::render($gg,700,4,0,2) });
2356            }
2357    
2358          if (! $cgi->param('SPROUT'))          if (! $cgi->param('SPROUT'))
2359          {          {
2360              push @$html, &FIGGenDB::linkClusterGenDB($peg);              push @$html, &FIGGenDB::linkClusterGenDB($peg);
2361          }          }
2362      }      }
2363        else
2364        {
2365            push(@$html,$cgi->h3("No alignable regions in close genomes"));
2366        }
2367  }  }
2368    
2369  sub closest_pegs {  sub closest_pegs {
# Line 2376  Line 2379 
2379      {      {
2380          @closest = map { $id2 = $_->id2; ($id2 =~ /^fig\|/) ? $id2 : () } &sims($fig_or_sprout,$peg,&FIG::max(20,$n*4),1.0e-20,"fig",&FIG::max(20,$n*4));          @closest = map { $id2 = $_->id2; ($id2 =~ /^fig\|/) ? $id2 : () } &sims($fig_or_sprout,$peg,&FIG::max(20,$n*4),1.0e-20,"fig",&FIG::max(20,$n*4));
2381      }      }
2382        if (@closest >= ($n-1))
2383      if (@closest > $n) { $#closest = $n-1 }      {
2384            $#closest = $n-2 ;
2385        }
2386        else
2387        {
2388      my %closest = map { $_ => 1 } @closest;      my %closest = map { $_ => 1 } @closest;
2389      my @pinned_to = grep { $_ ne $peg} &in_pch_pin_with($fig_or_sprout,$peg);  
2390            my @pinned_to = grep { ($_ ne $peg) && (! $closest{$_}) } &in_pch_pin_with($fig_or_sprout,$peg);
2391      my $g1 = &genome_of($peg);      my $g1 = &genome_of($peg);
2392      @pinned_to =          @pinned_to = map {$_->[1] }
         map {$_->[1] }  
2393          sort { $a->[0] <=> $b->[0] }          sort { $a->[0] <=> $b->[0] }
2394          map { $peg2 = $_; $d = &crude_estimate_of_distance($fig_or_sprout,$g1,&genome_of($peg2)); [$d,$peg2] }          map { $peg2 = $_; $d = &crude_estimate_of_distance($fig_or_sprout,$g1,&genome_of($peg2)); [$d,$peg2] }
2395          @pinned_to;          @pinned_to;
2396    
2397      for ($i=0; ($i < @pinned_to) && ($i < $n); $i++) {          for ($i=0; ($i < @pinned_to) && (@closest < ($n-1)); $i++) {
2398                if (! $closest{$pinned_to[$i]})
2399                {
2400          $closest{$pinned_to[$i]} = 1;          $closest{$pinned_to[$i]} = 1;
2401                    push(@closest,$pinned_to[$i]);
2402                }
2403            }
2404      }      }
2405      return keys(%closest);      return @closest;
2406  }  }
2407    
2408  sub build_maps {  sub build_maps {

Legend:
Removed from v.1.150  
changed lines
  Added in v.1.151

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3