[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.7, Mon Jun 19 03:23:27 2006 UTC revision 1.8, Mon Jun 19 03:56:38 2006 UTC
# Line 216  Line 216 
216  map {$skip->{$_}=1} (2..10);  map {$skip->{$_}=1} (2..10);
217  unless ($cgi->param('create_excel')) {$tab=&HTML::merge_table_rows($tab, $skip)}  unless ($cgi->param('create_excel')) {$tab=&HTML::merge_table_rows($tab, $skip)}
218    
219    # generate the table of significant differences;
220    my $sigtab=&significant_difference();
221    
222  # finally make the HTML  # finally make the HTML
223    
224    
# Line 225  Line 228 
228  push @headers, map {$fig->genus_species($_) . "<br />$_"} @genomes;  push @headers, map {$fig->genus_species($_) . "<br />$_"} @genomes;
229    
230  my %options=("border"=>0);  my %options=("border"=>0);
231  if ($cgi->param('create_excel')) {$options{"excelfile"}="SubsystemConnections"}  
232    ## We need to make the HTML table before the excel file table. It is the only excel rule!
233    my $tablehtml=&HTML::make_table(\@headers, $tab, "", %options);
234    
235    my $excellink=" &nbsp; ";
236    if ($cgi->param('create_excel'))
237    {
238        $raelib->make_excel_workbook("SubsystemConnections", \%options);
239        $raelib->make_excel_worksheet(\@headers, $tab, "hits");
240        $excellink=$raelib->close_excel_file();
241    }
242    
243    
 my $sigtab=&significant_difference();  
244    
245    
246    
# Line 248  Line 260 
260          $cgi->hidden('limit'),          $cgi->hidden('limit'),
261          $cgi->hidden('color'),          $cgi->hidden('color'),
262          &HTML::make_table([], &control_color_table(), ""),          &HTML::make_table([], &control_color_table(), ""),
263          &HTML::make_table(\@headers, $tab, "", %options),          $tablehtml,
264            $excellink,
265            $cgi->submit("create_excel", "Create excel file of this table"),
266          $cgi->hr,          $cgi->hr,
267          $sigtab,          $sigtab,
268            $excellink,
269          $cgi->submit("create_excel", "Create excel file of this table"),          $cgi->submit("create_excel", "Create excel file of this table"),
270      );      );
271    
# Line 300  Line 315 
315              # note that pieces has lots of information about confidence etc that we are ignoring right now              # note that pieces has lots of information about confidence etc that we are ignoring right now
316              if (@pieces)              if (@pieces)
317              {              {
318                  my $string=&HTML::sub_link($cgi, $pieces[1])." <small>(".(join(", ", @pieces[2,3,4])).")</small><br />\n";                  my $htmlstring=&HTML::sub_link($cgi, $pieces[1])." <small>(".(join(", ", @pieces[2,3,4])).")</small><br />\n";
319                  push @{$xipe->{$genomes[$i]}->{$pieces[0]}}, $string;                  my $textstring=$pieces[1] . " (".(join(", ", @pieces[2,3,4]))."),\n";
320                    push @{$xipe->{$genomes[$i]}->{$pieces[0]}}, [$htmlstring, $textstring];
321              }              }
322              else              else
323              {              {
# Line 310  Line 326 
326          }          }
327      }      }
328      my $hdrs=["UP IN", map {$fig->genus_species($_)."<br />($_)\n"} @genomes];      my $hdrs=["UP IN", map {$fig->genus_species($_)."<br />($_)\n"} @genomes];
329      my $tab=[];      my $tab=[]; my $texttab=[]; # texttab is for the excel file and doesn't have links
330      foreach my $i (0 .. $#genomes)      foreach my $i (0 .. $#genomes)
331      {      {
332          my $row=[$fig->genus_species($genomes[$i]) . "($_)"];          my $hrow=[$fig->genus_species($genomes[$i]) . "($_)"];
333            my $trow=[$fig->genus_species($genomes[$i]) . "($_)"]; # t is text for excel
334          foreach my $j (0 .. $#genomes)          foreach my $j (0 .. $#genomes)
335          {          {
336              #$matches=join("<br />\n", map {&HTML::sub_link($cgi, $_)} @{$xipe->{$genomes[$i]}->{$genomes[$j]}});              #$matches=join("<br />\n", map {&HTML::sub_link($cgi, $_)} @{$xipe->{$genomes[$i]}->{$genomes[$j]}});
337              my $matches=" &nbsp; ";              my ($hmatches, $tmatches)=(" &nbsp; ", "");
338              if (defined $xipe->{$genomes[$i]}->{$genomes[$j]}) {$matches=join("", @{$xipe->{$genomes[$i]}->{$genomes[$j]}})}              if (defined $xipe->{$genomes[$i]}->{$genomes[$j]})
339              push @$row, $matches;              {
340                    $hmatches=join("", map {$_->[0]} @{$xipe->{$genomes[$i]}->{$genomes[$j]}}); # this is the html version for web
341                    $tmatches=join("", map {$_->[1]} @{$xipe->{$genomes[$i]}->{$genomes[$j]}}); # this is the text version for excel
342          }          }
343          push @$tab, $row;              push @$hrow, $hmatches;
344                push @$trow, $tmatches;
345      }      }
346            push @$tab, $hrow;
347            push @$texttab, $trow;
348        }
349        my %options=("border"=>1);
350        my $tablehtml=&HTML::make_table($hdrs, $tab, "Subsystems with significant difference", %options);
351    
352        if ($cgi->param('create_excel')) {$raelib->make_excel_workbook("SubsystemConnections", \%options); $raelib->make_excel_worksheet($hdrs, $texttab, "Signif. Diff")}
353    
354      return &HTML::make_table($hdrs, $tab, "Subsystems with significant difference");      return $tablehtml;
355  }  }
356    

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

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3