Commit 2e885db2 authored by Andreas Kusalananda Kähäri's avatar Andreas Kusalananda Kähäri
Browse files

In fetch_by_region_unique(): Clean it up and remove deprecated call to

Slice::dbID().
parent 7f5d7a5a
...@@ -481,25 +481,34 @@ sub fetch_by_region { ...@@ -481,25 +481,34 @@ sub fetch_by_region {
sub fetch_by_region_unique { sub fetch_by_region_unique {
my $self = shift; my $self = shift;
my @out=();
my @out = ();
my $slice = $self->fetch_by_region(@_); my $slice = $self->fetch_by_region(@_);
$self->_build_exception_cache() if(!exists $self->{'asm_exc_cache'}); if ( !exists( $self->{'asm_exc_cache'} ) ) {
if(exists $self->{asm_exc_cache}->{$slice->dbID}) { $self->_build_exception_cache();
}
# Dereference symlinked assembly regions. Take out
# any regions which are symlinked because these are duplicates if ( exists(
my @projection = @{$self->fetch_normalized_slice_projection($slice)}; $self->{'asm_exc_cache'}->{ $self->get_seq_region_id($slice) }
foreach my $segment ( @projection) { ) )
if($segment->[2]->seq_region_name() eq $slice->seq_region_name() && {
$segment->[2]->coord_system->equals($slice->coord_system)) { # Dereference symlinked assembly regions. Take out any regions
push @out, $segment->[2]; # which are symlinked because these are duplicates.
my @projection =
@{ $self->fetch_normalized_slice_projection($slice) };
foreach my $segment (@projection) {
if ( $segment->[2]->seq_region_name() eq $slice->seq_region_name()
&& $segment->[2]->coord_system->equals( $slice->coord_system ) )
{
push( @out, $segment->[2] );
} }
} }
} }
return \@out; return \@out;
} } ## end sub fetch_by_region_unique
=head2 fetch_by_name =head2 fetch_by_name
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment