Commit ce3ff41c authored by Graham McVicker's avatar Graham McVicker
Browse files

made fetch_all_by_PredictionTranscript method more efficient (if exons are not...

made fetch_all_by_PredictionTranscript method more efficient (if exons are not in high-level coord system)
parent 235e1ed3
...@@ -118,7 +118,6 @@ sub fetch_all_by_PredictionTranscript { ...@@ -118,7 +118,6 @@ sub fetch_all_by_PredictionTranscript {
# use 'keep_all' option to keep exons that are off end of slice # use 'keep_all' option to keep exons that are off end of slice
my $tslice = $transcript->slice(); my $tslice = $transcript->slice();
my $slice; my $slice;
...@@ -126,16 +125,13 @@ sub fetch_all_by_PredictionTranscript { ...@@ -126,16 +125,13 @@ sub fetch_all_by_PredictionTranscript {
throw("Transcript must have attached slice to retrieve exons."); throw("Transcript must have attached slice to retrieve exons.");
} }
if($transcript->start < 1 || $transcript->end > $tslice->length()) { # use a small slice the same size as the prediction transcript
$slice = $self->db->get_SliceAdaptor->fetch_by_Feature($transcript); $slice = $self->db->get_SliceAdaptor->fetch_by_Feature($transcript);
} else {
$slice = $tslice;
}
my $exons = $self->fetch_all_by_Slice_constraint($slice, $constraint); my $exons = $self->fetch_all_by_Slice_constraint($slice, $constraint);
# remap exon coordinates if necessary # remap exon coordinates if necessary
if($slice != $tslice) { if($slice->name() ne $tslice->name()) {
my @out; my @out;
foreach my $ex (@$exons) { foreach my $ex (@$exons) {
push @out, $ex->transfer($tslice); push @out, $ex->transfer($tslice);
......
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