GBrowse
view release on metacpan or search on metacpan
lib/Bio/Graphics/Browser2/Plugin.pm view on Meta::CPAN
.
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,$coordinate_mapper) = @_;
my $config = $self->configuration;
my $feature_list = $self->new_feature_list;
$feature_list->add_type('my_type' => {glyph => 'generic',
key => 'my type',
bgcolor => 'green',
link => 'http://www.google.com/search?q=$name'
}
);
# do something with the sequence segment
my @features = do_something();
$feature_list->add_feature($_ => 'my_type') foreach @features;
return $feature_list;
}
=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 4
=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 either 1) return
a list of features which are overlayed on top of the detailed view
(Example: restriction site annotator) or 2) update the database with
new or modified features and return nothing (Example: basic editor)
=item 4) trackfilters
These plugins can be used to reduce the complexity of sites that have
many tracks, by providing search and filtering functions for the track
table. When a trackfilter is active, its form-based user interface is
positioned directly above the tracks table, and changes to the for
cause the list of tracks to be updated dynamically.
=item 5) highlighters
These plugins will color-highlight features based on user-defined
attributes. For example, you could highlight all features that are in
the positive strand.
=item 6) filters
These plugins will filter features based on user-defined
attributes. Only features that match the attributes will be
displayed. For example, you could filter out RNA transcript features
based on their size, so that only features that are less than 50 bp in
length (e.g. short RNAs) are shown.
=back
All plug-ins inherit from Bio::Graphics::Browser2::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 4
=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
( run in 1.114 second using v1.01-cache-2.11-cpan-7fcb06a456a )