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

Diff of /FigWebServices/heat_map.cgi

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

revision 1.6, Wed Jun 7 03:44:24 2006 UTC revision 1.7, Mon Jun 19 03:23:27 2006 UTC
# Line 104  Line 104 
104    
105    
106    
107  my  @genomes=$cgi->param('korgs');  my  @genomes=sort {lc($fig->genus_species($a)) cmp lc($fig->genus_species($b))} $cgi->param('korgs');
108  my $scores; my $max;  my $scores; my $max;
109  for (my $i=0; $i<=$#genomes; $i++)  for (my $i=0; $i<=$#genomes; $i++)
110  {  {
# Line 227  Line 227 
227  my %options=("border"=>0);  my %options=("border"=>0);
228  if ($cgi->param('create_excel')) {$options{"excelfile"}="SubsystemConnections"}  if ($cgi->param('create_excel')) {$options{"excelfile"}="SubsystemConnections"}
229    
230    
231    my $sigtab=&significant_difference();
232    
233    
234    
235  # this is the link to the logo, which I removed  # this is the link to the logo, which I removed
236  # $cgi->p({style=>"text-align: center;"}, $cgi->a({href=>$cgi->url}, $cgi->img({alt=>"Heat Map NR", src=>"/heatmapnq.png"}))),  # $cgi->p({style=>"text-align: center;"}, $cgi->a({href=>$cgi->url}, $cgi->img({alt=>"Heat Map NR", src=>"/heatmapnq.png"}))),
237    
# Line 244  Line 249 
249          $cgi->hidden('color'),          $cgi->hidden('color'),
250          &HTML::make_table([], &control_color_table(), ""),          &HTML::make_table([], &control_color_table(), ""),
251          &HTML::make_table(\@headers, $tab, "", %options),          &HTML::make_table(\@headers, $tab, "", %options),
252            $cgi->hr,
253            $sigtab,
254          $cgi->submit("create_excel", "Create excel file of this table"),          $cgi->submit("create_excel", "Create excel file of this table"),
255      );      );
256    
# Line 279  Line 286 
286      return $controltab;      return $controltab;
287  }  }
288    
289    
290    sub significant_difference {
291        # identify those things with a significant difference and make a cool table of them
292    
293        # read the xipe attribute for significant differences
294        my $xipe;
295        foreach my $i (0 .. $#genomes)
296        {
297            foreach my $attr ($fig->get_attributes($genomes[$i], "xipe"))
298            {
299                my @pieces=split /\:/, $attr->[2];
300                # note that pieces has lots of information about confidence etc that we are ignoring right now
301                if (@pieces)
302                {
303                    my $string=&HTML::sub_link($cgi, $pieces[1])." <small>(".(join(", ", @pieces[2,3,4])).")</small><br />\n";
304                    push @{$xipe->{$genomes[$i]}->{$pieces[0]}}, $string;
305                }
306                else
307                {
308                    push @{$xipe->{$genomes[$i]}->{$pieces[0]}}, " &nbsp; ";
309                }
310            }
311        }
312        my $hdrs=["UP IN", map {$fig->genus_species($_)."<br />($_)\n"} @genomes];
313        my $tab=[];
314        foreach my $i (0 .. $#genomes)
315        {
316            my $row=[$fig->genus_species($genomes[$i]) . "($_)"];
317            foreach my $j (0 .. $#genomes)
318            {
319                #$matches=join("<br />\n", map {&HTML::sub_link($cgi, $_)} @{$xipe->{$genomes[$i]}->{$genomes[$j]}});
320                my $matches=" &nbsp; ";
321                if (defined $xipe->{$genomes[$i]}->{$genomes[$j]}) {$matches=join("", @{$xipe->{$genomes[$i]}->{$genomes[$j]}})}
322                push @$row, $matches;
323            }
324            push @$tab, $row;
325        }
326    
327        return &HTML::make_table($hdrs, $tab, "Subsystems with significant difference");
328    }
329    

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.7

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3