Commit 2efd152a authored by Andy Yates's avatar Andy Yates
Browse files

Only do cleanup if we had a number

parent 80d5e26c
...@@ -471,20 +471,21 @@ sub fetch_by_toplevel_location { ...@@ -471,20 +471,21 @@ sub fetch_by_toplevel_location {
my $number_seps_regex = qr/\s+|,|_/; my $number_seps_regex = qr/\s+|,|_/;
if(my ($seq_region_name, $start, $end) = $location =~ $regex) { if(my ($seq_region_name, $start, $end) = $location =~ $regex) {
if(defined $start && $start < 1) { if(defined $start) {
warning "Start was less than 1 (${start}) which is not allowed. Resetting to 1" if ! $no_warnings; if($start < 1) {
$start = 1; warning "Start was less than 1 (${start}) which is not allowed. Resetting to 1" if ! $no_warnings;
$start = 1;
}
$start =~ s/$number_seps_regex//g; #cleanup any nomenclature like 1_000 or 1 000 or 1,000
} }
if(defined $end && $end < 1) { if(defined $end) {
throw "Cannot request negative or 0 end indexes through this interface. Given $end but expected something greater than 0"; if($end < 1) {
throw "Cannot request negative or 0 end indexes through this interface. Given $end but expected something greater than 0";
}
$end =~ s/$number_seps_regex//g; #cleanup any nomenclature like 1_000 or 1 000 or 1,000
} }
my $coord_system_name = 'toplevel'; my $coord_system_name = 'toplevel';
#cleanup any nomenclature like 1_000 or 1 000 or 1,000
$start =~ s/$number_seps_regex//g;
$end =~ s/$number_seps_regex//g;
my $slice = $self->fetch_by_region($coord_system_name, $seq_region_name, $start, $end, undef, undef, 0); my $slice = $self->fetch_by_region($coord_system_name, $seq_region_name, $start, $end, undef, undef, 0);
return unless $slice; return unless $slice;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment