Mercurial > repos > mahtabm > ensembl
comparison variant_effect_predictor/Bio/Graphics/Glyph/processed_transcript.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::processed_transcript; | |
| 2 | |
| 3 # $Id: processed_transcript.pm,v 1.3.2.1 2003/07/05 00:32:04 lstein Exp $ | |
| 4 | |
| 5 use strict; | |
| 6 use Bio::Graphics::Glyph::transcript2; | |
| 7 use vars '@ISA'; | |
| 8 @ISA = 'Bio::Graphics::Glyph::transcript2'; | |
| 9 use constant DEFAULT_UTR_COLOR => '#D0D0D0'; | |
| 10 | |
| 11 sub is_utr { | |
| 12 my $self = shift; | |
| 13 return $self->feature->primary_tag =~ /UTR|untranslated_region/i; | |
| 14 } | |
| 15 | |
| 16 sub thin_utr { | |
| 17 my $self = shift; | |
| 18 $self->option('thin_utr'); | |
| 19 } | |
| 20 | |
| 21 sub utr_color { | |
| 22 my $self = shift; | |
| 23 return $self->color('utr_color') if $self->option('utr_color'); | |
| 24 return $self->factory->translate_color(DEFAULT_UTR_COLOR); | |
| 25 } | |
| 26 | |
| 27 sub height { | |
| 28 my $self = shift; | |
| 29 my $height = $self->SUPER::height; | |
| 30 return $height unless $self->thin_utr; | |
| 31 return $self->is_utr ? int($height/1.5+0.5) : $height; | |
| 32 } | |
| 33 | |
| 34 sub pad_top { | |
| 35 my $self = shift; | |
| 36 my $pad_top = $self->SUPER::pad_top; | |
| 37 return $pad_top unless $self->thin_utr && $self->is_utr; | |
| 38 return $pad_top + int(0.167*$self->SUPER::height + 0.5); | |
| 39 } | |
| 40 | |
| 41 sub bgcolor { | |
| 42 my $self = shift; | |
| 43 return $self->SUPER::bgcolor unless $self->is_utr; | |
| 44 return $self->utr_color; | |
| 45 } | |
| 46 | |
| 47 sub connector { | |
| 48 my $self = shift; | |
| 49 return 'quill' if $self->option('decorate_introns'); | |
| 50 return $self->SUPER::connector(@_); | |
| 51 } | |
| 52 | |
| 53 | |
| 54 1; | |
| 55 | |
| 56 | |
| 57 __END__ | |
| 58 | |
| 59 =head1 NAME | |
| 60 | |
| 61 Bio::Graphics::Glyph::processed_transcript - The sequence ontology transcript glyph | |
| 62 | |
| 63 =head1 SYNOPSIS | |
| 64 | |
| 65 See L<Bio::Graphics::Panel> and L<Bio::Graphics::Glyph>. | |
| 66 | |
| 67 =head1 DESCRIPTION | |
| 68 | |
| 69 This glyph is used for drawing processed transcripts that have both | |
| 70 CDS and UTR segments. The CDS is drawn in the background color, and | |
| 71 the UTRs are drawn in an alternate color selected by the utr_color | |
| 72 option. In addition, you can make the UTRs thinner than the CDS by | |
| 73 setting the "thin_utr" option. | |
| 74 | |
| 75 For this glyph to produce the desired results, you should pass it a | |
| 76 compound Bio::SeqFeature that has subfeatures of primary_tag "CDS" and | |
| 77 "UTR". In fact, you may give it more specific types of UTR, including | |
| 78 5'-UTR, 3'-UTR, or the Sequence Ontology terms "untranslated_region," | |
| 79 "five_prime_untranslated_region," and | |
| 80 "three_prime_untranslated_region." | |
| 81 | |
| 82 =head2 OPTIONS | |
| 83 | |
| 84 The following options are standard among all Glyphs. See | |
| 85 L<Bio::Graphics::Glyph> for a full explanation. | |
| 86 | |
| 87 Option Description Default | |
| 88 ------ ----------- ------- | |
| 89 | |
| 90 -fgcolor Foreground color black | |
| 91 | |
| 92 -outlinecolor Synonym for -fgcolor | |
| 93 | |
| 94 -bgcolor Background color turquoise | |
| 95 | |
| 96 -fillcolor Synonym for -bgcolor | |
| 97 | |
| 98 -linewidth Line width 1 | |
| 99 | |
| 100 -height Height of glyph 10 | |
| 101 | |
| 102 -font Glyph font gdSmallFont | |
| 103 | |
| 104 -connector Connector type undef (false) | |
| 105 | |
| 106 -connector_color | |
| 107 Connector color black | |
| 108 | |
| 109 -label Whether to draw a label undef (false) | |
| 110 | |
| 111 -description Whether to draw a description undef (false) | |
| 112 | |
| 113 -strand_arrow Whether to indicate undef (false) | |
| 114 strandedness | |
| 115 | |
| 116 In addition, the alignment glyph recognizes the following | |
| 117 glyph-specific options: | |
| 118 | |
| 119 Option Description Default | |
| 120 ------ ----------- ------- | |
| 121 | |
| 122 -thin_utr Flag. If true, UTRs will undef (false) | |
| 123 be drawn at 2/3 of the | |
| 124 height of CDS segments. | |
| 125 | |
| 126 -utr_color Color of UTR segments. Gray #D0D0D0 | |
| 127 | |
| 128 -decorate_introns | |
| 129 Draw strand with little arrows undef (false) | |
| 130 on the intron. | |
| 131 | |
| 132 =head1 BUGS | |
| 133 | |
| 134 Please report them. | |
| 135 | |
| 136 =head1 SEE ALSO | |
| 137 | |
| 138 | |
| 139 L<Bio::Graphics::Panel>, | |
| 140 L<Bio::Graphics::Glyph>, | |
| 141 L<Bio::Graphics::Glyph::arrow>, | |
| 142 L<Bio::Graphics::Glyph::cds>, | |
| 143 L<Bio::Graphics::Glyph::crossbox>, | |
| 144 L<Bio::Graphics::Glyph::diamond>, | |
| 145 L<Bio::Graphics::Glyph::dna>, | |
| 146 L<Bio::Graphics::Glyph::dot>, | |
| 147 L<Bio::Graphics::Glyph::ellipse>, | |
| 148 L<Bio::Graphics::Glyph::extending_arrow>, | |
| 149 L<Bio::Graphics::Glyph::generic>, | |
| 150 L<Bio::Graphics::Glyph::graded_segments>, | |
| 151 L<Bio::Graphics::Glyph::heterogeneous_segments>, | |
| 152 L<Bio::Graphics::Glyph::line>, | |
| 153 L<Bio::Graphics::Glyph::pinsertion>, | |
| 154 L<Bio::Graphics::Glyph::primers>, | |
| 155 L<Bio::Graphics::Glyph::rndrect>, | |
| 156 L<Bio::Graphics::Glyph::segments>, | |
| 157 L<Bio::Graphics::Glyph::ruler_arrow>, | |
| 158 L<Bio::Graphics::Glyph::toomany>, | |
| 159 L<Bio::Graphics::Glyph::transcript>, | |
| 160 L<Bio::Graphics::Glyph::transcript2>, | |
| 161 L<Bio::Graphics::Glyph::translation>, | |
| 162 L<Bio::Graphics::Glyph::triangle>, | |
| 163 L<Bio::DB::GFF>, | |
| 164 L<Bio::SeqI>, | |
| 165 L<Bio::SeqFeatureI>, | |
| 166 L<Bio::Das>, | |
| 167 L<GD> | |
| 168 | |
| 169 =head1 AUTHOR | |
| 170 | |
| 171 Lincoln Stein E<lt>lstein@cshl.orgE<gt> | |
| 172 | |
| 173 Copyright (c) 2001 Cold Spring Harbor Laboratory | |
| 174 | |
| 175 This library is free software; you can redistribute it and/or modify | |
| 176 it under the same terms as Perl itself. See DISCLAIMER.txt for | |
| 177 disclaimers of warranty. | |
| 178 | |
| 179 =cut |
