From d03598f11c62607e6fa7e5afdf7085eaaaf35d6e Mon Sep 17 00:00:00 2001 From: Monika Komorowska <mk8@sanger.ac.uk> Date: Mon, 18 Apr 2011 15:25:00 +0000 Subject: [PATCH] Changes to is_circular method. --- modules/Bio/EnsEMBL/Slice.pm | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/modules/Bio/EnsEMBL/Slice.pm b/modules/Bio/EnsEMBL/Slice.pm index 285acc8896..9703cd79ec 100644 --- a/modules/Bio/EnsEMBL/Slice.pm +++ b/modules/Bio/EnsEMBL/Slice.pm @@ -533,12 +533,18 @@ sub is_circular { if ( !defined( $self->adaptor() ) ) { return 0 } if ( !defined( $self->{'circular'} ) ) { - my $attrs = $self->get_all_Attributes('circular_seq'); - if ( defined($attrs) ) { - $self->{'circular'} = ( scalar( @{$attrs} ) > 0 ); + $self->{'circular'} = 0; + + if ( !defined($self->adaptor()->{'is_circular'}) ){ + $self->adaptor()->_build_circular_slice_cache(); + } + + if ($self->adaptor()->{'is_circular'}) { + if ( exists($self->adaptor()->{'circular_sr_id_cache'}->{ $self->adaptor()->get_seq_region_id($self) } ) ) { + $self->{'circular'} = 1; + } } } - return $self->{'circular'}; } -- GitLab