[ensembl-dev] Release 65 - 'not a valid species name' exception thrown by get_adaptor()

Giuseppe G. G.Gallone at sms.ed.ac.uk
Tue Jan 24 15:11:36 GMT 2012


Thanks a lot G

On 23/01/12 09:49, Uma Maheswari wrote:
> Hi Giuseppe,
>
> It was a permission problem, it is fixed now. Thanks for pointing this.
>
> Uma
> On 23/01/12 09:37, Andy Yates wrote:
>> Hi Giuseppe,
>>
>> This looks more like an Ensembl Genomes error as I cannot find any
>> compara database for release 12 on their public server. I will raise
>> issue with them ASAP
>>
>> Andy
>>
>> Andrew Yates Ensembl Core Software Project Leader
>> EMBL-EBI Tel: +44-(0)1223-492538
>> Wellcome Trust Genome Campus Fax: +44-(0)1223-494468
>> Cambridge CB10 1SD, UK http://www.ensembl.org/
>>
>> On 20 Jan 2012, at 20:49, Giuseppe G. wrote:
>>
>>> Hi Andy,
>>>
>>> thanks for your reply. Unfortunately there are more problems. I'm not
>>> able anymore to create any genome DB adaptors for Ensemblgenomes
>>> families.
>>>
>>> When I do
>>> my $registry = 'Bio::EnsEMBL::Registry';
>>> $registry->load_registry_from_multiple_dbs(
>>> { #VERTEBRATES
>>> -host => 'ensembldb.ensembl.org',
>>> -user => 'anonymous',
>>> },
>>> { #EnsemblGenomes
>>> -host => 'mysql.ebi.ac.uk',
>>> -user => 'anonymous',
>>> -port => 4157,
>>> }
>>> );
>>> and any of
>>> my $genome_db_adaptor = $registry->get_adaptor('pan_homology',
>>> 'compara', 'GenomeDB');
>>> my $genome_db_adaptor = $registry->get_adaptor('metazoa', 'compara',
>>> 'GenomeDB');
>>> my $genome_db_adaptor = $registry->get_adaptor('protists', 'compara',
>>> 'GenomeDB');
>>>
>>> etc etc I will get the same exception we discussed earlier
>>>
>>> -------------------- WARNING ----------------------
>>> MSG: protists is not a valid species name (check DB and API version)
>>> FILE: Bio/EnsEMBL/Registry.pm LINE: 1159
>>> CALLED BY: Bio/EnsEMBL/Registry.pm LINE: 953
>>> Ensembl API version = 65
>>> ---------------------------------------------------
>>>
>>> -------------------- EXCEPTION --------------------
>>> MSG: Can not find internal name for species 'protists'
>>> STACK
>>> Bio::EnsEMBL::Registry::get_adaptor<MYPATH>/ensembl/modules/Bio/EnsEMBL/Registry.pm:955
>>>
>>> STACK toplevel<MYCODE>
>>> Ensembl API version = 65
>>> ---------------------------------------------------
>>>
>>> Can you help?
>>>
>>> Thanks
>>> Giuseppe
>>>
>>> On 20/01/12 17:34, Andy Yates wrote:
>>>> Hi Giuseppe,
>>>>
>>>> It is a strong response to the problem but we have seen an increase
>>>> in the number of errors users are reporting that they cannot call a
>>>> method on an undefined value. The hope is that this will help users
>>>> diagnose the issues themselves. The problem we saw with implementing
>>>> checks to solve this issue is that it is impossible to know if we
>>>> are dealing with a mis-configured checkout of Ensembl (has a user
>>>> checked out HEAD and looking for v66 DBs on our public servers) or a
>>>> user who is intentionally going after this data. The errors give a
>>>> clear message something is wrong with their setup.
>>>>
>>>> As for your situation I am sorry that this was such a breaking
>>>> change for you. I'm glad that the proposed fixes have been able to
>>>> get you back on track
>>>>
>>>> Best regards,
>>>>
>>>> Andy
>>>>
>>>> Andrew Yates Ensembl Core Software Project Leader
>>>> EMBL-EBI Tel: +44-(0)1223-492538
>>>> Wellcome Trust Genome Campus Fax: +44-(0)1223-494468
>>>> Cambridge CB10 1SD, UK http://www.ensembl.org/
>>>>
>>>> On 20 Jan 2012, at 17:23, Giuseppe G. wrote:
>>>>
>>>>> Hi Andy,
>>>>>
>>>>> I understand the problem however the solution seems i.m.o. a bit
>>>>> strong and the message returned by the warning a bit misleading for
>>>>> those with matching api/db version. Would it maybe be possible to
>>>>> do these version checks at the registry level rather than at the
>>>>> adaptor level? Anyway thank you for your suggestion, I will use
>>>>> that method you suggest from now on.
>>>>>
>>>>> Best,
>>>>> Giuseppe
>>>>>
>>>>> On 20/01/12 15:52, Andy Yates wrote:
>>>>>> Hi Giuseppe,
>>>>>>
>>>>>> I'm sorry that you are encountering this issue. The reason why
>>>>>> this change was put into place was to avoid/inform users when they
>>>>>> fail to connect to Ensembl with the correct database version. This
>>>>>> is why the warning mentions that you should check the DB& API
>>>>>> versions. Considering the amount of messages we get about this
>>>>>> each release I am reluctant to revert this behaviour.
>>>>>>
>>>>>> If you want to check if a species is known you can do the following:
>>>>>>
>>>>>> my $species = 'ScerS288c';
>>>>>> my $type = 'core';
>>>>>> my $alias_exists = Bio::EnsEMBL::Registry->alias_exists($species);
>>>>>> if($alias_exists) {
>>>>>> my $a = Bio::EnsEMBL::Registry->get_adaptor($species, $type, 'Gene');
>>>>>> }
>>>>>>
>>>>>> Which would tell you if the species existed and then get the gene
>>>>>> adaptor if it is available. You could also use:
>>>>>>
>>>>>> my $dba = Bio::EnsEMBL::Registry->get_DBAdaptor($species, $type, 1);
>>>>>> if($dba) {
>>>>>> my $a = $dba->get_GeneAdaptor();
>>>>>> }
>>>>>>
>>>>>> Both are valid& would not require you to do too much recoding.
>>>>>>
>>>>>> Hope this has helped you out
>>>>>>
>>>>>> Andy
>>>>>>
>>>>>> On 20 Jan 2012, at 12:34, Giuseppe G. wrote:
>>>>>>
>>>>>>> Hi again
>>>>>>>
>>>>>>> I'm on release 65, Bioperl 1.6.1.
>>>>>>>
>>>>>>> A line like the following
>>>>>>>
>>>>>>> my $gene_adaptor = $registry->get_adaptor('ScerS288c', 'core',
>>>>>>> 'Gene');
>>>>>>>
>>>>>>> will return the exception
>>>>>>>
>>>>>>> -------------------- WARNING ----------------------
>>>>>>> MSG: ScerS288c is not a valid species name (check DB and API
>>>>>>> version)
>>>>>>> FILE: Bio/EnsEMBL/Registry.pm LINE: 1159
>>>>>>> CALLED BY: Bio/EnsEMBL/Registry.pm LINE: 953
>>>>>>> Ensembl API version = 65
>>>>>>> ---------------------------------------------------
>>>>>>>
>>>>>>> -------------------- EXCEPTION --------------------
>>>>>>> MSG: Can not find internal name for species 'ScerS288c'
>>>>>>> STACK Bio::EnsEMBL::Registry::get_adaptor
>>>>>>> /home/giuseppe/src/ensembl/modules/Bio/EnsEMBL/Registry.pm:955
>>>>>>> STACK<MYCODE>
>>>>>>> Ensembl API version = 65
>>>>>>> ---------------------------------------------------
>>>>>>>
>>>>>>> instead of returning an undef.
>>>>>>>
>>>>>>> This happens whenever the query species is not contained in the
>>>>>>> genomeDB. So every time I try to get an adaptor with an
>>>>>>> unrecognised species (may be a typo, a strain name like
>>>>>>> Saccharomyces cerevisiae S288c, etc) I'll get this exception.
>>>>>>>
>>>>>>> The behaviour, up to v64, was different. I got an undefined
>>>>>>> $gene_adaptor and I could then go back to the taxon object and
>>>>>>> climb up the taxonomy to get the parent taxon (in the example
>>>>>>> case, 'Saccharomyces cerevisiae') and try once more to get a gene
>>>>>>> adaptor with the parent taxon binomial name.
>>>>>>>
>>>>>>> I *could* get round this exception by downloading all of the
>>>>>>> available binomal species names from a genome adaptor - comparing
>>>>>>> my species name against them, then trying to get the gene adaptor
>>>>>>> only if my species is in the genome adaptor array - however this
>>>>>>> is far from optimal (as I need to deal with EnsemblGenomes
>>>>>>> species names as well).
>>>>>>>
>>>>>>> Would it be possible to restore the former behaviour? Thanks a lot!
>>>>>>>
>>>>>>> Giuseppe
>>>>>>>
>>>>>>> --


The University of Edinburgh is a charitable body, registered in 
Scotland, with registration number SC005336.




More information about the Dev mailing list