[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.5, Fri Feb 4 06:59:46 2005 UTC
# Line 45  Line 45 
45  my $user = $cgi->param('user');  my $user = $cgi->param('user');
46  my $err;  my $err;
47    
48    
49    foreach (@ARGV) {
50     my ($k, $v)=split /\=/;
51     if ($k eq "compare_to") {my @arr=split /\,/, $v; $v=\@arr}
52     $cgi->param(-name=>$k, -value=>$v);
53    }
54    
55  if ($cgi->param('genome')) {  if ($cgi->param('genome')) {
56   # draw the image   # draw the image
57   unshift @$html, "<TITLE>The SEED - Genome Browser </TITLE>\n";   unshift @$html, "<TITLE>The SEED - Genome Browser </TITLE>\n";
58    
59   my %imagefns;   my %imagefns;
60   foreach my $kw   foreach my $kw
61    (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
62      maxn maxp bluescale stopshort user])
63   {   {
64    $imagefns{"-".$kw}=$cgi->param($kw);    $imagefns{"-".$kw}=$cgi->param($kw);
65   }   }
# Line 62  Line 70 
70   foreach my $ct ($cgi->param('compare_to')) {   foreach my $ct ($cgi->param('compare_to')) {
71    $ct =~ /\((\d+\.\d+)\)/;    $ct =~ /\((\d+\.\d+)\)/;
72    push @{$imagefns{'-compare_to'}}, $1;    push @{$imagefns{'-compare_to'}}, $1;
   print STDERR "Added $1\n";  
73   }   }
74     if ($cgi->param('subsystems')) {push @{$imagefns{'-compare_to'}}, "subsystems"}
75   if ($cgi->param('pirsf')) {push @{$imagefns{'-compare_to'}}, ['tagvalue', 'pirsf']}   if ($cgi->param('pirsf')) {push @{$imagefns{'-compare_to'}}, ['tagvalue', 'pirsf']}
76   #   #
77   # 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
78    
79     if ($ARGV[0]) {
80      print STDERR "These are the compare to's: \n", join "\n", @{$imagefns{'-compare_to'}}, '';
81     }
82    
83   my $image=raedraw->new(%imagefns);   my $image=raedraw->new(%imagefns);
84    
 print STDERR "IMAGE COMPARE TO RETURNS:  ", join "|", @{$image->compareto}, "\n";  
85    
86   my $filename = "$FIG_Config::temp/genomebrowser_$$.svg";   my $filename = "$FIG_Config::temp/genomebrowser_$$.svg";
87   my $url = &FIG::temp_url . "/genomebrowser_$$.svg";   my $url = &FIG::temp_url . "/genomebrowser_$$.svg";
# Line 79  Line 89 
89    
90   my ($width, $height)=$image->write_image($filename);   my ($width, $height)=$image->write_image($filename);
91    
92    
93   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",
94           standby=>"Loading genome browser image, please be patient"},           standby=>"Loading genome browser image, please be patient"},
95           "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 104 
104   &show_initial($fig,$cgi,$html);   &show_initial($fig,$cgi,$html);
105  }  }
106    
107    push @$err, "Computing this image took " . int((time-$^T)/0.6)/100 . " minutes\n";
108  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);
109  &HTML::show_page($cgi,$html,1);  &HTML::show_page($cgi,$html,1);
110  exit;  exit;
# Line 122  Line 134 
134     top_marg     => [20,  'top margin'],     top_marg     => [20,  'top margin'],
135     bottom_marg  => [20,  'bottom margin'],     bottom_marg  => [20,  'bottom margin'],
136     box_height   => [10,  'height of the boxes around the pegs'],     box_height   => [10,  'height of the boxes around the pegs'],
137     rows         => [2,   'rows to split the image into'],     rows         => [10,   'split the image into rows'],
138     show_function=> [3,   'show function every n pegs'],     show_function=> [3,   'show function every n pegs'],
139     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'],
140     maxn         => [50, "Max sims"],     maxn         => [5, "Max sims"],
141     maxp         => [1e-5, "Max E-val"],     maxp         => [1e-5, "Max E-val"],
142       stopshort    => [500, "Stop after drawing this many pegs"],
143   );   );
144    
145   my %checkbox=(   my %checkbox=(
# Line 147  Line 160 
160    
161   push @$html, "\n" , $cgi->p, $cgi->div({class=>"advanced"}, $cgi->table($advanced));   push @$html, "\n" , $cgi->p, $cgi->div({class=>"advanced"}, $cgi->table($advanced));
162    
163     push @$html, $cgi->h3("Subsystems"),  $cgi->table($cgi->Tr(
164      $cgi->td([$cgi->checkbox(-name=>'subsystems', -label=>'') . " &nbsp; highlight PEGs in subsystems"])));
165    
166   # now add the table for tag value pairs:   # now add the table for tag value pairs:
167   push @$html, $cgi->h3("Tag value pairs"), $cgi->table($cgi->Tr(   push @$html, $cgi->h3("Tag value pairs"), $cgi->table($cgi->Tr(
168          $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.5

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3