Skip to content
Snippets Groups Projects
Commit 7cf91f59 authored by Andy Yates's avatar Andy Yates
Browse files

[ENSCORESW-264] Can now handle odd sequence region names involving . - _ now....

[ENSCORESW-264] Can now handle odd sequence region names involving . - _ now. The supercontig names seemed to be a good source of these
parent 0d3aac53
No related branches found
No related tags found
No related merge requests found
......@@ -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) {
......
......@@ -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;
......
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