Bio::Graphics::Glyph::pairplot3pm
The "pairwise plot" glyph
Usage
use Bio::Graphics;# create the panel, etc. See Bio::Graphics::Panel# for the synopsis# Create one big feature using the PairFeature# glyph (see end of synopsis for an implementation)my $block = PairFeature->new(-start=> 2001,-end => 10000);# It will contain a series of subfeatures.my $start = 2001;while ($start < 10000) {my $end = $start+120;$block->add_SeqFeature($bsg->new(-start=>$start,-end =>$end),'EXPAND');$start += 200;}$panel->add_track($block,-glyph => 'pairplot',-angle => 45,-bgcolor => 'red',-point => 1,);print $panel->png;package PairFeature;use base 'Bio::SeqFeature::Generic';sub pair_score {my $self = shift;my ($sf1,$sf2) = @_;# simple distance functionmy $dist = $sf2->end - $sf1->start;my $total = $self->end - $self->start;return sprintf('%2.2f',1-$dist/$total);}
Overview
This glyph draws a "triangle plot" similar to the ones used to show linkage disequilibrium between a series of genetic markers. It is basically a dotplot drawn at a 45 degree angle, with each diamond-shaped region colored with an intensity proportional to an arbitrary scoring value relating one feature to another (typically a D' value in LD studies).
This glyph requires more preparation than other glyphs. First, you must create a subclass of Bio::SeqFeature::Generic (or Bio::Graphics::Feature, if you prefer) that has a pair_score() method. The pair_score() method will take two features and return a numeric value between 0.0 and 1.0, where higher values mean more intense.
You should then create a feature of this new type and use add_SeqFeature() to add to it all the genomic features that you wish to compare.
Then add this feature to a track using the pairplot glyph. When the glyph renders the feature, it will interrogate the pair_score() method for each pair of subfeatures.
Options
In addition to the common options, the following glyph-specific options are recognized:
Option Description Default------ ----------- --------point If true, the plot will be 0drawn relative to themidpoint between each adjacentsubfeature. This is appropriatefor point-like subfeatures, suchas SNPs.-angle Angle to draw the plot. Values 45between 1 degree and 89 degreesare valid. Higher angles givea more vertical plot.-bgcolor The color of the plot. cyan
Releases
8 releases since Debian 6.0 (Squeeze); the text changed 5 times.