From c22a2d5e6ae23a3b5534be98e6cbe5cfa7ec543b Mon Sep 17 00:00:00 2001 From: Web Admin <w3adm@sanger.ac.uk> Date: Fri, 26 Mar 2004 17:27:06 +0000 Subject: [PATCH] genes can now be got off other databases --- modules/Bio/EnsEMBL/Slice.pm | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/modules/Bio/EnsEMBL/Slice.pm b/modules/Bio/EnsEMBL/Slice.pm index 94646e2949..32881b3eaa 100644 --- a/modules/Bio/EnsEMBL/Slice.pm +++ b/modules/Bio/EnsEMBL/Slice.pm @@ -73,6 +73,7 @@ use Bio::EnsEMBL::Utils::Sequence qw(reverse_comp); use Bio::EnsEMBL::ProjectionSegment; +use Data::Dumper; #inheritance to Bio::EnsEMBL::Root will eventually be removed @ISA = qw(Bio::EnsEMBL::Root Bio::PrimarySeqI); @@ -1149,15 +1150,21 @@ sub get_all_SNPs { =cut sub get_all_Genes{ - my ($self, $logic_name) = @_; + my ($self, $logic_name, $dbtype) = @_; + my $db; + if($dbtype) { + $db = $self->adaptor->db->get_db_adaptor($dbtype); + if(!$db) { + warning("Don't have db $dbtype returning empty list\n"); + return []; + } + } else { + $db = $self->adaptor->db; + } - #caching is performed on a per slice basis in the GeneAdaptor - return $self->adaptor->db->get_GeneAdaptor->fetch_all_by_Slice($self, - $logic_name); + return $db->get_GeneAdaptor()->fetch_all_by_Slice( $self, $logic_name ); } - - =head2 get_all_Genes_by_type -- GitLab