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

use strict;
use vars qw( %GeneBuilder );

# Hash containing config info
%GeneBuilder = (				
		# introns smaller than this could be real due to framshifts
		MINSHORTINTRONLEN    => 7, 
		
		# introns between smaller than this is considered too short
		MAXSHORTINTRONLEN    => 10, 
		
                # introns longer than this are too long
		MINLONGINTRONLEN     => 100000, 
		
		# exons smaller than this could be real due to framshifts
		MINSHORTEXONLEN      => 3, 
		
		# exons shorter than this are too short
		MAXSHORTEXONLEN      => 10, 
		
		# exons longer than this are probably too long
		MINLONGEXONLEN       => 5000, 
		
		MINTRANSLATIONLEN    => 10, 

		MAX_EXONSTRANSCRIPT  => 150, 

		MAXTRANSCRIPTS       => 10, 
		MAXGENELEN           => 2_000_000, 

		IGNOREWARNINGS       => 1, 	    

	       );

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
  # all of GeneBuilder:
  my @vars = @_ ? @_ : keys( %GeneBuilder );
  return unless @vars;
  
  # Predeclare global variables in calling package
  eval "package $callpack; use vars qw("
    . join(' ', map { '$'.$_ } @vars) . ")";
    die $@ if $@;


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

1;
