diff --git a/modules/Bio/EnsEMBL/Intron.pm b/modules/Bio/EnsEMBL/Intron.pm index 815da51ca2bc4d6517ac3c42b44f3747b8b6753b..69414fb1ab9eaf104458bcad9299f22eafc5aba4 100644 --- a/modules/Bio/EnsEMBL/Intron.pm +++ b/modules/Bio/EnsEMBL/Intron.pm @@ -162,6 +162,24 @@ sub next_Exon { return $self->{'next'}; } +=head2 rank + + Args : none + Example : $rank = $intron->rank + Description: Returns the rank of this Intron + Returntype : Integer + Exceptions : none + Caller : general + Status : Stable + +=cut + +sub rank { + my ($self, $transcript) = @_; + + return $self->prev_Exon->rank($transcript); +} + =head2 is_splice_canonical Example : my $canonical = $intron->is_splice_canonical(); diff --git a/modules/t/intron.t b/modules/t/intron.t index 09cd7a3433219cfc062dbc6371d939173c1141d9..4cd0c36466f7decb0dde307dccac547760a331b5 100644 --- a/modules/t/intron.t +++ b/modules/t/intron.t @@ -42,8 +42,10 @@ my $transcript = my @exons = (@{$transcript->get_all_Exons()}); my @introns = (@{$transcript->get_all_Introns()}); -my $i=0; +my $rank=1; foreach my $intron (@introns){ + is($intron->rank($transcript), $rank, "Checking intron rank"); + $rank++; ok($intron->prev_Exon->end == $intron->start-1); ok($intron->next_Exon->start == $intron->end+1); ok($intron->is_splice_canonical(), 'Checking Intron is canonical in its splicing');