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

Annotation of /FigWebServices/genome_statistics.cgi

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.15 - (view) (download)

1 : redwards 1.10 # -*- perl -*-
2 : overbeek 1.1 #### start ####
3 : overbeek 1.5
4 : overbeek 1.1 use FIG;
5 :     my $fig = new FIG;
6 :    
7 :     use HTML;
8 :     use strict;
9 :     use CGI;
10 :     my $cgi = new CGI;
11 :    
12 : overbeek 1.2 if (0)
13 : overbeek 1.1 {
14 :     my $VAR1;
15 :     eval(join("",`cat /tmp/statistics_parms`));
16 :     $cgi = $VAR1;
17 :     # print STDERR &Dumper($cgi);
18 :     }
19 :    
20 :     if (0)
21 :     {
22 :     print $cgi->header;
23 :     my @params = $cgi->param;
24 :     print "<pre>\n";
25 :     foreach $_ (@params)
26 :     {
27 :     print "$_\t:",join(",",$cgi->param($_)),":\n";
28 :     }
29 :    
30 :     if (0)
31 :     {
32 :     if (open(TMP,">/tmp/statistics_parms"))
33 :     {
34 :     print TMP &Dumper($cgi);
35 :     close(TMP);
36 :     }
37 :     }
38 :     exit;
39 :     }
40 :    
41 :     my $html = [];
42 : olson 1.7 unshift @$html, "<TITLE>The SEED Statistics Page</TITLE>\n";
43 : overbeek 1.1
44 : overbeek 1.8 my @genomes = $cgi->param('genome');
45 :     my $request = $cgi->param('request');
46 : overbeek 1.9
47 :     if ($request eq "subsystems_summary")
48 :     {
49 :     &subsys_summary($fig,$cgi,$html);
50 :     }
51 : redwards 1.10 elsif ($request eq "edit_kv_stats") {
52 :     &edit_kv_stats($fig,$cgi,$html, $cgi->param('genome'));
53 :     }
54 : overbeek 1.9 elsif ((@genomes == 0) && (! $request))
55 : overbeek 1.8 {
56 :     &table_of_genomes($fig,$cgi,$html);
57 :     }
58 :     elsif (! $request)
59 :     {
60 :     my $genome;
61 :     foreach $genome (@genomes)
62 :     {
63 :     &basic_stats($fig,$cgi,$html,$genome);
64 :     push(@$html,$cgi->hr);
65 :     &assignment_stats($fig,$cgi,$html,$genome);
66 :     push(@$html,$cgi->hr);
67 : redwards 1.14 &kv_peg_stats($fig, $cgi, $html, $genome);
68 :     push(@$html,$cgi->hr);
69 : redwards 1.10 &kv_stats($fig, $cgi, $html, $genome);
70 : overbeek 1.8 my $user = $cgi->param('user');
71 :     push(@$html,"<a href=./genome_statistics.cgi?genome=$genome&request=show_subsystems&user=$user>Show Subsystems</a>");
72 :     push(@$html,$cgi->br);
73 :     }
74 :     }
75 :     elsif (@genomes == 0)
76 : overbeek 1.1 {
77 : olson 1.7 unshift @$html, "<TITLE>The SEED Statistics Page</TITLE>\n";
78 : overbeek 1.8 push(@$html,"<h1>Sorry, you need to specify at least one valid genome</h1>\n");
79 : overbeek 1.1 &HTML::show_page($cgi,$html);
80 :     exit;
81 :     }
82 : overbeek 1.3 else
83 :     {
84 : overbeek 1.8 if ($request eq "hypo_sub") { &handle_hypo_sub($fig,$cgi,$html,$genomes[0]) }
85 :     elsif ($request eq "hypo_nosub") { &handle_hypo_nosub($fig,$cgi,$html,$genomes[0]) }
86 :     elsif ($request eq "nothypo_sub") { &handle_nothypo_sub($fig,$cgi,$html,$genomes[0]) }
87 :     elsif ($request eq "nothypo_nosub") { &handle_nothypo_nosub($fig,$cgi,$html,$genomes[0]) }
88 :     elsif ($request eq "show_subsystems") { &handle_show_subsystems($fig,$cgi,$html,$genomes[0]) }
89 :     else
90 :     {
91 :     push(@$html,$cgi->h1("Invalid request: $request"));
92 :     }
93 : overbeek 1.3 }
94 : overbeek 1.1 &HTML::show_page($cgi,$html);
95 :     exit;
96 : overbeek 1.3
97 :     sub basic_stats {
98 :     my($fig,$cgi,$html,$genome) = @_;
99 :    
100 : overbeek 1.8 my($gname,$szdna,$num_contigs,$pegs,$rnas,$taxonomy) = &get_basic_stats($fig,$genome);
101 : overbeek 1.3 push(@$html,$cgi->h1('Basic Statistics'));
102 :     push(@$html,$cgi->br,
103 : overbeek 1.8 "<b>Genome ID:</b> $genome",$cgi->br,
104 : overbeek 1.4 "<b>Name:</b> $gname",$cgi->br,
105 :     "<b>Size (bp):</b> $szdna",$cgi->br,
106 : overbeek 1.8 "<b>Number contigs:</b> $num_contigs",$cgi->br,
107 : overbeek 1.4 "<b>Number CDSs:</b> $pegs",$cgi->br,
108 :     "<b>Number rnas:</b> $rnas",$cgi->br,
109 :     "<b>Taxonomy:</b> $taxonomy",$cgi->br
110 : overbeek 1.3 );
111 :     return
112 :     }
113 : overbeek 1.4
114 :     sub commify {
115 :     my($n) = @_;
116 :     my(@n) = ();
117 :     my($i);
118 :    
119 :     for ($i = (length($n) - 3); ($i > 0); $i -= 3)
120 :     {
121 :     unshift(@n,",",substr($n,$i,3));
122 :     }
123 :     unshift(@n,substr($n,0,$i+3));
124 :     return join("",@n);
125 :     }
126 :    
127 :     sub assignment_stats {
128 :     my($fig,$cgi,$html,$genome) = @_;
129 :    
130 : overbeek 1.5 my $rdbH = $fig->db_handle;
131 :    
132 :     my $hypo_sub = 0;
133 :     my $hypo_nosub = 0;
134 :     my $nothypo_sub = 0;
135 :     my $nothypo_nosub = 0;
136 :    
137 : overbeek 1.6 my($subsystem_data,$assignments_data) = &get_data($fig,$cgi,$genome);
138 :     my %in = map { $_->[2] => 1 } @$subsystem_data;
139 :     my $in = keys(%in);
140 : overbeek 1.5
141 : overbeek 1.6 foreach $_ (@$assignments_data)
142 : overbeek 1.5 {
143 :     my($peg,$func) = @$_;
144 :     my $is_hypo = &FIG::hypo($func);
145 :    
146 :     if ($is_hypo && $in{$peg}) { $hypo_sub++ }
147 :     elsif ($is_hypo && ! $in{$peg}) { $hypo_nosub++ }
148 :     elsif ((! $is_hypo) && (! $in{$peg})) { $nothypo_nosub++ }
149 :     elsif ((! $is_hypo) && $in{$peg}) { $nothypo_sub++ }
150 :     }
151 :     my $tot = $hypo_sub + $nothypo_sub + $hypo_nosub + $nothypo_nosub;
152 :     my $fracHS = sprintf "%4.2f", $hypo_sub / $tot;
153 :     my $fracNHS = sprintf "%4.2f", $nothypo_sub / $tot;
154 :     my $fracHNS = sprintf "%4.2f", $hypo_nosub / $tot;
155 :     my $fracNHNS = sprintf "%4.2f", $nothypo_nosub / $tot;
156 : overbeek 1.6
157 :     my $user = $cgi->param('user');
158 : overbeek 1.5
159 : overbeek 1.6 push(@$html,"<b>PEGs with hypothetical functions and in subsystem:</b> <a href=./genome_statistics.cgi?user=$user&genome=$genome&request=hypo_sub>$hypo_sub ($fracHS)</a>",$cgi->br,
160 :     "<b>PEGs with nonhypothetical functions and in subsystem:</b> <a href=./genome_statistics.cgi?user=$user&genome=$genome&request=nothypo_sub>$nothypo_sub ($fracNHS)</a>",$cgi->br,
161 :     "<b>PEGs with hypothetical functions and not in subsystem:</b> <a href=./genome_statistics.cgi?user=$user&genome=$genome&request=hypo_nosub>$hypo_nosub ($fracHNS)</a>",$cgi->br,
162 :     "<b>PEGs with nonhypothetical functions and not in subsystem:</b> <a href=./genome_statistics.cgi?user=$user&genome=$genome&request=nothypo_nosub>$nothypo_nosub ($fracNHNS)</a>",$cgi->br
163 : overbeek 1.5 );
164 : overbeek 1.4 }
165 :    
166 : overbeek 1.5 sub handle_show_subsystems {
167 : overbeek 1.4 my($fig,$cgi,$html,$genome) = @_;
168 : overbeek 1.6 my(%in,$sub,$role,$protein,$sub_link);
169 : overbeek 1.4
170 : overbeek 1.6 my($subsystem_data,$assignments_data) = &get_data($fig,$cgi,$genome);
171 :     foreach $_ (@$subsystem_data)
172 :     {
173 :     ($sub,$role,$protein) = @$_;
174 :     push(@{$in{$sub}->{$role}},&HTML::fid_link($cgi,$protein,0) . ": " . scalar $fig->function_of($protein));
175 :     }
176 :     foreach $sub (sort keys(%in))
177 :     {
178 :     $sub_link = &sub_link($cgi,$sub);
179 :     push(@$html,$cgi->h2($sub_link));
180 :     my $roles = [];
181 :     foreach $role (sort keys(%{$in{$sub}}))
182 :     {
183 :     push(@$roles,$cgi->ul($cgi->li($in{$sub}->{$role})));
184 :     }
185 :     push(@$html,$cgi->ul($cgi->li($roles)));
186 :     }
187 : overbeek 1.4 }
188 : overbeek 1.5
189 :     sub handle_hypo_sub {
190 :     my($fig,$cgi,$html,$genome) = @_;
191 :    
192 : overbeek 1.6 my($subsystem_data,$assignments_data) = &get_data($fig,$cgi,$genome);
193 :     my %subs = map { $_->[2] => $_->[0] } @$subsystem_data;
194 :     my $col_hdrs = ["PEG","Function","Subsystem"];
195 :     my $tab = [];
196 :     foreach $_ (@$assignments_data)
197 :     {
198 :     my($peg,$func) = @$_;
199 :     if (&FIG::hypo($func) && ($subs{$peg}))
200 :     {
201 :     push(@$tab,[&HTML::fid_link($cgi,$peg,0),$func,&sub_link($cgi,$subs{$peg})]);
202 :     }
203 :     }
204 :     $_ = @$tab;
205 :     push(@$html,&HTML::make_table($col_hdrs,$tab,"$_ Hypothetical Pegs in Subsystems"));
206 : overbeek 1.5 }
207 :    
208 :     sub handle_hypo_nosub {
209 :     my($fig,$cgi,$html,$genome) = @_;
210 :    
211 : overbeek 1.6 my($subsystem_data,$assignments_data) = &get_data($fig,$cgi,$genome);
212 :     my %subs = map { $_->[2] => $_->[0] } @$subsystem_data;
213 :     my $col_hdrs = ["PEG","Function"];
214 :     my $tab = [];
215 :     foreach $_ (@$assignments_data)
216 :     {
217 :     my($peg,$func) = @$_;
218 :     if (&FIG::hypo($func) && (! $subs{$peg}))
219 :     {
220 :     push(@$tab,[&HTML::fid_link($cgi,$peg,0),$func]);
221 :     }
222 :     }
223 :     $_ = @$tab;
224 :     push(@$html,&HTML::make_table($col_hdrs,$tab,"$_ Hypothetical Pegs NOT in Subsystems"));
225 : overbeek 1.5 }
226 :    
227 :     sub handle_nothypo_sub {
228 :     my($fig,$cgi,$html,$genome) = @_;
229 :    
230 : overbeek 1.6 my($subsystem_data,$assignments_data) = &get_data($fig,$cgi,$genome);
231 :     my %subs = map { $_->[2] => $_->[0] } @$subsystem_data;
232 :     my $col_hdrs = ["PEG","Function","Subsystem"];
233 :     my $tab = [];
234 :     foreach $_ (@$assignments_data)
235 :     {
236 :     my($peg,$func) = @$_;
237 :     if ((! &FIG::hypo($func)) && ($subs{$peg}))
238 :     {
239 :     push(@$tab,[&HTML::fid_link($cgi,$peg,0),$func,&sub_link($cgi,$subs{$peg})]);
240 :     }
241 :     }
242 :     $_ = @$tab;
243 :     push(@$html,&HTML::make_table($col_hdrs,$tab,"$_ Nonhypothetical Pegs in Subsystems"));
244 : overbeek 1.5 }
245 :    
246 :     sub handle_nothypo_nosub {
247 :     my($fig,$cgi,$html,$genome) = @_;
248 :    
249 : overbeek 1.6 my($subsystem_data,$assignments_data) = &get_data($fig,$cgi,$genome);
250 :     my %subs = map { $_->[2] => $_->[0] } @$subsystem_data;
251 :     my $col_hdrs = ["PEG","Function"];
252 :     my $tab = [];
253 :     foreach $_ (@$assignments_data)
254 :     {
255 :     my($peg,$func) = @$_;
256 :     if ((! &FIG::hypo($func)) && (! $subs{$peg}))
257 :     {
258 :     push(@$tab,[&HTML::fid_link($cgi,$peg,0),$func]);
259 :     }
260 :     }
261 :     $_ = @$tab;
262 :     push(@$html,&HTML::make_table($col_hdrs,$tab,"$_ Nonhypothetical Pegs NOT in Subsystems"));
263 : overbeek 1.5 }
264 :    
265 : overbeek 1.6 sub get_data {
266 :     my($fig,$cgi,$genome) = @_;
267 :    
268 :     my $rdbH = $fig->db_handle;
269 :     my $subsystem_data = $rdbH->SQL("SELECT DISTINCT subsystem,role,protein FROM subsystem_index WHERE ( protein like 'fig\|$genome.peg.%')");
270 :     my $assignment_data = $rdbH->SQL("SELECT prot,assigned_function FROM assigned_functions WHERE ( prot like 'fig\|$genome.peg.%' AND made_by = 'master' )");
271 :    
272 :     return ($subsystem_data,$assignment_data);
273 :     }
274 :    
275 :     sub sub_link {
276 :     my($cgi,$sub) = @_;
277 :     my($sub_link);
278 :    
279 :     my $user = $cgi->param('user');
280 :     if ($user)
281 :     {
282 :     $sub_link = "<a href=./subsys.cgi?ssa_name=$sub&request=show_ssa&user=$user>$sub</a>";
283 :     }
284 :     else
285 :     {
286 :     $sub_link = $sub;
287 :     }
288 :     return $sub_link;
289 :     }
290 : overbeek 1.8
291 :     sub get_basic_stats {
292 :     my($fig,$genome) = @_;
293 :    
294 :     my $rdbH = $fig->db_handle;
295 :     my $relational_db_response = $rdbH->SQL("SELECT gname,szdna,pegs,rnas,taxonomy FROM genome WHERE genome = '$genome'");
296 :     my($gname,$szdna,$pegs,$rnas,$taxonomy) = @{$relational_db_response->[0]};
297 :     my $szdna = &commify($szdna);
298 :     my $num_contigs = scalar $fig->all_contigs($genome);
299 :     return ($gname,$szdna,$num_contigs,$pegs,$rnas,$taxonomy);
300 :     }
301 :    
302 :     sub table_of_genomes {
303 :     my($fig,$cgi,$html) = @_;
304 :     my(@genomes);
305 :    
306 :     push(@$html,"<pre>\n");
307 :     if ($cgi->param('complete'))
308 :     {
309 :     @genomes = $fig->genomes("complete");
310 :     }
311 :     else
312 :     {
313 :     @genomes = $fig->genomes;
314 :     }
315 :    
316 :     my $genome;
317 :     push(@$html,join("\t","Genome ID","Complete","Genome Name","Size (bp)","Number Contigs","CDSs","RNAs","Taxonomy") . "\n");
318 :     my $genome;
319 :     foreach $genome (@genomes)
320 :     {
321 :     push(@$html,join("\t",($genome,$fig->is_complete($genome),&get_basic_stats($fig,$genome))) . "\n");
322 :     }
323 :     push(@$html,"</pre>\n");
324 :     }
325 :    
326 :    
327 : overbeek 1.9 sub subsys_summary {
328 :     my($fig,$cgi,$html) = @_;
329 :     my($Nsubs,$genome,$sub,$role,$peg,$genome_instances,%genomes_in_use,$peg_instances,%pegs_in_use);
330 :     foreach $sub ($fig->all_subsystems)
331 :     {
332 :     $Nsubs++;
333 :     foreach $genome (map { $_->[0] } @{$fig->subsystem_genomes($sub)})
334 :     {
335 :     $genome_instances++;
336 :     $genomes_in_use{$genome}++;
337 :     foreach $role ($fig->subsystem_to_roles($sub))
338 :     {
339 :     foreach $peg ($fig->pegs_in_subsystem_cell($sub,$genome,$role))
340 :     {
341 :     $peg_instances++;
342 :     $pegs_in_use{$peg}++;
343 :     }
344 :     }
345 :     }
346 :     }
347 :     my $Ngenomes = scalar keys(%genomes_in_use);
348 :     my $Npegs = scalar keys(%pegs_in_use);
349 :     my $g_in_sub = int($genome_instances / $Nsubs);
350 :     my $p_in_sub = int($peg_instances / $Nsubs);
351 :     push(@$html,$cgi->h1('Subsystem Summary'));
352 :     push(@$html,$cgi->br,
353 :     "<b>Number Subsystems:</b> $Nsubs",$cgi->br,
354 :     "<b>Genomes in Subsystems:</b> $Ngenomes",$cgi->br,
355 :     "<b>PEGs in Subsystems:</b> $Npegs",$cgi->br,
356 :     "<b>Avg genomes per subsystem:</b> $g_in_sub",$cgi->br,
357 :     "<b>Avg PEGs per subsystem:</b> $p_in_sub",$cgi->br
358 :     );
359 :     return
360 :    
361 :     }
362 : redwards 1.10
363 : redwards 1.14 sub kv_peg_stats {
364 :     my ($fig, $cgi, $html, $genome)=@_;
365 :    
366 :     #RAE Added the coverage of each genome with different attributes for the PEGs to find the number of genes that are in pirsf, etc
367 :     push(@$html, "\n<div class=\"pegattributes\">\n<p><h2>PEG Attributes for ", $fig->genus_species($genome), "</h2></p>\n");
368 :    
369 :     my $pegtags=$fig->get_tags('peg');
370 :     foreach my $type (sort {$a cmp $b} keys %$pegtags)
371 :     {
372 : redwards 1.15 my @result = grep {$_ =~ /$genome/} @{$pegtags->{$type}};
373 :     push(@$html, "\nPEGS with tag: $type : ", scalar(@result), $cgi->br, "\n");
374 : redwards 1.14 }
375 :     }
376 :    
377 : redwards 1.10 sub kv_stats {
378 :     my ($fig, $cgi, $html, $genome, $edit)=@_;
379 :    
380 :     # RAE Added tables for key value pairs for an organism, and allow you to edit them
381 :     # figure out kv's for the organism, and make a table with them
382 :    
383 :     # if the optional edit boolean is set and a user is supplied, we will make a table where you can edit the KV pairs
384 :     # else we will just make a blank table
385 :    
386 : redwards 1.12 # prepare the html so we can add form fields here
387 :     push(@$html, "\n<div class=\"attributes\">\n<p><h2>Attributes for ", $fig->genus_species($genome), "</h2></p>\n");
388 :     if ($edit) {push(@$html, $cgi->start_form(-action=>"genome_statistics.cgi"))}
389 :    
390 :    
391 : redwards 1.10 my $tab=[];
392 :     my $user=$cgi->param('user');
393 :     my $col_hdrs=["Attribute", "Value"];
394 : redwards 1.11 if ($user && $edit) {$col_hdrs=["Attribute", "Value", "URL"]}
395 : redwards 1.10
396 :     my $known;
397 : redwards 1.13 foreach my $key (sort {$a->[1] cmp $b->[1]} $fig->get_attributes($genome)) {
398 :     $known->{$key->[1]}=1;
399 : redwards 1.10 if ($user && $edit) {
400 :     push @$tab,
401 :     [
402 : redwards 1.13 $key->[1],
403 :     $cgi->textfield(-name=>"value.".$key->[1], -default=>$key->[2], -size=>50),
404 :     $cgi->textfield(-name=>"url.".$key->[1], -default=>$key->[3], -size=>50),
405 : redwards 1.10 ];
406 :     } else {
407 : redwards 1.13 if ($key->[3] && $key->[3] =~ /^http/) {$key->[2] = "<a href=\"" . $key->[3] . "\">". $key->[2] . "</a>"}
408 : redwards 1.10 push @$tab,
409 :     [
410 : redwards 1.13 $key->[1],
411 :     $key->[2],
412 : redwards 1.10 ];
413 :     }
414 :     }
415 :    
416 :    
417 :     if ($edit) {
418 :     # now we want to add some pull down menus for things that we can add. And some blank boxes too for free text entry.
419 :     # start with three of each
420 :     my $opt=$fig->get_tags("genome"); # all the tags we know about
421 :     my @options=sort {uc($a) cmp uc($b)} grep {!$known->{$_}} keys %$opt;
422 :     unshift(@options, undef); # a blank field at the start
423 :     for (my $i=1; $i<= (scalar @options + 5); $i++) {
424 :    
425 :     # we have the options, and 5 blank fields for free text entry
426 :     my $choice=$cgi->popup_menu(-name=>"key.$i", -values=>\@options);
427 :     if ($i >= scalar @options) {$choice = $cgi->textfield(-name=>"key.$i", -size=>50)}
428 :     push @$tab,
429 :     [
430 :     $choice,
431 :     $cgi->textfield(-name=>"value.$i", -size=>50),
432 :     $cgi->textfield(-name=>"url.$i", -size=>50),
433 :     ];
434 :     }
435 : redwards 1.12 # we need to know how many possibilities we have to look through later. Just pass it as a hidden, rather than counting it next time
436 :     push(@$html, $cgi->hidden(-name=>"max new keys", -value=>scalar @options + 5));
437 : redwards 1.10 }
438 :    
439 :     # now just write the html
440 :     push(@$html,&HTML::make_table($col_hdrs,$tab,"Attributes"));
441 :     if ($edit) {
442 :     push(@$html, $cgi->hidden("genome"), $cgi->hidden("user"), $cgi->hidden("request"));
443 :     push(@$html, $cgi->submit('Change'), $cgi->reset());
444 :     }
445 :     else {
446 :     push(@$html,"<p><a href=./genome_statistics.cgi?genome=$genome&request=edit_kv_stats&change=0&user=$user>Edit Key Value Pairs</a></p>\n</div>\n");
447 :     }
448 :     }
449 :    
450 :    
451 :     sub edit_kv_stats {
452 :     my ($fig, $cgi, $html, $genome)=@_;
453 :     if ($cgi->param("Change")) {
454 :     # we have changed the values
455 :     # get the old kv pairs so we can see what has changed
456 :     my $changed; my $deleted;
457 :     foreach my $key ($fig->get_attributes($genome)) {
458 : redwards 1.13 if (!$cgi->param('value.'.$key->[1]) && !$cgi->param('url.'.$key->[1])) {
459 :     $fig->delete_attribute($genome, $key->[1]);
460 : redwards 1.10 push @$key, ["deleted", "td colspan=2 style=\"text-align: center\""];
461 :     push @$deleted, $key;
462 :     }
463 : redwards 1.13 elsif (($cgi->param('value.'.$key->[1]) ne $key->[2]) || ($cgi->param('url.'.$key->[1]) ne $key->[3])) {
464 :     $fig->change_attribute($genome, $key->[1], $cgi->param('value.'.$key->[1]), $cgi->param('url.'.$key->[1]));
465 :     push @$key, $cgi->param('value.'.$key->[1]), $cgi->param('url.'.$key->[1]);
466 : redwards 1.10 push @$changed, $key;
467 :     }
468 :     }
469 :    
470 :     my $added;
471 : redwards 1.12 for (my $i=0; $i <= $cgi->param("max new keys"); $i++) {
472 : redwards 1.10 if ($cgi->param("key.$i")) {
473 :     $fig->add_attribute($genome, $cgi->param("key.$i"), $cgi->param("value.$i"), $cgi->param("url.$i"));
474 :     push @$added, [$cgi->param("key.$i"), ["added", "td colspan=2 style=\"text-align: center\""], $cgi->param("value.$i"), $cgi->param("url.$i")];
475 :     }
476 :     }
477 :    
478 :     # now all we have to do is create a table to report what we have done.
479 :     my $tab=[];
480 :     push (@$html, "<div class=\"altered\"><p><h2>Attributes Altered for ", $fig->genus_species($genome), " ($genome)</h2></p>");
481 :     my $col_hdrs=["Attribute", "Original Value", "Original URL", "New Value", "New URL"];
482 :     if ($changed) {push @$tab, [["<strong>Changed Attributes", "td colspan=5 bgcolor=gray style=\"text-align: center\""]], @$changed}
483 :     if ($deleted) {push @$tab, [["<strong>Deleted Attributes", "td colspan=5 bgcolor=gray style=\"text-align: center\""]], @$deleted}
484 :     if ($added) {push @$tab, [["<strong>Added Attributes", "td colspan=5 bgcolor=gray style=\"text-align: center\""]], @$added}
485 :    
486 :     push(@$html,&HTML::make_table($col_hdrs,$tab,"Changed Data"));
487 :     }
488 :     else {
489 :     return kv_stats($fig, $cgi, $html, $genome, 1);
490 :     }
491 :     }
492 :    
493 :    

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3