sub new {
my $class = shift;
my $self = $class->SUPER::new(@_);
my ($analysis, $block_size, $value_type, $region_features) =
rearrange(['ANALYSIS','BLOCK_SIZE','VALUE_TYPE','REGION_FEATURES'],@_);
if($analysis) {
if(!ref($analysis) || !$analysis->isa('Bio::EnsEMBL::Analysis')) {
throw('-ANALYSIS argument must be a Bio::EnsEMBL::Analysis not '.
$analysis);
}
}
if($value_type ne "sum" and $value_type ne "ratio"){
throw('-VALUE_TYPE argument must be "ratio" or "sum" not *'.
$value_type."*");
}
$block_size ||= 0;
$region_features ||= 0;
if($block_size && $region_features){
throw('Set either -BLOCK_SIZE or -REGION_FEATURES, not both');
}
if( $block_size <0 or $region_features < 0 ) {
throw( 'No negative values for -BLOCK_SIZE or -REGION_FEATURES' );
}
$self->{'analysis'} = $analysis;
$self->{'block_size'} = $block_size;
$self->{'value_type'} = $value_type;
$self->{'region_features'} = $region_features;
return $self;
}