blib/lib/Bio/Graphics/Glyph/segmented_keyglyph.pm untested

filter: Statementstmt 0.0% 0 / 14 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 3 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 18 CC 1 SCAR 6.9
CC
1
Cov
0%
make_key_feature
2.0
BEGIN
2.0
BEGIN
2.0
CRAP 2.0
1 package Bio::Graphics::Glyph::segmented_keyglyph;
2  
3 # Don't use this package. It's just for inheriting the segmented glyph in the panel key.
4  
5 use strict;
6 use base qw(Bio::Graphics::Glyph::generic);
7  
8 sub make_key_feature {
9 my $self = shift;
10 my $scale = 1/$self->scale; # base pairs/pixel
11 # two segments, at pixels 0->50, 60->80
12 my $offset = $self->panel->offset;
13 my $feature =
14 Bio::Graphics::Feature->new(
15 -segments=>[ [ 0*$scale +$offset,50*$scale+$offset],
16 [60*$scale+$offset, 80*$scale+$offset]
17 ],
18 -name => $self->make_key_name(),
19 -strand => '+1',
20 );
21 }
22  
23 1;
24  
25 __END__