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::ExonerateAlignFeature;

use strict;
use vars qw( %Config );

%Config = (
  EXONERATE_ALIGNFEAT_CONFIG => {
    DEFAULT => {
      
      GENOMICSEQS => '/path/to/genome/file/or/dir',
      QUERYTYPE   => 'dna',
      QUERYSEQS   => '/path/to/query/file/or/dir',

      # the following is only needed if using chunking
      IIDREGEXP   => '(\d+):(\d+)',

      # insert your options here. Note: this system does not support
      # the transcript-based models (est2genome, protein2genome); use
      # Exonerate2Genes for that
      OPTIONS     => '--model affine:local --bestn 1 --softmasktarget TRUE ',

      FILTER => { OBJECT     => 'Bio::EnsEMBL::Analysis::Tools::SomeFilter',
                  PARAMETERS => {},              
                },

      }
    },
  }
);

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;
