[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.118, Mon Jun 20 04:03:44 2005 UTC revision 1.119, Thu Jun 23 21:24:49 2005 UTC
# Line 540  Line 540 
540          push(@$html,"<br><a href=$link target=checked_window>To Make an Annotation</a>\n");          push(@$html,"<br><a href=$link target=checked_window>To Make an Annotation</a>\n");
541      }      }
542    
     #  Isn't this redundant?  Look up about 9 lines. -- GJO  
   
     my $sprout = $cgi->param('SPROUT') ? 1 : "";  
543      if (! $sprout)      if (! $sprout)
544      {      {
545          my $fc = $cgi->param('fc');          my $fc = $cgi->param('fc');
# Line 1695  Line 1692 
1692    
1693      my $fc_sc;      my $fc_sc;
1694      foreach $fid1 (@$feat) {      foreach $fid1 (@$feat) {
1695          my $best_clusters_link = "<a href=" . &cgi_url . "/homologs_in_clusters.cgi?prot=$fid1&user=$user><img src=\"Html/button-cl.png\" border=\"0\"></a>";          my $best_clusters_link = "<a href=" . &cgi_url . "/homologs_in_clusters.cgi?prot=$fid1&user=$user&SPROUT=$sprout><img src=\"Html/button-cl.png\" border=\"0\"></a>";
1696          if (defined($fc_sc = $in_cluster->{$fid1}))          if (defined($fc_sc = $in_cluster->{$fid1}))
1697          {          {
1698              $fc = &pin_link($cgi,$fid1);              $fc = &pin_link($cgi,$fid1);
# Line 1833  Line 1830 
1830      my $user = $cgi->param('user');      my $user = $cgi->param('user');
1831      $user = defined($user) ? $user : "";      $user = defined($user) ? $user : "";
1832    
 # RAO disconnect SPROUT from pinning requests until chromosomal_clusters.cgi is rewritten  
1833      my $sprout = $cgi->param('SPROUT') ? 1 : "";      my $sprout = $cgi->param('SPROUT') ? 1 : "";
1834      my $cluster_url  = "chromosomal_clusters.cgi?prot=$peg&user=$user&uni=1"; # &SPROUT=$sprout";      my $cluster_url  = "chromosomal_clusters.cgi?prot=$peg&user=$user&uni=1&SPROUT=$sprout";
1835    
1836      my $cluster_img = 0 ? "*" : '<img src="Html/button-pins-1.png" border="0">';      my $cluster_img = 0 ? "*" : '<img src="Html/button-pins-1.png" border="0">';
1837      my $cluster_link = "<a href=\"$cluster_url\" target=pinned_region.$$>$cluster_img</a>";      my $cluster_link = "<a href=\"$cluster_url\" target=pinned_region.$$>$cluster_img</a>";
# Line 2010  Line 2006 
2006          @closest_pegs = &sort_fids_by_taxonomy($fig_or_sprout,@closest_pegs);          @closest_pegs = &sort_fids_by_taxonomy($fig_or_sprout,@closest_pegs);
2007          unshift(@closest_pegs,$peg);          unshift(@closest_pegs,$peg);
2008          my @all_pegs = ();          my @all_pegs = ();
2009    
2010          my $gg = &build_maps($fig_or_sprout,\@closest_pegs,\@all_pegs,$sz_region);          my $gg = &build_maps($fig_or_sprout,\@closest_pegs,\@all_pegs,$sz_region);
2011          #warn Dumper($gg);          #warn Dumper($gg);
2012          my $color_sets = &cluster_genes($fig_or_sprout,$cgi,\@all_pegs,$peg);          my $color_sets = &cluster_genes($fig_or_sprout,$cgi,\@all_pegs,$peg);
# Line 2106  Line 2103 
2103      }      }
2104      else      else
2105      {      {
2106          @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),1.0e-20);          @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));
2107      }      }
2108    
2109      if (@closest > $n) { $#closest = $n-1 }      if (@closest > $n) { $#closest = $n-1 }
# Line 2478  Line 2475 
2475    
2476    
2477  #######################################################################################  #######################################################################################
2478    sub sims {
2479        my( $fig_or_sprout, $peg, $max, $cutoff, $select, $expand, $group_by_genome, $filters ) = @_;
2480        my( @tmp, $id, $genome, @genomes, %sims, $sim );
2481    
2482        @tmp = $fig_or_sprout->sims( $peg, $max, $cutoff, $select, $expand, $filters );
2483        if (! $group_by_genome)  { return @tmp };
2484    
2485        #  Collect all sims from genome with the first occurance of the genome:
2486    
2487        foreach $sim ( @tmp )
2488        {
2489            $id = $sim->id2;
2490            $genome = ($id =~ /^fig\|(\d+\.\d+)\.peg\.\d+/) ? $1 : $id;
2491            if (! defined( $sims{ $genome } ) ) { push @genomes, $genome }
2492            push @{ $sims{ $genome } }, $sim;
2493        }
2494        return map { @{ $sims{$_} } } @genomes;
2495    }

Legend:
Removed from v.1.118  
changed lines
  Added in v.1.119

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3