From 2b1a1e6dbec93a8a7735d3a603fa12eee3312466 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andreas=20Kusalananda=20K=C3=A4h=C3=A4ri?=
 <ak4@sanger.ac.uk>
Date: Wed, 1 Dec 2010 11:39:11 +0000
Subject: [PATCH] Allow for using 'regulation' as a group name alias for
 'funcgen'.

---
 modules/Bio/EnsEMBL/Registry.pm | 35 +++++++++++++++++++--------------
 1 file changed, 20 insertions(+), 15 deletions(-)

diff --git a/modules/Bio/EnsEMBL/Registry.pm b/modules/Bio/EnsEMBL/Registry.pm
index 4814aa2038..12d24892f5 100644
--- a/modules/Bio/EnsEMBL/Registry.pm
+++ b/modules/Bio/EnsEMBL/Registry.pm
@@ -133,20 +133,21 @@ use vars qw(%registry_register);
 # This is a map from group names to Ensembl DB adaptors.  Used by
 # load_all() and reset_DBAdaptor().
 my %group2adaptor = (
-  'blast'         => 'Bio::EnsEMBL::External::BlastAdaptor',
-  'compara'       => 'Bio::EnsEMBL::Compara::DBSQL::DBAdaptor',
-  'core'          => 'Bio::EnsEMBL::DBSQL::DBAdaptor',
-  'estgene'       => 'Bio::EnsEMBL::DBSQL::DBAdaptor',
-  'funcgen'       => 'Bio::EnsEMBL::Funcgen::DBSQL::DBAdaptor',
-  'haplotype'     => 'Bio::EnsEMBL::ExternalData::Haplotype::DBAdaptor',
-  'hive'          => 'Bio::EnsEMBL::Hive::DBSQL::DBAdaptor',
-  'lite'          => 'Bio::EnsEMBL::Lite::DBAdaptor',
-  'ontology'      => 'Bio::EnsEMBL::DBSQL::OntologyDBAdaptor',
-  'otherfeatures' => 'Bio::EnsEMBL::DBSQL::DBAdaptor',
-  'pipeline'      => 'Bio::EnsEMBL::Pipeline::DBSQL::DBAdaptor',
-  'snp'           => 'Bio::EnsEMBL::ExternalData::SNPSQL::DBAdaptor',
-  'variation'     => 'Bio::EnsEMBL::Variation::DBSQL::DBAdaptor',
-  'vega'          => 'Bio::EnsEMBL::DBSQL::DBAdaptor',
+      'blast'      => 'Bio::EnsEMBL::External::BlastAdaptor',
+      'compara'    => 'Bio::EnsEMBL::Compara::DBSQL::DBAdaptor',
+      'core'       => 'Bio::EnsEMBL::DBSQL::DBAdaptor',
+      'estgene'    => 'Bio::EnsEMBL::DBSQL::DBAdaptor',
+      'funcgen'    => 'Bio::EnsEMBL::Funcgen::DBSQL::DBAdaptor',
+      'regulation' => 'Bio::EnsEMBL::Funcgen::DBSQL::DBAdaptor',
+      'haplotype' => 'Bio::EnsEMBL::ExternalData::Haplotype::DBAdaptor',
+      'hive'      => 'Bio::EnsEMBL::Hive::DBSQL::DBAdaptor',
+      'lite'      => 'Bio::EnsEMBL::Lite::DBAdaptor',
+      'ontology'  => 'Bio::EnsEMBL::DBSQL::OntologyDBAdaptor',
+      'otherfeatures' => 'Bio::EnsEMBL::DBSQL::DBAdaptor',
+      'pipeline'      => 'Bio::EnsEMBL::Pipeline::DBSQL::DBAdaptor',
+      'snp'       => 'Bio::EnsEMBL::ExternalData::SNPSQL::DBAdaptor',
+      'variation' => 'Bio::EnsEMBL::Variation::DBSQL::DBAdaptor',
+      'vega'      => 'Bio::EnsEMBL::DBSQL::DBAdaptor'
 );
 
 
@@ -938,10 +939,14 @@ sub get_adaptor {
     'assemblyexceptionfeature' => 1
   );
 
-  ## warn "$species, $group, $type";
+  # warn "$species, $group, $type";
 
   $type = lc($type);
 
+  # For historical reasons, allow use of group 'regulation' to refer to
+  # group 'funcgen'.
+  if ( lc($group) eq 'regulation' ) { $group = 'funcgen' }
+
   my $dnadb_group =
     $registry_register{_SPECIES}{$species}{ lc($group) }{'_DNA'};
 
-- 
GitLab