Bio::Graphics::Glyph heterogeneous_segments
SummaryIncluded librariesPackage variablesSynopsisDescriptionGeneral documentationMethods
Toolbar
WebCvsRaw content
Summary
Bio::Graphics::Glyph::heterogeneous_segments - The "heterogeneous_segments" glyph
Package variables
No package variables defined.
Included modules
Bio::Graphics::Glyph::graded_segments
Inherit
Bio::Graphics::Glyph::graded_segments
Synopsis
  See Bio::Graphics::Panel and Bio::Graphics::Glyph.
Description
This glyph acts like graded_segments but the bgcolor of each segment (sub-feature)
can be individually set using the source field of the feature.
Each segment type color is specified using the following nomenclature:
 -{source}_color => $color
For example, if the feature consists of a gene containing both
confirmed and unconfirmed exons, you can make the confirmed exons
green and the unconfirmed ones red this way:
  -confirmed_color   => 'green',
-unconfirmed_color => 'red'
The following options are standard among all Glyphs. See
Bio::Graphics::Glyph for a full explanation.
  Option      Description                      Default
------ ----------- -------
-fgcolor Foreground color black -outlinecolor Synonym for -fgcolor -bgcolor Background color turquoise -fillcolor Synonym for -bgcolor -linewidth Line width 1 -height Height of glyph 10 -font Glyph font gdSmallFont -connector Connector type 0 (false) -connector_color Connector color black -label Whether to draw a label 0 (false) -description Whether to draw a description 0 (false)
Methods
draw
No description
Code
keyglyph
No description
Code
Methods description
None available.
Methods code
drawdescriptionprevnextTop
sub draw {
  my $self = shift;

  # bail out if this isn't the right kind of feature
# handle both das-style and Bio::SeqFeatureI style,
# which use different names for subparts.
my @parts = $self->parts; @parts = $self if !@parts && $self->level == 0; return $self->SUPER::draw(@_) unless @parts; # figure out the colors
$self->{source2color} ||= {}; my $fill = $self->bgcolor; for my $part (@parts) { my $s = eval { $part->feature->source_tag } or next; $self->{source2color}{$s} ||= $self->color(lc($s)."_color") || $fill; $part->{partcolor} = $self->{source2color}{$s}; } $self->Bio::Graphics::Glyph::generic::draw(@_); } # synthesize a key glyph
}
keyglyphdescriptionprevnextTop
sub keyglyph {
  my $self = shift;
  
  my $scale = 1/$self->scale;  # base pairs/pixel

  # two segments, at pixels 0->50, 60->80
my $offset = $self->panel->offset; my $feature = Bio::Graphics::Feature->new( -segments=>[ [ 0*$scale +$offset,25*$scale+$offset], [ 25*$scale +$offset,50*$scale+$offset], [ 50*$scale+$offset, 75*$scale+$offset] ], -name => $self->option('key'), -strand => '+1'); my @sources = grep {/_color$/} $self->factory->options; foreach (@sources) {s/_color$//} ($feature->segments)[0]->source_tag($sources[1]); ($feature->segments)[1]->source_tag($sources[0]); ($feature->segments)[2]->source_tag($sources[2]); my $factory = $self->factory->clone; $factory->set_option(label => 1); $factory->set_option(bump => 0); $factory->set_option(connector => 'solid'); my $glyph = $factory->make_glyph(0,$feature); return $glyph; } 1;
}
General documentation
BUGSTop
Please report them.
SEE ALSOTop
Bio::Graphics::Panel,
Bio::Graphics::Glyph,
Bio::Graphics::Glyph::arrow,
Bio::Graphics::Glyph::cds,
Bio::Graphics::Glyph::crossbox,
Bio::Graphics::Glyph::diamond,
Bio::Graphics::Glyph::dna,
Bio::Graphics::Glyph::dot,
Bio::Graphics::Glyph::ellipse,
Bio::Graphics::Glyph::extending_arrow,
Bio::Graphics::Glyph::generic,
Bio::Graphics::Glyph::graded_segments,
Bio::Graphics::Glyph::heterogeneous_segments,
Bio::Graphics::Glyph::line,
Bio::Graphics::Glyph::pinsertion,
Bio::Graphics::Glyph::primers,
Bio::Graphics::Glyph::rndrect,
Bio::Graphics::Glyph::segments,
Bio::Graphics::Glyph::ruler_arrow,
Bio::Graphics::Glyph::toomany,
Bio::Graphics::Glyph::transcript,
Bio::Graphics::Glyph::transcript2,
Bio::Graphics::Glyph::translation,
Bio::Graphics::Glyph::triangle,
Bio::DB::GFF,
Bio::SeqI,
Bio::SeqFeatureI,
Bio::Das,
GD
AUTHORTop
Lincoln Stein <lstein@cshl.org>
Copyright (c) 2001 Cold Spring Harbor Laboratory
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself. See DISCLAIMER.txt for
disclaimers of warranty.