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

Diff of /FigWebServices/subsys_vectors.cgi

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

revision 1.8, Tue Jul 12 21:44:59 2005 UTC revision 1.9, Tue Jul 12 22:10:07 2005 UTC
# Line 53  Line 53 
53    
54    
55    
56  if ($cgi->param('korgs') && $cgi->param('subsystems'))  if (($cgi->param('korgs') || $cgi->param('orgname')) && ($cgi->param('subsystems') || $cgi->param('allss')))
57  {  {
58   &show_table($fig,$cgi,$html);   &show_table($fig,$cgi,$html);
59  }  }
# Line 72  Line 72 
72   push @$html,   push @$html,
73   $cgi->start_form(),   $cgi->start_form(),
74   $cgi->p("Please enter your username:   ", $cgi->textfield("user")),   $cgi->p("Please enter your username:   ", $cgi->textfield("user")),
75     "You can enter the partial name of some organisms to choose from (e.g. Listeria): ", $cgi->textfield(-name=>"orgname", -size=>40), $cgi->p, "\n",
76   $cgi->p("Please choose some organisms from the list. You can choose more than one organism:"),   $cgi->p("Please choose some organisms from the list. You can choose more than one organism:"),
77   $raelib->scrolling_org_list($cgi, 1),   $raelib->scrolling_org_list($cgi, 1),
78   $cgi->p("Please choose some subsystems from the list. You can choose more than one subsystem."),   $cgi->p("Please choose some subsystems from the list. You can choose more than one subsystem from the list or check this box to select them all",
79     $cgi->checkbox(-name=>"allss", -label=>'')), "\n",
80   $raelib->scrolling_subsys_list($cgi, 1),   $raelib->scrolling_subsys_list($cgi, 1),
81   $cgi->p, $cgi->checkbox(-name=>'showempty', -label=>"Show empty columns"), $cgi->p,   $cgi->p, $cgi->checkbox(-name=>'showempty', -label=>"Show empty columns"), $cgi->p,
82   $cgi->checkbox(-name=>'showclassifications', -checked=>1, -label=>"Show classifications"), $cgi->p;   $cgi->checkbox(-name=>'showclassifications', -checked=>1, -label=>"Show classifications"), $cgi->p;
# Line 90  Line 92 
92  sub show_table {  sub show_table {
93   my ($fig,$cgi,$html)=@_;   my ($fig,$cgi,$html)=@_;
94   # what genomes are we interested in?   # what genomes are we interested in?
95   my @genomes=$cgi->param('korgs');   my @genomes;
96     # partial genome name matching
97     if ($cgi->param('orgname')) {
98      @genomes=$fig->partial_genus_matching($cgi->param('orgname'));
99      $cgi->param('korgs', @genomes)
100     }
101     else {
102      @genomes=$cgi->param('korgs');
103     }
104   # and subsystems   # and subsystems
105   my @ss=$cgi->param('subsystems');   my @ss;
106     if ($cgi->param('allss')) {
107      @ss=$fig->all_subsystems;
108      $cgi->param('subsystems', @ss);
109     }
110     else {@ss=$cgi->param('subsystems')}
111   # go through the subsystems and get the variant codes   # go through the subsystems and get the variant codes
112   # we do this first because we can load a subsystem and then get all vcs for it. Then when we do the table, we buuild it   # we do this first because we can load a subsystem and then get all vcs for it. Then when we do the table, we buuild it
113   # genome by genome and not col by col   # genome by genome and not col by col
# Line 128  Line 143 
143   foreach my $i (0 .. @ss) {$label{$ss[$i]}=$labels[$i]}   foreach my $i (0 .. @ss) {$label{$ss[$i]}=$labels[$i]}
144    
145   # sort the columns in the appropriate way   # sort the columns in the appropriate way
146    
147     my %tempkey;
148     foreach (@ss) {$tempkey{$_}=$cgi->param("sort$_") or "a"} # this is a fake so if $cgi->param("sort$_") is undef it is still sorted
149   @ss=sort {   @ss=sort {
150                  $cgi->param("sort$a") cmp $cgi->param("sort$b") ||                  $tempkey{$a} cmp $tempkey{$b} ||
151                  uc($class->{$a}->[0]) cmp uc($class->{$b}->[0]) ||                  uc($class->{$a}->[0]) cmp uc($class->{$b}->[0]) ||
152                  uc($class->{$a}->[1]) cmp uc($class->{$b}->[1])                  uc($class->{$a}->[1]) cmp uc($class->{$b}->[1])
153            } keys %$vc;            } keys %$vc;

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

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3