From 68ded492cc54aa0c1ad11b9999d70c27586167e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20Kusalananda=20K=C3=A4h=C3=A4ri?= <ak4@sanger.ac.uk> Date: Tue, 11 Aug 2009 10:15:49 +0000 Subject: [PATCH] Remove on-the-fly addition of computed aliases. Now only uses aliases from the meta table (the meta_key 'species.alias'). --- modules/Bio/EnsEMBL/Registry.pm | 47 +-------------------------------- 1 file changed, 1 insertion(+), 46 deletions(-) diff --git a/modules/Bio/EnsEMBL/Registry.pm b/modules/Bio/EnsEMBL/Registry.pm index fc5bd7325c..453b689b1a 100644 --- a/modules/Bio/EnsEMBL/Registry.pm +++ b/modules/Bio/EnsEMBL/Registry.pm @@ -1849,57 +1849,12 @@ sub find_and_add_aliases { my @aliases; my $species = $dba->species(); - # Some aliases are added programatically. - # 1) The "species_name" - # 2) The "species name" - # 3) The "sname" (1+last part) - # 4) The "snam" (1+3 letters) - # 5) The "spenam" (3+3 letters) - - # Others are read from the meta table. - # 6) Any species.alias - # 7) The species.taxonomy_id - # 8) The assembly.name - # 9) The species.common_name (if it exists) - - # Add the unaltered species name as an alias. - my $alias = $species; - push( @aliases, $alias ); - - # Remove the underscore from the species name and add the result as - # an alias. - $alias =~ tr [_] [ ]; - push( @aliases, $alias ); - - # Add the first letter from the furst part of the species name, - # together with the whole second part as an alias. - $species =~ /^(.)[^_]*_(.*)$/; - $alias = $1 . $2; - push( @aliases, $alias ); - - # As above, but only use the three first letter from the second - # part. - $species =~ /^(.)[^_]*_(...).*$/; - $alias = $1 . $2; - push( @aliases, $alias ); - - # As above, but use three letters from first and second part. - $species =~ /^(...)[^_]*_(...).*$/; - $alias = $1 . $2; - push( @aliases, $alias ); - - # Get data from meta table: - if ( defined($dbh) ) { my $dbname = $dba->dbc()->dbname(); my $sth = $dbh->prepare( sprintf( "SELECT meta_value FROM %s.meta " - . "WHERE meta_key IN (" - . "'species.alias', " - . "'species.taxonomy_id', " - . "'assembly.name', " - . "'species.common_name') " + . "WHERE meta_key = 'species.alias' " . "AND species_id = ?", $dbh->quote_identifier($dbname) ) ); -- GitLab