Bio::Graphics::Panel

Bio::Graphics::Panel is a Perl module to generate GD images of Bio::Seq objects.
Download

Bio::Graphics::Panel Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Lincoln Stein
  • Publisher web site:
  • http://search.cpan.org/~lds/Crypt-CBC-2.29/CBC.pm

Bio::Graphics::Panel Tags


Bio::Graphics::Panel Description

Bio::Graphics::Panel is a Perl module to generate GD images of Bio::Seq objects. Bio::Graphics::Panel is a Perl module to generate GD images of Bio::Seq objects.SYNOPSIS # This script parses a GenBank or EMBL file named on the command # line and produces a PNG rendering of it. Call it like this: # render.pl my_file.embl | display - use strict; use Bio::Graphics; use Bio::SeqIO; my $file = shift or die "provide a sequence file as the argument"; my $io = Bio::SeqIO->new(-file=>$file) or die "could not create Bio::SeqIO"; my $seq = $io->next_seq or die "could not find a sequence in the file"; my @features = $seq->all_SeqFeatures; # sort features by their primary tags my %sorted_features; for my $f (@features) { my $tag = $f->primary_tag; push @{$sorted_features{$tag}},$f; } my $panel = Bio::Graphics::Panel->new( -length => $seq->length, -key_style => 'between', -width => 800, -pad_left => 10, -pad_right => 10, ); $panel->add_track( arrow => Bio::SeqFeature::Generic->new(-start=>1, -end=>$seq->length), -bump => 0, -double=>1, -tick => 2); $panel->add_track(generic => Bio::SeqFeature::Generic->new(-start=>1, -end=>$seq->length), -glyph => 'generic', -bgcolor => 'blue', -label => 1, ); # general case my @colors = qw(cyan orange blue purple green chartreuse magenta yellow aqua); my $idx = 0; for my $tag (sort keys %sorted_features) { my $features = $sorted_features{$tag}; $panel->add_track($features, -glyph => 'generic', -bgcolor => $colors, -fgcolor => 'black', -font2color => 'red', -key => "${tag}s", -bump => +1, -height => 8, -label => 1, -description => 1, ); } print $panel->png; $panel->finished; exit 0;The Bio::Graphics::Panel class provides drawing and formatting services for any object that implements the Bio::SeqFeatureI interface, including Ace::Sequence::Feature and Das::Segment::Feature objects. It can be used to draw sequence annotations, physical (contig) maps, or any other type of map in which a set of discrete ranges need to be laid out on the number line.The module supports a drawing style in which each type of feature occupies a discrete "track" that spans the width of the display. Each track will have its own distinctive "glyph", a configurable graphical representation of the feature.The module also supports a more flexible style in which several different feature types and their associated glyphs can occupy the same track. The choice of glyph is under run-time control.Semantic zooming (for instance, changing the type of glyph depending on the density of features) is supported by a callback system for configuration variables. The module has built-in support for Bio::Das stylesheets, and stylesheet-driven configuration can be intermixed with semantic zooming, if desired.You can add a key to the generated image using either of two key styles. One style places the key captions at the top of each track. The other style generates a graphical key at the bottom of the image.Note that this module depends on GD. The optional SVG output depends on GD::SVG and SVG.Requirements:· Perl Requirements: · Perl


Bio::Graphics::Panel Related Software