From 3c2b7d36ae1c88ddf6fff491c663a5431f998952 Mon Sep 17 00:00:00 2001 From: Graham McVicker <mcvicker@sanger.ac.uk> Date: Mon, 23 Feb 2004 15:27:50 +0000 Subject: [PATCH] corrected bug in Slice::subseq which did not correctly obtain sequence when slice sequence was manually loaded --- modules/Bio/EnsEMBL/Slice.pm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/Bio/EnsEMBL/Slice.pm b/modules/Bio/EnsEMBL/Slice.pm index f18186787c..b1115e00e1 100644 --- a/modules/Bio/EnsEMBL/Slice.pm +++ b/modules/Bio/EnsEMBL/Slice.pm @@ -70,6 +70,7 @@ use Bio::EnsEMBL::Utils::Argument qw(rearrange); use Bio::EnsEMBL::Utils::Exception qw(throw deprecate warning); use Bio::EnsEMBL::RepeatMaskedSlice; +use Bio::EnsEMBL::Utils::Sequence qw(reverse_comp); #inheritance to Bio::EnsEMBL::Root will eventually be removed @ISA = qw(Bio::EnsEMBL::Root Bio::PrimarySeqI); @@ -474,8 +475,9 @@ sub subseq { $subseq = ${$seqAdaptor->fetch_by_Slice_start_end_strand ( $self, $start, $end, $strand )}; - }else{ - $subseq = substr ($self->seq(), ($start-1), $end); + } else { + $subseq = substr ($self->seq(), $start-1, $end - $start + 1); + reverse_comp(\$subseq) if($strand == -1); } return $subseq; } -- GitLab