[ensembl-dev] Undefined Adaptor Seems to Fail Silently
mp at ebi.ac.uk
mp at ebi.ac.uk
Fri Jun 1 09:47:15 BST 2012
Your script is working fine in my hands. You can try using the -verbose
option in load_registry_from_db to see if you are having problems with the
-verbose => 1,
-host => 'ensembldb.ensembl.org',
-user => 'anonymous',
-port => '5306');
or test that you have a valid registry by printing $registry.
Let me know if this helps you to track down the problem.
Also, once you get the genomeDB adaptor, make sure that you use
"Homo_sapiens" as species name.
> 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';
> -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):
> Ensembl Blog: http://www.ensembl.info/
More information about the Dev