diff --git a/modules/Bio/EnsEMBL/DBSQL/SliceAdaptor.pm b/modules/Bio/EnsEMBL/DBSQL/SliceAdaptor.pm index 8faa1c630617a4795df0060fa5a3eb7e8f9b6743..5f2dc2227c25f744fb9f3bfbc492fef4339ca7d8 100644 --- a/modules/Bio/EnsEMBL/DBSQL/SliceAdaptor.pm +++ b/modules/Bio/EnsEMBL/DBSQL/SliceAdaptor.pm @@ -531,7 +531,7 @@ sub parse_location_to_values { my $number_regex = qr/[0-9,_ E]+/xms; my $strand_regex = qr/[+-1]|-1/xms; - my $regex = qr/^(\w+) \s* :? \s* ($number_regex)? $separator_regex ($number_regex)? $separator_regex ($strand_regex)? $/xms; + my $regex = qr/^((?:\w|\.|_|-)+) \s* :? \s* ($number_regex)? $separator_regex ($number_regex)? $separator_regex ($strand_regex)? $/xms; my ($seq_region_name, $start, $end, $strand); if(($seq_region_name, $start, $end, $strand) = $location =~ $regex) { diff --git a/modules/t/sliceAdaptor.t b/modules/t/sliceAdaptor.t index 92d2f6ecc728d5982349e7f0eabe9466788cb564..05061da10324af9bf8176fc6f4944cf54484136c 100644 --- a/modules/t/sliceAdaptor.t +++ b/modules/t/sliceAdaptor.t @@ -482,6 +482,15 @@ dies_ok { $slice_adaptor->fetch_by_toplevel_location('1:1_000_000_000..100', 1); ok(!defined $slice_adaptor->fetch_by_toplevel_location('wibble', 1), 'Checking with a bogus region returns undef'); ok(!defined $slice_adaptor->fetch_by_toplevel_location('1:-100--50', 1), 'Checking with a bogus region with negative coords returns undef'); +{ + #Non standard name check + my ($name, $start, $end, $strand) = $slice_adaptor->parse_location_to_values('GL21446.1'); + is($name, 'GL21446.1', 'Name parses out'); + ok(!defined $start, 'Start is undefined'); + ok(!defined $end, 'End is undefined'); + ok(!defined $strand, 'Strand is undefined'); +} + sub test_toplevel_location { my ($location, $cs_name, $seq_region_name, $start, $end, $strand) = @_; $strand ||= 1;