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

Diff of /FigWebServices/ss_scoreboard.cgi

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

revision 1.2, Tue May 25 16:20:41 2004 UTC revision 1.3, Tue May 25 20:00:47 2004 UTC
# Line 7  Line 7 
7  my $cgi = new CGI;  my $cgi = new CGI;
8  my $fig = new FIG();  my $fig = new FIG();
9    
10  my @subs = $fig->all_subsystems();  my @subs = sort $fig->all_subsystems();
11    
12  my %all_genomes;  my %all_genomes;
13    
14  my $html = [];  my $html = [];
15    
16    push(@$html, $cgi->start_form(-action => "ss_scoreboard.cgi",
17                                  -method => "post"));
18    #
19    # Show the selection list for limiting to family.
20    #
21    
22    my $taxonomic_groups = $fig->taxonomic_groups_of_complete(10);
23    
24    my @group_names = sort grep { $_ ne "All" } map { $_->[0] } @$taxonomic_groups;
25    
26    unshift(@group_names, "All");
27    
28    #
29    # Display in a scrolling list.
30    #
31    
32    push(@$html,
33         $cgi->h2("Limit genomes shown to group:"),
34         $cgi->scrolling_list(-name => 'limit_genome',
35                              -values => [@group_names],
36                              -size => 5,
37                              -multiple => 1),
38         );
39    
40    
41    #
42    # Determine if we're limiting genomes, and only use
43    # genomes from that group if we are.
44    #
45    
46    my @limit_genome = $cgi->param("limit_genome");
47    my %desired_genomes;
48    
49    if (grep({$_ eq "All"} @limit_genome))
50    {
51        @limit_genome = ();
52    }
53    
54    if (@limit_genome)
55    {
56        for my $limit_genome (@limit_genome)
57        {
58            my @list = grep({ $_->[0] eq $limit_genome } @$taxonomic_groups);
59            for my $litem (@list)
60            {
61                grep({ $desired_genomes{$_}++ }  @{$litem->[1]});
62            }
63        }
64    }
65    
66  for my $subname (@subs)  for my $subname (@subs)
67  {  {
68      my $sub = $fig->get_subsystem($subname);      my $sub = $fig->get_subsystem($subname);
69      my @subg = $sub->get_genomes();      my @subg = $sub->get_genomes();
70      grep($all_genomes{$_}++, @subg);      for my $g (@subg)
71        {
72            next if @limit_genome and !$desired_genomes{$g};
73            $all_genomes{$g}++;
74        }
75    }
76    
77    #
78    # Now display the list of subsystems. We'll do this in a table for now; it
79    # may take up a lot of space, but I think picking multiple subsystems from
80    # a dropdown might be clumsy.
81    #
82    # Hm. Maybe we'll do a dropdown first and see how it works...
83    #
84    
85    my $list_size = @subs + 1;
86    $list_size = 10 if $list_size > 10;
87    
88    push(@$html,
89         $cgi->h2("Limit subsystems shown to ..."),
90         $cgi->scrolling_list(-name => 'limit_subsystem',
91                              -values => ["All", @subs],
92                              -size => $list_size,
93                              -multiple => 1));
94    
95    my @display_subs = $cgi->param("limit_subsystem");
96    
97    if (grep({ $_ eq "All"} @display_subs))
98    {
99        @display_subs = @subs;
100  }  }
101    
102  my @col_hdrs = map { s/_/ /g; $_ } @subs;  push(@$html,
103  splice(@col_hdrs, 0, 0, "Genome");       $cgi->p,
104         $cgi->submit(-label => "Update scoreboard",
105                      -name => 'update_button'));
106    
107    #
108    # And show the table.
109    #
110    push(@$html, $cgi->hr, $cgi->h2("Scoreboard"));
111    
112    my @col_hdrs = map { s/_/ /g; $_ } @display_subs;
113    unshift(@col_hdrs, "Genome");
114    
115  my @table;  my @table;
116    
# Line 33  Line 122 
122    
123      push(@$row, $k);      push(@$row, $k);
124    
125      for my $subname (@subs)      for my $subname (@display_subs)
126      {      {
127          my $sub = $fig->get_subsystem($subname);          my $sub = $fig->get_subsystem($subname);
128          my $vc = $sub->get_variant_code_for_genome($k);          my $vc = $sub->get_variant_code_for_genome($k);
# Line 45  Line 134 
134    
135  push(@$html, HTML::make_table(\@col_hdrs, \@table));  push(@$html, HTML::make_table(\@col_hdrs, \@table));
136    
137    push(@$html, $cgi->end_form());
138    
139  &HTML::show_page($cgi, $html);  &HTML::show_page($cgi, $html);

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3