diff --git a/modules/Bio/EnsEMBL/Utils/Collector.pm b/modules/Bio/EnsEMBL/Utils/Collector.pm index 513fe5a57c15eae10b6b73c6320d7506ba9a99cf..b268c7f9e7bce476d16bb0209bb24de7c99cb1b5 100644 --- a/modules/Bio/EnsEMBL/Utils/Collector.pm +++ b/modules/Bio/EnsEMBL/Utils/Collector.pm @@ -363,6 +363,38 @@ sub window_sizes { } + + +=head2 has_window_size + + Args : int - window size to validate + Example : if( $collector->has_window_size('30') ){ + #Do something wrt to 30bp window size + } + + Description: Simple utility method to validate whether this Collector + has a given window_size + Returntype : Boolean + Exceptions : Throws if window size not specified + Caller : general + Status : At Risk + +=cut + + +sub has_window_size{ + my ( $self, $size ) = @_; + + if(! defined $size){ + throw('You must pass a window size to validate'); + } + + return grep(/$size/, @$window_sizes); +} + + + + ### Getter/Setters for BLOB collection config # NOTE: Overriding the defaults here may cause a mismatch when the data # is retrieved.