Bio::Graphics::Glyph redgreen_segment
SummaryIncluded librariesPackage variablesSynopsisDescriptionGeneral documentationMethods
Toolbar
WebCvsRaw content
Summary
Bio::Graphics::Glyph::redgreen_segments - The "redgreen_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 is similar to the graded_segments glyph except that it
generates a green->red gradient suitable for use with microarray data.
A feature score of 0 is full green; a feature score of 1.0 is full
red; intermediate scores are shades of yellow. 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
HSVtoRGB
No description
Code
calculate_color
No description
Code
mMax
No description
Code
mMin
No description
Code
Methods description
None available.
Methods code
HSVtoRGBdescriptionprevnextTop
sub HSVtoRGB {
($$$) {  my ($h,$s,$v)=@_;
  my ($r,$g,$b,$i,$f,$p,$q,$t);

  if( $s == 0 ) {
    ## achromatic (grey)
return ($v,$v,$v); } $h /= 60; ## sector 0 to 5
$i = int($h);
$f = $h - $i; ## factorial part of h
$p = $v * ( 1 - $s ); $q = $v * ( 1 - $s * $f ); $t = $v * ( 1 - $s * ( 1 - $f ) ); if($i<1) { $r = $v; $g = $t; $b = $p; } elsif($i<2){ $r = $q; $g = $v; $b = $p; } elsif($i<3){ $r = $p; $g = $v; $b = $t; } elsif($i<4){ $r = $p; $g = $q; $b = $v; } elsif($i<5){ $r = $t; $g = $p; $b = $v; } else { $r = $v; $g = $p; $b = $q; } return ($r,$g,$b);
}
calculate_colordescriptionprevnextTop
sub calculate_color {
  my $self = shift;
  my $val  = shift;
  return (0,0,0) unless $val =~ /^[\d.]+$/;
  return HSVtoRGB(120*(1-$val),1,255);
}
mMaxdescriptionprevnextTop
sub mMax {
        my $n=0;
        map { $n=($n<$_) ? $_ : $n } @_;
        return($n);     
}


1;
}
mMindescriptionprevnextTop
sub mMin {
        my $n=10000000000000;
        map { $n=($n>$_) ? $_ : $n } @_;
        return($n);
}
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.