Skip to content
Snippets Groups Projects
Commit ce90f958 authored by Eugene Kulesha's avatar Eugene Kulesha
Browse files

exons of the genes overlapping chromosome origin are attached to the normal...

exons of the genes overlapping chromosome origin are attached to the normal slice, but with negative coordinates
parent 19458db9
No related branches found
No related tags found
No related merge requests found
...@@ -1441,27 +1441,28 @@ sub seq { ...@@ -1441,27 +1441,28 @@ sub seq {
return undef; return undef;
} }
if ( $self->slice->start() > $self->slice->end() if ($self->slice->is_circular() ) {
&& $self->slice->is_circular() ) if ( $self->slice->start > $self->slice->end) {
{ # Normally exons overlapping chromosome origin will have negative feature start, but slice will be from 1 .. length
my $mid_point = # But in case you got an exon attached to a sub slice try this
$self->slice()->seq_region_length() - my $mid_point = $self->slice()->seq_region_length() - $self->slice()->start() + 1;
$self->slice()->start() + 1; my $seq1 = $self->slice()->subseq( $self->start(), $mid_point, $self->strand() );
my $seq1 = my $seq2 = $self->slice()->subseq( $mid_point + 1, $self->end(), $self->strand() );
$self->slice()
->subseq( $self->start(), $mid_point, $self->strand() ); $seq = $self->strand() > 0 ? "$seq1$seq2" : "$seq2$seq1";
} elsif ( $self->start < 0) {
my $seq2 = # Normally exons overlapping chromosome origin will have negative start
$self->slice() my $start_point = $self->slice->seq_region_length + $self->slice->start;
->subseq( $mid_point + 1, $self->end(), $self->strand() ); my $mid_point = $self->slice->seq_region_length;
my $seq1 = $self->slice->subseq( $self->start, $mid_point, $self->strand);
$seq = $self->strand() > 0 ? "$seq1$seq2" : "$seq2$seq1"; my $seq2 = $self->slice->subseq(1, $self->end, $self->strand );
$seq = $self->strand > 0 ? "$seq1$seq2" : "$seq2$seq1";
} else {
$seq = $self->slice()->subseq( $self->start(), $self->end(), $self->strand() );
}
} else { } else {
$seq = $seq = $self->slice()->subseq( $self->start(), $self->end(), $self->strand() );
$self->slice()
->subseq( $self->start(), $self->end(), $self->strand() );
} }
$self->{'_seq_cache'} = $seq; $self->{'_seq_cache'} = $seq;
......
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