File: read_pair.pm

package info (click to toggle)
libbio-graphics-perl 2.40-7
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,276 kB
  • sloc: perl: 21,801; makefile: 14
file content (61 lines) | stat: -rwxr-xr-x 1,321 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
package Bio::Graphics::Glyph::read_pair;

#specialized for SAM read pairs

use base 'Bio::Graphics::Glyph::segments';

sub my_description {
    return <<END;
This glyph is designed to be used with SAM/BAM paired end read/mate-pair data. It has
the same properties as the segments glyph, but draws mate pairs as two gapped alignments
connected by dashed lines. Mate pairs that overlap are rendered in a rational fashion.
END
}

sub connector {
    my $self = shift;
    return $self->level == 0 ? 'dashed' : 'solid';
}

sub parts_overlap { 1 }

sub box_subparts { 2 }

sub stranded { 
    my $self = shift;
    my $s    = $self->SUPER::stranded;
    return defined $s ? $s : 1;
}

sub bgcolor {
    my $self = shift;
    my $bg   = $self->option('bgcolor');
    $bg      = $self->feature->strand > 0  ? 'red' : 'blue' unless defined $bg;
    return $self->factory->translate_color($bg);
}

sub draw_target {
    my $self = shift;
    my $t    = $self->option('draw_target');
    return $t if defined $t;
    return 1;
}

sub show_mismatch {
    my $self = shift;
    my $t    = $self->option('show_mismatch');
    return $t if defined $t;
    return 1;
}

sub label_position {
    my $self = shift;
    my $t    = $self->option('label_position');
    return $t if defined $t;
    return 'left';
}

sub maxdepth { 2 }

1;