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

fix so that PredictionTranscript->translation->seq() works like normal Transcript

parent 7fa54912
No related branches found
No related tags found
No related merge requests found
......@@ -222,11 +222,22 @@ sub translation {
$end_exon = $exons[0];
}
return
Bio::EnsEMBL::Translation->new(-START_EXON => $start_exon,
-END_EXON => $end_exon,
-SEQ_START => 1,
-SEQ_END => $end_exon->length());
my $pta;
if($self->adaptor()) {
$pta = $self->adaptor()->db()->get_TranslationAdaptor();
} else {
warning("PredictionTranscript has no adaptor, may not be able to obtain " .
"translation");
}
return Bio::EnsEMBL::Translation->new
(-ADAPTOR => $pta,
-START_EXON => $start_exon,
-END_EXON => $end_exon,
-SEQ_START => 1,
-SEQ_END => $end_exon->length(),
-SEQ => $self->translate()->seq());
}
......
......@@ -478,6 +478,11 @@ sub length {
sub seq {
my $self = shift;
if(@_) {
$self->{'seq'} = shift;
return $self->{'seq'};
}
return $self->{'seq'} if($self->{'seq'});
my $adaptor = $self->{'adaptor'};
......@@ -487,7 +492,7 @@ sub seq {
my $dbID = $self->{'dbID'};
if(!$dbID) {
warning("Cannot retrieve sequence from Translation - adaptor is not set.");
warning("Cannot retrieve sequence from Translation - dbID is not set.");
}
my $tr_adaptor = $self->{'adaptor'}->db()->get_TranscriptAdaptor;
......
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