1;
# package Bio::EnsEMBL::Pipeline::Config::ExonerateTranscript
# 
# Cared for by EnsEMBL (ensembl-dev@ebi.ac.uk)
#
# Copyright GRL & EBI
#
# You may distribute this module under the same terms as perl itself

# POD documentation - main docs before the code

=head1 NAME

Bio::EnsEMBL::Pipeline::Config::Affy::Exonerate2Affy

=head1 SYNOPSIS

    use Bio::EnsEMBL::Pipeline::Config::Exonerate2Genes;

=head1 DESCRIPTION

This contains the configuration for the  alignment of clone
sequences (dna) against a genome (dna)
using exonerate. So this config looks very similar to that
of any other exonerate-driving config.

The layout of the configuration is a set of hashes,
each one keyed by logic name. There is also a DEFAULT hash,
which is used as the default for all logic names 

=head1 CONTACT

=cut


package Bio::EnsEMBL::Analysis::Config::ExonerateCloneEnds;

use strict;
use vars qw( %Config );

%Config = (
  CLONE_CONFIG => {
    DEFAULT => {
      
      GENOMICSEQS =>   undef, #allowed to be a dir.
      QUERYTYPE   => 'dna',

      # must be a single file containing all clone fasta sequences

      QUERYSEQS   => undef,

      # must supply one, since the queryseqs MUST be a single file 
      IIDREGEXP   => undef,
      DNADB => {
        -dbname   => 'homo_sapiens_core_37_35j',
        -host     => 'ecs2',
        -port     => '3364',
        -user     => 'ensro',
        -pass     => '',
        },
      CHUNKSLIST  => '/ecs2/scratch2/jb16/sheep/listOfChunks.txt',
      OPTIONS     => '--model affine:local --refine full --gapopen -8 --gapextend -2 --bestn 1  --dnawordlen 12 --softmasktarget TRUE --score 300',
    },
    Map_Clone_Ends => {
      
      GENOMICSEQS =>   undef, #allowed to be a dir.
      QUERYTYPE   => 'dna',

      # must be a single file containing all clone fasta sequences

      QUERYSEQS   => undef,

      # must supply one, since the queryseqs MUST be a single file 
      IIDREGEXP   => undef,
      DNADB => {
        -dbname   => 'homo_sapiens_core_37_35j',
        -host     => 'ecs2',
        -port     => '3364',
        -user     => 'ensro',
        -pass     => '',
        },
      CHUNKSLIST  => '/ecs2/scratch2/jb16/sheep/listOfChunks.txt',
      OPTIONS     => '--model affine:local --refine full --gapopen -8 --gapextend -2 --bestn 1  --dnawordlen 12  --softmasktarget TRUE --score 300',
    },
     EXONERATE_CLONE_ENDS => {

      # path to softmasked, dusted sequence on the farm 
      #
 
      GENOMICSEQS  => '/data/blastdb/Ensembl/Human/NCBI35/softmasked_dusted', #allowed to be a dir.    
      QUERYTYPE    => 'dna',

      # must be a single file containing all clone fasta sequences

      QUERYSEQS    => '/ecs2/scratch2/jb16/sheep/sheep_clones_clean.fa',

      # must supply one, since the queryseqs MUST be a single file 
      IIDREGEXP    => '(\d+):(\d+)',
      DNADB => {
        -dbname => 'homo_sapiens_core_37_35j',
        -host   => 'ecs2',
        -port   => '3364',
        -user   => 'ensro',
        -pass   => '',
        },
      OUTDB => {
        -dbname => 'user_sheep_human_clones',
        -host   => 'ia64g',
        -port   => '3306',
        -user   => 'ensadmin',
        -pass   => 'ensembl',
        },
      SEQFETCHDB  => '/ecs2/scratch2/jb16/sheep/sheep_clones_clean_idx',
      OPTIONS   => '--bestn 10  --dnawordlen 12 --softmasktarget TRUE --score 100',
    },
    REFINE_CLONE_ENDS => {
  
      GENOMICSEQS  =>   '/data/blastdb/Ensembl/Human/NCBI35/softmasked_dusted', #allowed to be a dir.
      QUERYTYPE    => 'dna',

      # must be a single file containing all clone fasta sequences

      QUERYSEQS    => '/ecs2/scratch2/jb16/sheep/sheep_clones_clean.fa',

      # must supply one, since the queryseqs MUST be a single file 
      IIDREGEXP    => '(\w+):([\w_\.]+):([\w\.]+):([-\w]+):([-\w]+):([-\w]+):(\w+)',
      DNADB => {
        -dbname => 'homo_sapiens_core_37_35j',
        -host   => 'ecs2',
        -port   => '3364',
        -user   => 'ensro',
        -pass   => '',
        },
      OUTDB => {
        -dbname => 'user_sheep_human_clones',
        -host   => 'ia64g',
        -port   => '3306',
        -user   => 'ensadmin',
        -pass   => 'ensembl',
        },
      SEQFETCHDB  => '/ecs2/scratch2/jb16/sheep/sheep_clones_clean_idx',
      OPTIONS   => '--model affine:local --refine full --gapopen -12 --gapextend -2 --bestn 1  --dnawordlen 12 --softmasktarget TRUE --score 100',
    },
  }
);

sub import {
  my ($callpack) = caller(0); # Name of the calling package
  my $pack = shift; # Need to move package off @_

  # Get list of variables supplied, or else everything
  my @vars = @_ ? @_ : keys( %Config );
  return unless @vars;
  
  # Predeclare global variables in calling package
  eval "package $callpack; use vars qw("
    . join(' ', map { '$'.$_ } @vars) . ")";
    die $@ if $@;


    foreach (@vars) {
	if ( defined $Config{$_} ) {
            no strict 'refs';
	    # Exporter does a similar job to the following
	    # statement, but for function names, not
	    # scalar variables:
	    *{"${callpack}::$_"} = \$Config{ $_ };
	} else {
	    die "Error: Config: $_ not known\n";
	}
    }
}

1;
