Commit 5f3f2359 authored by Eugene Kulesha's avatar Eugene Kulesha
Browse files

reverted the previous *fix*

parent 4d8336c9
......@@ -146,21 +146,28 @@ sub fetch_by_Slice_start_end_strand {
$start = 1 if(!defined($start));
if ( !defined($end) ) {
if ($slice->is_circular) {
} else {
$end = $slice->end() - $slice->start() + 1;
}
}
if ($slice->is_circular) {
if ($start > $end ) {
return $self->_fetch_by_Slice_start_end_strand_circular( $slice, $start, $end, $strand );
}
if ($start < 0) {
$start += $slice->seq_region_length;
}
if ($end < 0) {
$end += $slice->seq_region_length;
}
if ( !defined($end) ) {
}
} else {
if ( !defined($end) ) {
$end = $slice->end() - $slice->start() + 1;
}
}
if ( $start > $end ) {
if ( $slice->is_circular() ) {
return
$self->_fetch_by_Slice_start_end_strand_circular( $slice,
$start, $end, $strand );
} else {
throw("Start must be less than or equal to end.");
}
}
$strand ||= 1;
......@@ -271,31 +278,18 @@ sub _fetch_by_Slice_start_end_strand_circular {
}
if ( !defined($end) ) {
if ($slice->is_circular) {
my $seq1 = ${ $self->_fetch_by_Slice_start_end_strand_circular( $slice, $slice->start, $slice->seq_region_length -1, 1 )};
my $seq2 = ${ $self->_fetch_by_Slice_start_end_strand_circular( $slice, 1, $slice->end, 1 )};
my $seq = $slice->strand > 0 ? "$seq1$seq2" : "$seq2$seq1";
reverse_comp( \$seq ) if ( $strand == -1 );
return \$seq;
} else {
$end = $slice->end() - $slice->start() + 1;
}
$end = $slice->end() - $slice->start() + 1;
}
if ( $start > $end && $slice->is_circular() ) {
my ($seq, $seq1, $seq2);
if ($slice->start < $slice->end) {
my $midpoint = $slice->seq_region_length - $slice->start + 1;
$seq1 = ${ $self->_fetch_by_Slice_start_end_strand_circular( $slice, 1, $midpoint, 1 )};
$seq2 = ${ $self->_fetch_by_Slice_start_end_strand_circular( $slice, $midpoint + 1, $slice->length(), 1 )};
} else {
$seq1 = ${ $self->_fetch_by_Slice_start_end_strand_circular( $slice, $slice->start, $slice->seq_region_length -1, 1 )};
$seq2 = ${ $self->_fetch_by_Slice_start_end_strand_circular( $slice, 1, $slice->end, 1 )};
}
$seq = $slice->strand > 0 ? "$seq1$seq2" : "$seq2$seq1";
reverse_comp( \$seq ) if ( $strand == -1 );
......
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