#
# package Bio::EnsEMBL::Analysis::Config::IgSegBuilder
# 
# 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::Analysis::Config:IgSegBuilder

=head1 SYNOPSIS

    use Bio::EnsEMBL::Analysis::Config::Genebuild::IgSegBuilder;

=cut


package Bio::EnsEMBL::Analysis::Config::GeneBuild::IgSegBuilder;

use strict;
use vars qw( %Config );

# Hash containing config info
%Config = (
           IGSEG_CONFIG_BY_LOGIC => {
             DEFAULT => {

               TRANDB_DATABASES_NAME => 'IG_EXONERATE_DB',
               LV_LOGICS => [],
               D_LOGICS  => [],
               J_LOGICS  => [],
               C_LOGICS  => [],

               LV_OUTPUT_BIOTYPE => 'LV_segment',
               D_OUTPUT_BIOTYPE => 'D_segment',
               J_OUTPUT_BIOTYPE => 'J_segment',
               C_OUTPUT_BIOTYPE => 'C_segment',

               SUPPORTING_FEATURE_OUTPUT_LOGIC => '',

               OUTPUTDB_DATABASES_NAME     => 'IG_OUTPUT_DB',

               # D/J genes that are not closer than the distance
               # below to a V/C gene are rejected               
               D_J_PROXIMITY_THRESHOLD => 200000,

             },
           }
           );

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;
