[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.80, Mon Jan 31 07:29:39 2005 UTC revision 1.81, Thu Feb 3 22:45:38 2005 UTC
# Line 347  Line 347 
347          my $min = &max(0,&min($beg,$end) - $half_sz);          my $min = &max(0,&min($beg,$end) - $half_sz);
348          my $max = &max($beg,$end) + $half_sz;          my $max = &max($beg,$end) + $half_sz;
349          Trace("display_peg: min=$min max=$max beg=$beg end=$end") if T(2);          Trace("display_peg: min=$min max=$max beg=$beg end=$end") if T(2);
350          my($feat,$min,$max) = &genes_in_region($fig_or_sprout,&genome_of($peg),$contig,$min,$max);          my($feat,$min,$max) = &genes_in_region($fig_or_sprout,$cgi,&genome_of($peg),$contig,$min,$max);
351          Trace("beg=$beg end=$end New min = $min, max = $max, features = " . join(", ", @{$feat})) if T(3);          Trace("beg=$beg end=$end New min = $min, max = $max, features = " . join(", ", @{$feat})) if T(3);
352    
353          my ($beg,$end,$genes) = &print_context($fig_or_sprout,$cgi,$html->{contig_context},$peg,$feat,$min,$max);          my ($beg,$end,$genes) = &print_context($fig_or_sprout,$cgi,$html->{contig_context},$peg,$feat,$min,$max);
# Line 1471  Line 1471 
1471    
1472      if ($beg eq $end) { cluck "Have zero len"; }      if ($beg eq $end) { cluck "Have zero len"; }
1473      my($contig1,$beg1,$end1,$strand,$max_so_far,$gap,$comment,$fc,$aliases);      my($contig1,$beg1,$end1,$strand,$max_so_far,$gap,$comment,$fc,$aliases);
1474      my($why_related,$fid1,$sz,$color,$map,$gg,$n,$link,$in_neighborhood);      my($fid1,$sz,$color,$map,$gg,$n,$link,$in_neighborhood);
1475    
1476    
1477      my $user = $cgi->param('user');      my $user = $cgi->param('user');
# Line 1482  Line 1482 
1482                  $cgi->hidden(-name => "uni", -value => 1),                  $cgi->hidden(-name => "uni", -value => 1),
1483                  $cgi->hidden(-name => "user", -value => $user));                  $cgi->hidden(-name => "user", -value => $user));
1484    
     $why_related = " ";  
1485      my %in_cluster = map { $_ => 1 } &in_cluster_with($fig_or_sprout,$peg);      my %in_cluster = map { $_ => 1 } &in_cluster_with($fig_or_sprout,$peg);
1486    
1487      my $col_hdrs;      my $col_hdrs;
1488      if ($cgi->param('SPROUT'))      if ($cgi->param('SPROUT'))
1489      {      {
1490          $col_hdrs = ["fid","starts","ends","size","","gap","req.<br>in<br>pin","fc","neigh","comment","","","aliases","Related"];          $col_hdrs = ["fid","starts","ends","size","","gap","req.<br>in<br>pin","fc","neigh","comment","","","aliases"];
1491      }      }
1492      else      else
1493      {      {
1494          $col_hdrs = ["fid","starts","ends","size","","gap","req.<br>in<br>pin","fc","neigh","comment","aliases","Related"];          $col_hdrs = ["fid","starts","ends","size","","gap","req.<br>in<br>pin","fc","neigh","comment","aliases"];
1495      }      }
1496    
1497      my($tab) = [];      my($tab) = [];
# Line 1593  Line 1592 
1592                          $comment,                          $comment,
1593                          "<a href=$to_seed>S</a>",                          "<a href=$to_seed>S</a>",
1594                          "<a href=$to_gbrowse>G</a>",                          "<a href=$to_gbrowse>G</a>",
1595                          $aliases,                          $aliases]);
                         $why_related]);  
1596          }          }
1597          else          else
1598          {          {
# Line 1602  Line 1600 
1600                          $must_have,                          $must_have,
1601                          $fc,$in_neighborhood,                          $fc,$in_neighborhood,
1602                          $comment,                          $comment,
1603                          $aliases,                          $aliases]);
                         $why_related]);  
1604          }          }
1605      }      }
1606      push(@$html,&HTML::make_table($col_hdrs,$tab,"Context on contig $contig1"));      push(@$html,&HTML::make_table($col_hdrs,$tab,"Context on contig $contig1"));
# Line 1923  Line 1920 
1920              $min = int($mid - ($sz_region / 2));              $min = int($mid - ($sz_region / 2));
1921              $max = int($mid + ($sz_region / 2));              $max = int($mid + ($sz_region / 2));
1922              $genes = [];              $genes = [];
1923              ($feat,undef,undef) = &genes_in_region($fig_or_sprout,&genome_of($peg),$contig,$min,$max);              ($feat,undef,undef) = &genes_in_region($fig_or_sprout,$cgi,&genome_of($peg),$contig,$min,$max);
1924              foreach $fid (@$feat) {              foreach $fid (@$feat) {
1925                  ($contig1,$beg1,$end1) = &boundaries_of($fig_or_sprout,&feature_locationS($fig_or_sprout,$fid));                  ($contig1,$beg1,$end1) = &boundaries_of($fig_or_sprout,&feature_locationS($fig_or_sprout,$fid));
1926                  $beg1 = &in_bounds($min,$max,$beg1);                  $beg1 = &in_bounds($min,$max,$beg1);
# Line 2409  Line 2406 
2406  }  }
2407    
2408  sub genes_in_region {  sub genes_in_region {
2409      my($fig_or_sprout,$genome,$contig,$min,$max) = @_;      my($fig_or_sprout,$cgi,$genome,$contig,$min,$max) = @_;
2410    
2411        if ($cgi->param('SPROUT'))
2412        {
2413            my($x,$feature_id);
2414            my($feat,$min,$max) = $fig_or_sprout->genes_in_region($genome,$contig,$min,$max);
2415            my @tmp =  sort { ($a->[1] cmp $b->[1]) or
2416                                  (($a->[2]+$a->[3]) <=> ($b->[2]+$b->[3]))
2417                            }
2418                            map  { $feature_id = $_;
2419                                   $x = &feature_locationS($fig_or_sprout,$feature_id);
2420                                   $x ? [$feature_id,&boundaries_of($fig_or_sprout,$x)] : ()
2421                            }
2422                            @$feat;
2423            return ([map { $_->[0] } @tmp],$min,$max);
2424        }
2425        else
2426        {
2427      return $fig_or_sprout->genes_in_region($genome,$contig,$min,$max);      return $fig_or_sprout->genes_in_region($genome,$contig,$min,$max);
2428  }  }
2429    }
2430    
2431  sub translate_function {  sub translate_function {
2432      my($fig_or_sprout,$func) = @_;      my($fig_or_sprout,$func) = @_;

Legend:
Removed from v.1.80  
changed lines
  Added in v.1.81

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3