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

filter: Statementstmt 0.0% 0 / 25 Branchbran 0.0% 0 / 14 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 11 Podpod 0.0% 0 / 10 totaltotal 0.0% 0 / 60 CC 8 SCAR 17.7
CC
8
Cov
0%
bgcolor
12.0
connector
6.0
stranded
6.0
CRAP 5.9
1 package Bio::Graphics::Glyph::read_pair;
2  
3 #specialized for SAM read pairs
4  
5 use base 'Bio::Graphics::Glyph::segments';
6  
7 sub my_description {
8 return <<END;
9 This glyph is designed to be used with SAM/BAM paired end read/mate-pair data. It has
10 the same properties as the segments glyph, but draws mate pairs as two gapped alignments
11 connected by dashed lines. Mate pairs that overlap are rendered in a rational fashion.
12 END
13 }
14  
15 sub connector {
16 my $self = shift;
17 return $self->level == 0 ? 'dashed' : 'solid';
18 }
19  
20 sub parts_overlap { 1 }
21  
22 sub box_subparts { 2 }
23  
24 sub stranded {
25 my $self = shift;
26 my $s = $self->SUPER::stranded;
27 return defined $s ? $s : 1;
28 }
29  
30 sub bgcolor {
31 my $self = shift;
32 my $bg = $self->option('bgcolor');
33 $bg = $self->feature->strand > 0 ? 'red' : 'blue' unless defined $bg;
34 return $self->factory->translate_color($bg);
35 }
36  
37 sub draw_target {
38 my $self = shift;
39 my $t = $self->option('draw_target');
40 return $t if defined $t;
41 return 1;
42 }
43  
44 sub show_mismatch {
45 my $self = shift;
46 my $t = $self->option('show_mismatch');
47 return $t if defined $t;
48 return 1;
49 }
50  
51 sub label_position {
52 my $self = shift;
53 my $t = $self->option('label_position');
54 return $t if defined $t;
55 return 'left';
56 }
57  
58 sub maxdepth { 2 }
59  
60 1;
61