Skip to content
Snippets Groups Projects
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
curated_transcriptParser.pm 6.75 KiB
package XrefParser::curated_transcriptParser;

use strict;
use File::Basename;

use base qw( XrefParser::BaseParser );

use Bio::EnsEMBL::Registry;
my $reg = "Bio::EnsEMBL::Registry";


sub run_script {
  my $self = shift;
  my $file = shift;
  my $source_id = shift;
  my $species_id = shift;
  my $verbose = shift;

  my ($type, $my_args) = split(/:/,$file);
  
  my $host;
  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";
  }
  else{
    die "Species is $species_name and is not homo_sapines, mus_musculus or danio_rerio the only three valid species\n";
  }

  if($my_args =~ /host[=][>](\S+?)[,]/){
    $host = $1;
  }
  my $vuser  ="ensro";
  my $vhost;
  my $vport;
  my $vdbname;
  my $vpass;
 
  my $cuser  ="ensro";
  my $chost;
  my $cport;
  my $cdbname;
  my $cpass;

  if($my_args =~ /chost[=][>](\S+?)[,]/){
    $chost = $1;
  }
  if($my_args =~ /cport[=][>](\S+?)[,]/){
    $cport =  $1;
  }
  if($my_args =~ /cdbname[=][>](\S+?)[,]/){
    $cdbname = $1;
  }
  if($my_args =~ /cpass[=][>](\S+?)[,]/){