GMOD

GBrowse/AJAXhandlerScript

Contents

Proposal to convert gbrowse_details to an AJAX request handler

A temporary page to describe a low-impact change to existing code to provide a built-in ajax handler for Gbrowse

Examples

Sample1b.png

Sample2b.png

Changes to gbrowse_details

my $rmt   = param('remote');
 if (defined $rmt) {
   print header,start_html;
   print remote_content($rmt,$features[0]);
   print end_html;
   exit 0;
 }
 # do something for popup balloons
 sub remote_content {
   my $key = shift; # the key for the text or code-ref in the gbrowse config file
   my $feat = shift;
   my $contents = $CONFIG->config->code_setting('TOOLTIPS',$key) or die "$key is empty";
   my $coderef = (ref $contents||'') eq 'CODE';
   return $contents unless $coderef;
   # paranoia?
   die "Error: $key is not a CODE-REF" if ref $contents && !$coderef;
   # args are user-defined
   my %args = (feature => $feat) if $feat;
   for my $arg (param()) {
     my @vals = param($arg);
     my $val  = @vals > 1 ? \@vals : $vals[0];
     $args{$arg} = $val;
   }
   return $contents->(\%args);
 }

Changes To Configuration File

Callbacks

Orf stanza

Changes to Bio::Graphics::Browser

Browsercode

Categories:

Documentation

Community

Tools