From b3bc2302e1c0e613262af9f486d26941427d705c Mon Sep 17 00:00:00 2001
From: Magali Ruffier <mr6@ebi.ac.uk>
Date: Mon, 15 Oct 2012 14:08:02 +0000
Subject: [PATCH] default user is ensro and default port is 3306 if data_uri is
 defined, all connection details can be read for vega and core databases
 source_prefix is read from data_uri as well, so no need to hard-code it in
 the module if there is a source_prefix, it is a merged species, else, skip
 the module alltogether

---
 .../XrefParser/curated_transcriptParser.pm    | 36 ++++++-------------
 1 file changed, 11 insertions(+), 25 deletions(-)

diff --git a/misc-scripts/xref_mapping/XrefParser/curated_transcriptParser.pm b/misc-scripts/xref_mapping/XrefParser/curated_transcriptParser.pm
index 226ab773ec..04a32d46f9 100644
--- a/misc-scripts/xref_mapping/XrefParser/curated_transcriptParser.pm
+++ b/misc-scripts/xref_mapping/XrefParser/curated_transcriptParser.pm
@@ -27,47 +27,33 @@ sub run_script {
 
   my ($type, $my_args) = split(/:/,$file);
   
-  my $host;
+  my ($host, $source_prefix);
   my $user = "ensro";
 
   if($my_args =~ /user[=][>](\S+?)[,]/){
     $user = $1;
   }
-  my %id2name = $self->species_id2name;
-  my $species_name = $id2name{$species_id}[0];
-  my $source_prefix;
-  if($species_name eq "homo_sapiens" ){
-    $source_prefix = "HGNC";
-    $host = "ens-staging1";
-  }
-  elsif($species_name eq "mus_musculus" ){
-    $source_prefix = "MGI";
-    $host = "ens-staging2";
-  }
-  elsif($species_name eq "danio_rerio" ){
-    $source_prefix = "ZFIN_ID";
-    $host = "ens-staging1";
+  if($my_args =~ /host[=][>](\S+?)[,]/){
+    $host = $1;
   }
-  if($species_name eq "sus_scrofa" ){
-    $source_prefix = "PIGGY";
-    $host = "ens-staging2";
+  if ($my_args =~ /source[=][>](\S+?)[,]/){
+    $source_prefix = $1;
   }
-  else{
+  my %id2name = $self->species_id2name;
+  my $species_name = $id2name{$species_id}[0];
+  if (!$source_prefix){
     die "Species is $species_name and is not homo_sapiens, mus_musculus, danio_rerio or sus_scrofa, the only four valid species\n";
   }
 
-  if($my_args =~ /host[=][>](\S+?)[,]/){
-    $host = $1;
-  }
-  my $vuser  ="ensro";
+  my $vuser = "ensro";
   my $vhost;
-  my $vport;
+  my $vport = 3306;
   my $vdbname;
   my $vpass;
  
   my $cuser  ="ensro";
   my $chost;
-  my $cport;
+  my $cport = 3306;
   my $cdbname;
   my $cpass;
 
-- 
GitLab