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
34 initio prediction method
48 # seq() returns a Bio::Seq
49 my $seq = $exon->seq->seq();
51 # peptide() only makes sense within transcript context
52 my $pep = $exon->peptide($transcript)->seq();
54 # Normal feature operations can be performed:
55 $exon = $exon->transform(
'clone');
56 $exon->move( $new_start, $new_end, $new_strand );
57 print $exon->slice->seq_region_name();
61 This is a
class which represents an prediction
exon which is part of a
85 Description: create an
Exon object
96 $class = ref $class || $class;
98 my $self = $class->SUPER::new( @_ );
100 my ( $p_value, $score ) =
101 rearrange( [
"P_VALUE",
"SCORE" ], @_ );
103 $self->{
'p_value'} = $p_value;
104 $self->{
'score'} = $score;
112 Arg [1] :
string $newval (optional)
113 The
new value to set the score attribute to
114 Example : $score = $obj->score()
115 Description: Getter/Setter
for the score attribute
125 $self->{
'score'} = shift
if(@_);
126 return $self->{
'score'};
133 Arg [1] :
string $newval (optional)
134 The
new value to set the p_value attribute to
135 Example : $p_value = $obj->p_value()
136 Description: Getter/Setter
for the p_value attribute
146 $self->{
'p_value'} = shift
if(@_);
147 return $self->{
'p_value'};
153 Arg [1] : (optional)
int $end_phase
154 Example : $end_phase = $feat->end_phase;
155 Description: Gets/Sets the end phase of the
exon.
156 end_phase = number of bases from the last incomplete codon of
158 Usually, end_phase = (phase + exon_length)%3
159 but end_phase could be -1
if the
exon is half-coding and its 3
162 Exceptions : warning
if end_phase is called without an argument and the
174 throw(
"End_phase setting not supported" );
176 return ($self->phase() + $self->length()) % 3;
182 Arg 1 : String $coordinate_system_name
183 Arg [2] : String $coordinate_system_version
184 Description: moves
this exon to the given coordinate system. If
this exon has
185 attached supporting evidence, they move as well.
187 Exceptions : wrong parameters
197 # catch for old style transform calls
198 if( !@_ || ( ref $_[0] && ($_[0]->isa(
"Bio::EnsEMBL::Slice" ) or $_[0]->isa(
"Bio::EnsEMBL::LRGSlice" )))) {
199 throw(
"transform needs coordinate systems details now," .
200 "please use transfer" );
204 return undef unless $new_exon;
206 #dont want to share the same sequence cache
207 delete $new_exon->{
'_seq_cache'};
218 Description: Moves
this Exon to given target slice coordinates. If Features
219 are attached they are moved as well. Returns a
new exon.
231 return undef unless $new_exon;
233 #dont want to share the same sequence cache
234 delete $new_exon->{
'_seq_cache'};
239 =head2 summary_as_hash
241 Example : $exon_summary = $exon->summary_as_hash();
242 Description : Extends Feature::summary_as_hash
243 Retrieves a summary of
this prediction
exon.
244 Returns : hashref of descriptive strings
245 Status : Intended
for internal use
248 sub summary_as_hash {
250 my $summary_ref = $self->SUPER::summary_as_hash;
251 delete $summary_ref->{
'constitutive'};
252 delete $summary_ref->{
'ensembl_phase'};
253 delete $summary_ref->{
'ensembl_end_phase'};
254 $summary_ref->{
'Parent'} = $self->transcript->dbID()
if $self->transcript();
255 $summary_ref->{
'source'} = $self->prediction_transcript->analysis->gff_source() ||
'ensembl';
260 Example : $prediction_transcript = $exon->transcript;
261 Description : Locates the parent prediction
transcript using an
exon dbID
262 Same as prediction_transcript, duplicated
for compatibility
270 return $self->prediction_transcript;
273 =head2 prediction_transcript
275 Example : $prediction_transcript = $exon->prediction_transcript;
276 Description : Locates the parent prediction
transcript using an
exon dbID
281 sub prediction_transcript{
283 my $prediction_transcript_adaptor = $self->
adaptor->
db->get_PredictionTranscriptAdaptor();
284 my $parent_prediction_transcript = $prediction_transcript_adaptor->fetch_by_prediction_exon_id($self->dbID);
285 return $parent_prediction_transcript;
289 =head2 add_supporting_features
298 sub add_supporting_features { }
301 =head2 get_all_supporting_features
304 Does nothing and returns empty list
305 Returntype : empty list.
310 sub get_all_supporting_features {
return []; }
313 =head2 find_supporting_evidence
317 Returntype : empty list.
322 sub find_supporting_evidence {
return []; }