Mercurial > repos > mahtabm > ensembl
comparison variant_effect_predictor/Bio/Graphics/Glyph/splice_site.pm @ 0:1f6dce3d34e0
Uploaded
author | mahtabm |
---|---|
date | Thu, 11 Apr 2013 02:01:53 -0400 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:1f6dce3d34e0 |
---|---|
1 package Bio::Graphics::Glyph::splice_site; | |
2 | |
3 use strict; | |
4 use vars '@ISA'; | |
5 @ISA = 'Bio::Graphics::Glyph::generic'; | |
6 use Bio::Graphics::Glyph::generic; | |
7 | |
8 use constant PWIDTH => 3; | |
9 | |
10 sub draw_component { | |
11 my $self = shift; | |
12 my $gd = shift; | |
13 my ($left,$top) = @_; | |
14 my($x1,$y1,$x2,$y2) = $self->bounds(@_); | |
15 | |
16 my $center = int(0.5+($x1+$x2)/2); | |
17 my $direction = $self->option('direction'); | |
18 | |
19 my $height = $y2 - $y1; | |
20 my $fraction = $self->option('height_fraction') || 1.0; | |
21 my $bottom = $y2; | |
22 $top = $y2 - $fraction * $height; | |
23 | |
24 # draw the base | |
25 my $fgcolor = $self->fgcolor; | |
26 $gd->line($center,$bottom,$center,$top,$fgcolor); | |
27 | |
28 if ($direction eq 'right') { | |
29 $gd->line($center,$top,$center + PWIDTH,$top,$fgcolor); | |
30 } elsif ($direction eq 'left') { | |
31 $gd->line($center,$top,$center - PWIDTH,$top,$fgcolor); | |
32 } | |
33 | |
34 } | |
35 | |
36 1; | |
37 | |
38 | |
39 =head1 NAME | |
40 | |
41 Bio::Graphics::Glyph::splice_site - The "splice_site" glyph | |
42 | |
43 =head1 SYNOPSIS | |
44 | |
45 See L<Bio::Graphics::Panel> and L<Bio::Graphics::Glyph>. | |
46 | |
47 =head1 DESCRIPTION | |
48 | |
49 This glyph was designed to show an inverted "L" representing splice | |
50 donors and acceptors. The vertical part of the L points downwards and | |
51 is positioned in the center of the range (even if the range is quite | |
52 large). | |
53 | |
54 In addition to the usual glyph options, this glyph recognizes: | |
55 | |
56 Option Value Description | |
57 ------ ----- ----------- | |
58 | |
59 direction "left" or "right" direction the short part of the L | |
60 points | |
61 | |
62 height_fraction 0.0 - 1.0 fractional height of the glyph, | |
63 usually a callback that uses the | |
64 feature's score to determine its | |
65 height | |
66 | |
67 =head1 BUGS | |
68 | |
69 Please report them. | |
70 | |
71 =head1 SEE ALSO | |
72 | |
73 | |
74 L<Bio::Graphics::Panel>, | |
75 L<Bio::Graphics::Glyph>, | |
76 L<Bio::Graphics::Glyph::arrow>, | |
77 L<Bio::Graphics::Glyph::cds>, | |
78 L<Bio::Graphics::Glyph::crossbox>, | |
79 L<Bio::Graphics::Glyph::diamond>, | |
80 L<Bio::Graphics::Glyph::dna>, | |
81 L<Bio::Graphics::Glyph::dot>, | |
82 L<Bio::Graphics::Glyph::ellipse>, | |
83 L<Bio::Graphics::Glyph::extending_arrow>, | |
84 L<Bio::Graphics::Glyph::generic>, | |
85 L<Bio::Graphics::Glyph::graded_segments>, | |
86 L<Bio::Graphics::Glyph::heterogeneous_segments>, | |
87 L<Bio::Graphics::Glyph::line>, | |
88 L<Bio::Graphics::Glyph::pinsertion>, | |
89 L<Bio::Graphics::Glyph::primers>, | |
90 L<Bio::Graphics::Glyph::rndrect>, | |
91 L<Bio::Graphics::Glyph::chromosome>, | |
92 L<Bio::Graphics::Glyph::segments>, | |
93 L<Bio::Graphics::Glyph::ruler_arrow>, | |
94 L<Bio::Graphics::Glyph::toomany>, | |
95 L<Bio::Graphics::Glyph::transcript>, | |
96 L<Bio::Graphics::Glyph::transcript2>, | |
97 L<Bio::Graphics::Glyph::translation>, | |
98 L<Bio::Graphics::Glyph::triangle>, | |
99 L<Bio::DB::GFF>, | |
100 L<Bio::SeqI>, | |
101 L<Bio::SeqFeatureI>, | |
102 L<Bio::Das>, | |
103 L<GD> | |
104 | |
105 =head1 AUTHOR | |
106 | |
107 Xiaokang Pan E<lt>pan@cshl.orgE<gt> | |
108 | |
109 Copyright (c) 2001 BDGP | |
110 | |
111 This library is free software; you can redistribute it and/or modify | |
112 it under the same terms as Perl itself. See DISCLAIMER.txt for | |
113 disclaimers of warranty. | |
114 | |
115 =cut |