[ensembl-dev] How to handle missing DAS for Ensembl species

Ben Warren Ben.Warren at plantandfood.co.nz
Tue Jan 14 03:21:00 GMT 2014


Hi,

I have just upgraded the my local Ensembl instance to the latest (from version 69 to version 74), and I have a question regarding how to handle species with no DAS url.

In version 69 having no DAS registry URL specified was no problem, but with version 74 this causes Ensembl to break, as explained below.


Why it breaks:
At SpeciesDefs.pm line 533:
https://github.com/Ensembl/ensembl-webcode/blob/release/74/modules/EnsEMBL/Web/SpeciesDefs.pm#L533

sub _merge_db_tree {
  my ($self, $tree, $db_tree, $key) = @_;
  Hash::Merge::set_behavior('RIGHT_PRECEDENT');
  my $t = merge($tree->{$key}, $db_tree->{$key});
  $tree->{$key} = $t;
}

When no DAS is available $db_tree->{$key} returns 'undef' when $dbtree is a das_tree object, which overwrites (due to RIGHT PRECEDENT merge behaviour) the original $tree, thus returning an empty tree which is later stored. This results in the main config file config.packed having missing hash values which should have been loaded from the species.ini/DEAFULTS.ini config files.

I have found 2 solutions(outlined at the end of this email) however both solutions involve altering the Ensembl code in SpecesDefs.pm, which I would rather not do. So is there some other way to disable the DAS so this doesn't happen, perhaps in the species.ini/DEAFULTS.ini or SiteDefs.pm?

I have tried un-setting the 'DAS_REGISTRY_URL' in DEFAULTS.ini, which does stop Ensembl trying to connect to the default DAS registry, but does not prevent the afore-mentioned behaviour.



(Hacky) solutions I have found:

1. Change merge precedence at SpeciesDefs.pm line 532:
        Hash::Merge::set_behavior('RIGHT_PRECEDENT');
        To
        Hash::Merge::set_behavior(LEFT_PRECEDENT');

        * This means the original config tree has priority over any DAS config


2. Only try to process DAS if a DAS_REGISTRY_URL is available
                    * best way to do this seems to be to test for the URL at SpeciesDefs.pm line 630:

    if ($species ne 'MULTI') {
      $self->process_ini_files($species, 'das', $config_packer, $defaults);
      $self->_merge_db_tree($tree, $das_tree, $species);
    }

                    * Change
                    if ($species ne 'MULTI')
       to
       if ($tree->{$species}{'DAS_REGISTRY_URL'} && $species ne 'MULTI')


N.B. These snippets of SpeciesDefs.pm code do not seem to have changed since version 69, so something else must have changed to cause this issue, though I cannot find what that change is... Also this issue exists in version 73 as well (I tried that for comparison).


Kind Regards



Ben Warren
Research Technologist

[cid:image001.gif at 01CF113E.2BEC6170]<http://www.plantandfood.co.nz/>

T: +64 9 925 8615
F: +64 9 925 7001
E: ben.warren at plantandfood.co.nz
www.plantandfood.co.nz
The New Zealand Institute for Plant & Food Research Limited

Postal Address: Plant & Food Research
Private Bag 92169, Auckland Mail Centre, Auckland, 1142, New Zealand
Physical Address: Plant & Food Research
120 Mt Albert Road, Sandringham, Auckland, 1025, New Zealand


The contents of this e-mail are confidential and may be subject to legal privilege.
 If you are not the intended recipient you must not use, disseminate, distribute or
 reproduce all or any part of this e-mail or attachments.  If you have received this
 e-mail in error, please notify the sender and delete all material pertaining to this
 e-mail.  Any opinion or views expressed in this e-mail are those of the individual
 sender and may not represent those of The New Zealand Institute for Plant and
 Food Research Limited.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.ensembl.org/pipermail/dev_ensembl.org/attachments/20140114/ef032dcf/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.gif
Type: image/gif
Size: 6211 bytes
Desc: image001.gif
URL: <http://mail.ensembl.org/pipermail/dev_ensembl.org/attachments/20140114/ef032dcf/attachment.gif>


More information about the Dev mailing list