[ensembl-dev] Problem with DBAdaptor

Luc Merenda merenda.luc at gmail.com
Wed Jun 29 11:08:38 BST 2011


Ok, solved it by downloading the last version of the apis and by using
the snippet from Ian.
Thank you very much guys!
Cheers.
Luc


2011/6/29 Andy Yates <ayates at ebi.ac.uk>:
> Hi Luc,
>
> Make sure that you've got the compara libraries on your PERL5LIB otherwise the registry will not load the compara database connection. Also the compara species is multi so the call should be:
>
> my $compara_dba = Bio::EnsEMBL::Registry->get_DBAdaptor('multi', 'compara');
>
> Regards,
>
> Andy
>
> On 29 Jun 2011, at 10:16, ian Longden wrote:
>
>> 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/
>>>
>>>
>>
>> _______________________________________________
>> 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/
>
> --
> Andrew Yates                   Ensembl Genomes Engineer
> EMBL-EBI                       Tel: +44-(0)1223-492538
> Wellcome Trust Genome Campus   Fax: +44-(0)1223-494468
> Cambridge CB10 1SD, UK         http://www.ensemblgenomes.org/
>
>
>
>
>




More information about the Dev mailing list