GBrowse
view release on metacpan or search on metacpan
docs/pod/PLUGINS_HOWTO.pod view on Meta::CPAN
$current->{bar} = $self->config_param('bar');
}
# called by gbrowse to create a <form> fragment for changing settings
sub configure_form {
my $self = shift;
my $current = $self->configuration;
my $form = textfield(-name => $self->config_name('foo'),
-value => $current->{foo})
.
textfield(-name => $self->config_name('bar'),
-value => $current->{bar});
return $form;
}
# called by gbrowse to annotate the DNA, returning features
sub annotate {
my $self = shift;
my $segment = shift;
my $config = $self->configuration;
# do something with the sequence segment
my @features = do_something();
return \@features;
}
=head1 DESCRIPTION
This is the base class for Generic Genome Browser plugins. Plugins are
perl .pm files that are stored in the gbrowse.conf/plugins directory.
Plugins are activated in the gbrowse.conf/ configuration file by
including them on the list indicated by the "plugins" setting:
plugins = BatchDumper FastaDumper GFFDumper
OligoFinder RestrictionAnnotator
Site-specific plugins may be placed in one or more site-specific
directories and added to the plugin search path using the plugin_path
setting:
plugin_path = /usr/local/gbrowse_plugins
GBrowse currently recognizes five distinct types of plugins:
=over
=item 1. dumpers
These plugins receive the genomic segment object and generate a dump
-- the output can be text, html or some other specialized format.
Example: GAME dumper.
=item 2. finders
These plugins accept input from the user and return a list of
genomic regions. The main browser displays the found regions and
allows the user to select among them. Example: BLAST search.
=item 3. annotators
These plugins receive the genomic segment object and return a list
of features which are overlayed on top of the detailed view.
Example: restriction site annotator.
=item 4. highlighters
These plugins receive each feature in turn before it is rendered and
can return a color name in order to highlight the background of the
feature with that color.
=item 5. filters
These plugins take filtering options from the user and are converted into
a filter closure. Every feature from the track is passed to this closure.
All features for which a true value is returned by the filter closure show
up in the track.
=back
All plug-ins inherit from Bio::Graphics::Browser::Plugin, which defines
reasonable (but uninteresting) defaults for each of the methods.
Specific behavior is then implemented by selectively overriding certain
methods.
The best way to understand how this works is to look at the source code
for some working plugins. Examples provided with the gbrowse
distribution include:
=over
=item GFFDumper.pm
A simple dumper which produces GFF format output representing the
features of the currently-selected segment.
=item FastaDumper.pm
A more complex dumper that illustrates how to create and manage
persistent user-modifiable settings.
=item SequenceDumper.pm
Another dumper that shows how plugins interact with the Bio::SeqIO system.
=item OligoFinder.pm
A finder that searches for short oligos in the entire database.
(Only works with Bio::DB::GFF databases.)
=item RestrictionAnnotator.pm
An annotator that finds restriction sites in the currently selected
region of the genome. It creates a new track for each type of
restriction site selected.
=item RandomGene.pm
An example annotator that generates random gene-like structures in
the currently displayed region of the genome. It's intended as a
template for front-ends to gene prediction programs.
( run in 0.556 second using v1.01-cache-2.11-cpan-600a1bdf6e4 )