[ensembl-dev] Undefined Adaptor Seems to Fail Silently

Andy Yates ayates at ebi.ac.uk
Fri Jun 1 08:29:19 BST 2012

Hi Chris

My best guess is that you do not have the ensembl compara cvs checkout on your PERL5LIB. The registry code does some runtime module checking to see if it should attempt to load the compara db to avoid forcing users to bring every ensembl Api checkout onto their lib path.

You can confirm this behaviour by using the verbose flag in your first registry call.

All the best


P.s. you could also try running ensembl/misc-scripts/ping_ensembl.pl which also tries to diagnose your setup

Sent from my mobile.

On 31 May 2012, at 20:18, Chris Kelly <cpjkelly at gmail.com> wrote:

> Hi all,
> I am trying to create a genome_db object in order to test whether or
> not the Ensembl Perl API is working properly on our system so that we
> can eventually use the API to retrieve protein families. I am running
> Debian 4.0, with bioperl 1.2.3, Perl 5.8.8, and Ensembl API version 67
> installed. I am running a script (based off of that in the
> EnsemblTutorial.pdf included in my Compara release) to connect to the
> public Ensembl database, create a GenomeDBAdaptor, and use the
> GenomeDBAdaptor to fetch data. Here is the code:
> use strict;
> use warnings;
> use lib qw( . /programs/bio/ensembl/src/ensembl/modules);
> use Bio::EnsEMBL::Registry;
> my $registry='Bio::EnsEMBL::Registry';
> $registry->load_registry_from_db(
>    -host => 'ensembldb.ensembl.org',
>    -user => 'anonymous',
>    -port => '5306');
> my $genome_db_adaptor = $registry->get_adaptor(
>    'Multi', 'compara', 'GenomeDB');
> my $this_genome_db = $genome_db_adaptor->fetch_by_name_assembly("Homo
> sapiens", "NCBI36");
> This script throws:
> "Can't call method "fetch_by_name_assembly" on an undefined value at
> checker4.pl line 18."
> The arguments passed to fetch_by_name_assembly() appear to be defined,
> so I checked to see if the adaptor itself was defined: "if(defined
> $genome_db_adaptor)" returns false. I have therefore concluded that
> the adaptor itself is undefined, but I can't figure out the reason.
> Perl doesn't complain when creating the adaptor.
> If anyone could suggest a reason why the adaptor or method arguments
> appear to be undefined, I would appreciate it very much.
> Thanks in advance,
> Chris Kelly
> _______________________________________________
> 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