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

Diff of /FigWebServices/genomebrowser.cgi

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

revision 1.3, Thu Feb 3 19:36:47 2005 UTC revision 1.6, Mon Dec 5 19:12:12 2005 UTC
# Line 1  Line 1 
1  # -*- perl -*-  # -*- perl -*-
2    #
3    # Copyright (c) 2003-2006 University of Chicago and Fellowship
4    # for Interpretations of Genomes. All Rights Reserved.
5    #
6    # This file is part of the SEED Toolkit.
7    #
8    # The SEED Toolkit is free software. You can redistribute
9    # it and/or modify it under the terms of the SEED Toolkit
10    # Public License.
11    #
12    # You should have received a copy of the SEED Toolkit Public License
13    # along with this program; if not write to the University of Chicago
14    # at info@ci.uchicago.edu or the Fellowship for Interpretation of
15    # Genomes at veronika@thefig.info or download a copy from
16    # http://www.theseed.org/LICENSE.TXT.
17    #
18    
19    
20  =pod  =pod
21    
# Line 45  Line 62 
62  my $user = $cgi->param('user');  my $user = $cgi->param('user');
63  my $err;  my $err;
64    
65    
66    foreach (@ARGV) {
67     my ($k, $v)=split /\=/;
68     if ($k eq "compare_to") {my @arr=split /\,/, $v; $v=\@arr}
69     $cgi->param(-name=>$k, -value=>$v);
70    }
71    
72  if ($cgi->param('genome')) {  if ($cgi->param('genome')) {
73   # draw the image   # draw the image
74   unshift @$html, "<TITLE>The SEED - Genome Browser </TITLE>\n";   unshift @$html, "<TITLE>The SEED - Genome Browser </TITLE>\n";
75    
76   my %imagefns;   my %imagefns;
77   foreach my $kw   foreach my $kw
78    (qw[width margin top_marg bottom_marg box_height rows box_no_score box_score show_function tick_mark_height genome_lines abrrev stopshort maxn maxp bluescale])    (qw[width margin top_marg bottom_marg box_height rows box_no_score box_score show_function tick_mark_height genome_lines abbrev stopshort
79      maxn maxp bluescale stopshort user])
80   {   {
81    $imagefns{"-".$kw}=$cgi->param($kw);    $imagefns{"-".$kw}=$cgi->param($kw);
82   }   }
# Line 62  Line 87 
87   foreach my $ct ($cgi->param('compare_to')) {   foreach my $ct ($cgi->param('compare_to')) {
88    $ct =~ /\((\d+\.\d+)\)/;    $ct =~ /\((\d+\.\d+)\)/;
89    push @{$imagefns{'-compare_to'}}, $1;    push @{$imagefns{'-compare_to'}}, $1;
   print STDERR "Added $1\n";  
90   }   }
91     if ($cgi->param('subsystems')) {push @{$imagefns{'-compare_to'}}, "subsystems"}
92   if ($cgi->param('pirsf')) {push @{$imagefns{'-compare_to'}}, ['tagvalue', 'pirsf']}   if ($cgi->param('pirsf')) {push @{$imagefns{'-compare_to'}}, ['tagvalue', 'pirsf']}
93   #   #
94   # remember that we also need to pass in scalefactor here if we have one. This should be a tuple of 'pirsf' and the factor   # remember that we also need to pass in scalefactor here if we have one. This should be a tuple of 'pirsf' and the factor
95    
96     if ($ARGV[0]) {
97      print STDERR "These are the compare to's: \n", join "\n", @{$imagefns{'-compare_to'}}, '';
98     }
99    
100   my $image=raedraw->new(%imagefns);   my $image=raedraw->new(%imagefns);
101    
 print STDERR "IMAGE COMPARE TO RETURNS:  ", join "|", @{$image->compareto}, "\n";  
102    
103   my $filename = "$FIG_Config::temp/genomebrowser_$$.svg";   my $filename = "$FIG_Config::temp/genomebrowser_$$.svg";
104   my $url = &FIG::temp_url . "/genomebrowser_$$.svg";   my $url = &FIG::temp_url . "/genomebrowser_$$.svg";
# Line 79  Line 106 
106    
107   my ($width, $height)=$image->write_image($filename);   my ($width, $height)=$image->write_image($filename);
108    
109    
110   push @$html, $cgi->div({class=>"image"}, $cgi->object({class=>"genomebrowser", data=>"$url", width=>"$width", height=>"$height",   push @$html, $cgi->div({class=>"image"}, $cgi->object({class=>"genomebrowser", data=>"$url", width=>"$width", height=>"$height",
111           standby=>"Loading genome browser image, please be patient"},           standby=>"Loading genome browser image, please be patient"},
112           "There should have been an SVG graphic comparing the genomes that you have chosen here, however, you probably need to download ",           "There should have been an SVG graphic comparing the genomes that you have chosen here, however, you probably need to download ",
# Line 93  Line 121 
121   &show_initial($fig,$cgi,$html);   &show_initial($fig,$cgi,$html);
122  }  }
123    
124    push @$err, "Computing this image took " . int((time-$^T)/0.6)/100 . " minutes\n";
125  push @$html, $cgi->div({class=>"errors", style=>"font-size: smaller"}, $cgi->h3("Errors/Diagnoses we caught:"), @$err);  push @$html, $cgi->div({class=>"errors", style=>"font-size: smaller"}, $cgi->h3("Errors/Diagnoses we caught:"), @$err);
126  &HTML::show_page($cgi,$html,1);  &HTML::show_page($cgi,$html,1);
127  exit;  exit;
# Line 122  Line 151 
151     top_marg     => [20,  'top margin'],     top_marg     => [20,  'top margin'],
152     bottom_marg  => [20,  'bottom margin'],     bottom_marg  => [20,  'bottom margin'],
153     box_height   => [10,  'height of the boxes around the pegs'],     box_height   => [10,  'height of the boxes around the pegs'],
154     rows         => [2,   'rows to split the image into'],     rows         => [10,   'split the image into rows'],
155     show_function=> [3,   'show function every n pegs'],     show_function=> [3,   'show function every n pegs'],
156     tick_mark_height=> [3, 'height of the tick marks on the genome line'],     tick_mark_height=> [3, 'height of the tick marks on the genome line'],
157     maxn         => [50, "Max sims"],     maxn         => [5, "Max sims"],
158     maxp         => [1e-5, "Max E-val"],     maxp         => [1e-5, "Max E-val"],
159       stopshort    => [500, "Stop after drawing this many pegs"],
160   );   );
161    
162   my %checkbox=(   my %checkbox=(
# Line 147  Line 177 
177    
178   push @$html, "\n" , $cgi->p, $cgi->div({class=>"advanced"}, $cgi->table($advanced));   push @$html, "\n" , $cgi->p, $cgi->div({class=>"advanced"}, $cgi->table($advanced));
179    
180     push @$html, $cgi->h3("Subsystems"),  $cgi->table($cgi->Tr(
181      $cgi->td([$cgi->checkbox(-name=>'subsystems', -label=>'') . " &nbsp; highlight PEGs in subsystems"])));
182    
183   # now add the table for tag value pairs:   # now add the table for tag value pairs:
184   push @$html, $cgi->h3("Tag value pairs"), $cgi->table($cgi->Tr(   push @$html, $cgi->h3("Tag value pairs"), $cgi->table($cgi->Tr(
185          $cgi->td([$cgi->checkbox(-name=>'pirsf', -label=>'') . " &nbsp; PIR superfamilies", ''])));          $cgi->td([$cgi->checkbox(-name=>'pirsf', -label=>'') . " &nbsp; PIR superfamilies", ''])));

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

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3