Skip to content
Snippets Groups Projects
Commit f3591508 authored by Graham McVicker's avatar Graham McVicker
Browse files

seq_region_start|end could have returned undef inappropraitely when one (but...

seq_region_start|end could have returned undef inappropraitely when one (but not both) of the features end|start was undefined
parent 8b636940
No related branches found
No related tags found
No related merge requests found
...@@ -708,12 +708,12 @@ sub seq_region_start { ...@@ -708,12 +708,12 @@ sub seq_region_start {
my $slice = $self->{'slice'}; my $slice = $self->{'slice'};
return undef if(!$slice); return undef if(!$slice);
return undef if(!defined($self->{'start'}));
return undef if(!defined($self->{'end'}));
if($slice->strand == 1) { if($slice->strand == 1) {
return undef if(!defined($self->{'start'}));
return $slice->start() + $self->{'start'} - 1; return $slice->start() + $self->{'start'} - 1;
} else { } else {
return undef if(!defined($self->{'end'}));
return $slice->end() - $self->{'end'} + 1; return $slice->end() - $self->{'end'} + 1;
} }
} }
...@@ -724,7 +724,7 @@ sub seq_region_start { ...@@ -724,7 +724,7 @@ sub seq_region_start {
Arg [1] : none Arg [1] : none
Example : print $feature->seq_region_end(); Example : print $feature->seq_region_end();
Description: Convenience method which returns the absolute end of this Description: Convenience method which returns the absolute end of this
feature on the seq_region, as opposed to the relative (slice) feature on the seq_region, as opposed to the relative (slice)
position. position.
Returns undef if this feature is not on a slice. Returns undef if this feature is not on a slice.
...@@ -739,12 +739,12 @@ sub seq_region_end { ...@@ -739,12 +739,12 @@ sub seq_region_end {
my $slice = $self->{'slice'}; my $slice = $self->{'slice'};
return undef if(!$slice); return undef if(!$slice);
return undef if(!defined($self->{'start'}));
return undef if(!defined($self->{'end'}));
if($slice->strand == 1) { if($slice->strand == 1) {
return undef if(!defined($self->{'end'}));
return $slice->start() + $self->{'end'} - 1; return $slice->start() + $self->{'end'} - 1;
} else { } else {
return undef if(!defined($self->{'start'}));
return $slice->end() - $self->{'start'} + 1; return $slice->end() - $self->{'start'} + 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