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

Diff of /FigWebServices/pir.cgi

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

revision 1.11, Sat Feb 12 02:06:37 2005 UTC revision 1.12, Sat Feb 12 02:22:01 2005 UTC
# Line 55  Line 55 
55    
56    
57  if ($cgi->param('tabulate')) {  if ($cgi->param('tabulate')) {
  print STDERR "Starting the tabulations at ", time, "\n";  
58   $html=&table_annotations($html, $pegbypir, $pirid);   $html=&table_annotations($html, $pegbypir, $pirid);
  print STDERR "Done with the tabulations at ", time, "\n";  
59   push @$html, $cgi->p({class=>"diagnostic"}, ("<small>Generating this table took approximately " . (time-$^T) . " seconds\n</small>"));   push @$html, $cgi->p({class=>"diagnostic"}, ("<small>Generating this table took approximately " . (time-$^T) . " seconds\n</small>"));
60  }  }
61  elsif ($cgi->param('pirsf')) {  elsif ($cgi->param('pirsf')) {
# Line 209  Line 207 
207    
208  sub table_annotations {  sub table_annotations {
209   my ($html, $pegbypir, $pirid)=@_;   my ($html, $pegbypir, $pirid)=@_;
210   my $count; my $subsystems;   my $count; my $subsystems; my $countinss;
211   foreach my $sf (keys %$pegbypir) {   foreach my $sf (keys %$pegbypir) {
212    my $function; my $ss;    my $function; my $ss; my $functionandss;
213    foreach my $peg (@{$pegbypir->{$sf}}) {    foreach my $peg (@{$pegbypir->{$sf}}) {
214     $function->{scalar $fig->function_of($peg)}++;     my $function=scalar $fig->function_of($peg);
215     foreach my $subsys ($fig->subsystems_for_peg($peg)) {$ss->{$$subsys[0]}++}     foreach my $subsys ($fig->subsystems_for_peg($peg)) {$ss->{$$subsys[0]}++}
216       $function->{$function}++;
217       $functionandss->{$function}++ if (scalar keys %$ss);
218    }    }
219    $subsystems->{$sf}=join "; ", keys %$ss;    $subsystems->{$sf}=join "; ", keys %$ss;
220    $count->{$sf}=scalar keys %$function;    $count->{$sf}=scalar keys %$function;
221      $countinss->{$sf}=scalar keys %$functionandss;
222   }   }
223    
224   my $col_hdrs = ["Number of SEED annotations in a Superfamily", "PIRSF<br><small>(Link goes to SEED/PIR comparison)</small>",   my $col_hdrs = ["Number of annotations in subsystems", "Number of SEED annotations", "PIRSF<br><small>(Link goes to SEED/PIR comparison)</small>",
225                   "Superfamily name", "Subsystems in superfamily"];                   "Superfamily name", "Subsystems in superfamily"];
226   my $tab; my $lastcount; my $row;   my $tab; my $lastcount; my $row;
227   # note we are going to make a new table every 200 rows because that way the browsers don't get messed up   # note we are going to make a new table every 200 or so rows because that way the browsers don't get messed up. We actually increment between two identical counts
228   foreach my $sf (sort {$count->{$b} <=> $count->{$a}} keys %$count) {   my @superfamilies=sort {$countinss->{$b} <=> $countinss->{$a}} keys %$count;
229     if ($cgi->param('totalsort')) {@superfamilies=sort {$count->{$b} <=> $count->{$a}} keys %$count}
230     foreach my $sf (@superfamilies) {
231      next if ($cgi->param('onlyss') && !($countinss->{$sf}));
232    $row++;    $row++;
233    if ($lastcount ne $count->{$sf}) {    if ($lastcount ne $count->{$sf}) {
234     $lastcount=$count->{$sf};     $lastcount=$count->{$sf};
235     if ($tab && $row > 50) {     if ($tab && ($row > 200)) {
236      push(@$html,&HTML::make_table($col_hdrs,$tab,""));      push(@$html,&HTML::make_table($col_hdrs,$tab,""));
     print STDERR "Added to html at $lastcount\n";  
237      $row=0;      $row=0;
238      undef $tab;      undef $tab;
239     }     }
# Line 242  Line 245 
245     $subsystems->{$sf},     $subsystems->{$sf},
246    ];    ];
247   }   }
  print STDERR "Added to html last time\n";  
248   push(@$html,&HTML::make_table($col_hdrs,$tab,""));   push(@$html,&HTML::make_table($col_hdrs,$tab,""));
249   return $html;   return $html;
250  }  }

Legend:
Removed from v.1.11  
changed lines
  Added in v.1.12

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3