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

Diff of /FigWebServices/genome_statistics.cgi

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

revision 1.8, Mon Jan 10 13:09:01 2005 UTC revision 1.9, Fri Jan 14 13:56:37 2005 UTC
# Line 42  Line 42 
42    
43  my @genomes = $cgi->param('genome');  my @genomes = $cgi->param('genome');
44  my $request = $cgi->param('request');  my $request = $cgi->param('request');
45  if ((@genomes == 0) && (! $request))  
46    if ($request eq "subsystems_summary")
47    {
48        &subsys_summary($fig,$cgi,$html);
49    }
50    elsif ((@genomes == 0) && (! $request))
51  {  {
52      &table_of_genomes($fig,$cgi,$html);      &table_of_genomes($fig,$cgi,$html);
53  }  }
# Line 312  Line 317 
317  }  }
318    
319    
320    sub subsys_summary {
321        my($fig,$cgi,$html) = @_;
322        my($Nsubs,$genome,$sub,$role,$peg,$genome_instances,%genomes_in_use,$peg_instances,%pegs_in_use);
323        foreach $sub ($fig->all_subsystems)
324        {
325            $Nsubs++;
326            foreach $genome (map { $_->[0] } @{$fig->subsystem_genomes($sub)})
327            {
328                $genome_instances++;
329                $genomes_in_use{$genome}++;
330                foreach $role ($fig->subsystem_to_roles($sub))
331                {
332                    foreach $peg ($fig->pegs_in_subsystem_cell($sub,$genome,$role))
333                    {
334                        $peg_instances++;
335                        $pegs_in_use{$peg}++;
336                    }
337                }
338            }
339        }
340        my $Ngenomes = scalar keys(%genomes_in_use);
341        my $Npegs    = scalar keys(%pegs_in_use);
342        my $g_in_sub = int($genome_instances / $Nsubs);
343        my $p_in_sub = int($peg_instances / $Nsubs);
344        push(@$html,$cgi->h1('Subsystem Summary'));
345        push(@$html,$cgi->br,
346                    "<b>Number Subsystems:</b> $Nsubs",$cgi->br,
347                    "<b>Genomes in Subsystems:</b> $Ngenomes",$cgi->br,
348                    "<b>PEGs in Subsystems:</b> $Npegs",$cgi->br,
349                    "<b>Avg genomes per subsystem:</b> $g_in_sub",$cgi->br,
350                    "<b>Avg PEGs per subsystem:</b> $p_in_sub",$cgi->br
351             );
352        return
353    
354    }

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.9

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3