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

made it possible to unset a translation; it was not possible to do this once one was set before

parent b51fa097
No related branches found
No related tags found
No related merge requests found
......@@ -344,12 +344,13 @@ sub translation {
my $self = shift;
if( @_ ) {
my $value = shift;
if( ! ref $value || !$value->isa('Bio::EnsEMBL::Translation') ) {
throw("This [$value] is not a translation");
if( defined($value) &&
(!ref($value) || !$value->isa('Bio::EnsEMBL::Translation'))) {
throw("Bio::EnsEMBL::Translation argument expected.");
}
$self->{'translation'} = $value;
} elsif( !exists $self->{'translation'} and defined $self->adaptor() ) {
$self->{'translation'} =
} elsif( !exists($self->{'translation'}) and defined($self->adaptor())) {
$self->{'translation'} =
$self->adaptor()->db()->get_TranslationAdaptor()->
fetch_by_Transcript( $self );
}
......
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