Commit 9d471c43 authored by Graham McVicker's avatar Graham McVicker
Browse files

allow end to be one less than start so that we can handle insertions

parent 0d3d16f6
......@@ -306,8 +306,8 @@ sub fetch_by_region {
$end = $length if(!defined($end));
if($end < $start) {
throw("start [$start] must be less than or equal to end [$end]");
if($end+1 < $start) {
throw("start [$start] must be less than or equal to end+1 [$end+1]");
}
return Bio::EnsEMBL::Slice->new(-COORD_SYSTEM => $cs,
......
......@@ -121,8 +121,8 @@ sub new {
}
if(defined($start) && defined($end)) {
if($end < $start) {
throw('-START argument must be less than -END argument');
if($end+1 < $start) {
throw('Start must be less than or equal to end+1');
}
}
......
......@@ -135,7 +135,7 @@ sub new {
$seq_region_name || throw('SEQ_REGION_NAME argument is required');
defined($start) || throw('START argument is required');
defined($end) || throw('END argument is required');
($start <= $end) || throw('start must be less than or equal to end');
($start <= $end+1) || throw('start must be less than or equal to end+1');
$seq_region_length = $end if(!defined($seq_region_length));
......
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