3 See the NOTICE file distributed with
this work
for additional information
4 regarding copyright ownership.
6 Licensed under the Apache License, Version 2.0 (the
"License");
7 you may not use
this file except in compliance with the License.
8 You may obtain a copy of the License at
12 Unless required by applicable law or agreed to in writing, software
13 distributed under the License is distributed on an
"AS IS" BASIS,
14 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 See the License
for the specific language governing permissions and
16 limitations under the License.
23 Please email comments or questions to the
public Ensembl
24 developers list at <http:
26 Questions may also be sent to the Ensembl help desk at
43 This is a feature which extends the
Exon class to add
52 package Bio::EnsEMBL::ExonTranscript;
58 use Scalar::Util qw(weaken isweak);
70 Exceptions : Thrown on invalid -SLICE, -STRAND arguments
71 Caller : general, subclass constructors
79 #allow this to be called as class or object method
80 my $class = ref($caller) || $caller;
81 my $self = $class->SUPER::new(@_);
83 my ($exon, $transcript, $rank) = rearrange([
'EXON',
'TRANSCRIPT',
'RANK'],@_);
85 $self->{
'exon'} = $exon;
86 $self->{
'transcript'} = $transcript;
87 $self->{
'rank'} = $rank;
89 foreach my $attribute (keys %$exon) {
90 $self->{$attribute} = $exon->{$attribute};
100 Example : $exon = $exon_transcript->exon();
101 Description: Getter/Setter
for the
exon forming
this
112 $self->{
'exon'} = shift
if(@_);
113 return $self->{
'exon'};
120 Example : print $utr->type();
121 Description: Getter/Setter
for the parent
transcript
131 $self->{
'transcript'} = shift
if( @_ );
132 return ( $self->{
'transcript'} );
137 Description: Fetch the translation associated with
139 if there is no translation, ie. a pseudogene
153 Description: Get the gene associated with the ExonTranscript,
165 if($self->{
'transcript'}) {
166 return $self->{
'transcript'}->get_Gene();
174 Example : print $et->rank();
175 Description: Getter/Setter
for the
exon rank
185 $self->{
'rank'} = shift
if( @_ );
186 return ( $self->{
'rank'} );
190 =head2 summary_as_hash
192 Example : my $hash = $utr->summary_as_hash();
193 Description: Generates a HashRef compatible with GFFSerializer. Adds
194 rank and
transcript attributes to the basic Feature
203 sub summary_as_hash {
205 my $hash = $self->SUPER::summary_as_hash();
206 $hash->{
'rank'} = $self->rank()
if $self->rank();
207 $hash->{
'Parent'} = $self->transcript->display_id()
if $self->transcript();
208 $hash->{
'source'} = $self->transcript->source()
if $self->transcript();