[ensembl-dev] Problem with DBAdaptor

ian Longden ianl at ebi.ac.uk
Wed Jun 29 10:16:39 BST 2011


This appears to be a long winded way to get the Compara DBAdaptor.

It would be easier to do :-

my $compara_dba = Bio::EnsEMBL::Registry->get_DBAdaptor("compara","compara");

if(!defined($compara_dba)) {
  die "Could not get Compara DBAdaptor\n";
}

my $member_adaptor   = $compara_dba->get_adaptor('Member');


or even easier ----------------------------------

my $member_adaptor =
Bio::EnsEMBL::Registry->get_adaptor("compara","compara", "member);

if(!defined($member_adaptor)){
  die "Could not get compara member adaptor\n";
}



It could be that your API and schema do not match which could mean you
could get no
adaptors.  If you are using load_registry_from_db then add  -verbose
=> 1 to make sure you are connecting properly.


-Ian Longden.
Ensembl Developer.


On Wed, Jun 29, 2011 at 10:01 AM, Luc Merenda <merenda.luc at gmail.com> wrote:
> Hi Ensembl,
> I've been using a perl script that uses the ensembl compara api to retrieve
> protein trees. It worked fine until last week, now it exits with the
> following error:
> Can't call method "get_adaptor" on an undefined value at
> /home/luc/Code/gene2proteintree line 22, <FILE> line 43.
> It seems that there is a problem connecting to the server.
> The line of code where the error occurs is the last one of the following
> snippet:
>
>     my $compara_dba;
>     foreach my $dba( @{Bio::EnsEMBL::Registry->get_all_DBAdaptors()} ){
>         if( $dba->isa('Bio::EnsEMBL::Compara::DBSQL::DBAdaptor') ){
>           $compara_dba = $dba;
>           last;
>         }
>     }
>     my $member_adaptor   = $compara_dba->get_adaptor('Member');
>
> Many thanks in advance
>
> Luc
>
> _______________________________________________
> Dev mailing list    Dev at ensembl.org
> List admin (including subscribe/unsubscribe):
> http://lists.ensembl.org/mailman/listinfo/dev
> Ensembl Blog: http://www.ensembl.info/
>
>




More information about the Dev mailing list